~ubuntu-branches/ubuntu/wily/octave-ltfat/wily-proposed

« back to all changes in this revision

Viewing changes to inst/wavelets/wfilt_remez.m

  • Committer: Package Import Robot
  • Author(s): Sébastien Villemot, Rafael Laboissiere
  • Date: 2015-07-18 23:36:41 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20150718233641-jhuf3f551a3523qc
Tags: 2.1.0+dfsg-1
* Team upload.

[ Rafael Laboissiere ]
* Imported Upstream version 2.1.0+dfsg
* d/rules: Prevent unit testing on armhf and mips.
  This avoids FTBFS on theses architectures (see Bug#765545).
* Unit testing does not need X-window anymore
  + d/rules: Do not use xfvb-run to run the tests.
  + d/control: Drop xauth, xvfb, and gnuplot-nox from Build-Depends.
    Also, the versioned dependency on octave-pkg-dev is relaxed.
* Drop .jar file from upstream tarball, complying with the Debian Policy
  + d/copyright: Exclude file blockproc.jar
  + d/rules: Add get-orig-source target
  + d/watch: Mangle upstream version to cope with "+dfsg" tag
* Build blockproc.jar, which is deleted from the upstream tarball
  + d/rules: Add commands for building blockproc.jar
  + d/control: Build-depend on default-jdk
  + d/p/fix-path-of-included-makefile.patch: New patch
* Bump Standard-Versions to 3.9.6 (no changes needed)
* d/p/autoload-yes.patch: Remove patch (deprecated upstream)
* Bump Build-Depends on octave to >> 4.0.0~rc4-1 (for sndfile support)
* d/check.m: Avoid verbose output of unit tests
* d/watch: Add the repacksuffix option
* d/p/add-hardening-flags.patch: Drop patch (applied upstream)
* d/p/fix-path-of-included-makefile.patch: Drop patch (applied upstream)

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
%     Processing, IEEE Transactions on, 41(8):550 -560, aug 1994.
30
30
%     
31
31
%@end verbatim
32
 
%@strong{Url}: @url{http://ltfat.sourceforge.net/doc/wavelets/wfilt_remez.php}
 
32
%@strong{Url}: @url{http://ltfat.github.io/doc/wavelets/wfilt_remez.html}
33
33
%@end deftypefn
34
34
 
35
 
% Copyright (C) 2005-2014 Peter L. Soendergaard <soender@users.sourceforge.net>.
36
 
% This file is part of LTFAT version 2.0.1
 
35
% Copyright (C) 2005-2015 Peter L. Soendergaard <peter@sonderport.dk>.
 
36
% This file is part of LTFAT version 2.1.0
37
37
%
38
38
% This program is free software: you can redistribute it and/or modify
39
39
% it under the terms of the GNU General Public License as published by
57
57
     error('%s: Too few input parameters.',upper(mfilename)); 
58
58
end
59
59
 
 
60
complainif_notposint(L,'L',mfilename);
 
61
complainif_notposint(L,'K',mfilename);
 
62
 
 
63
if B>0.2
 
64
    error(['%s: Bandwidth of the transition band should not be',...
 
65
           ' bigger than 0.2.'],upper(mfilename));
 
66
end
60
67
 
61
68
poly=remezwav(L,K,B);
62
69
rh=fc_cceps(poly);
63
70
 
64
71
g{1} = flipud(rh(:));
65
72
g{2} = -(-1).^(1:length(rh)).'.*flipud(g{1});
66
 
 
67
 
 
68
 
g = cellfun(@(gEl) struct('h',gEl,'offset',-numel(gEl)/2),g,'UniformOutput',0);
69
 
 
 
73
 
 
74
% Default offset
 
75
d = [0,0];
 
76
  % Do a filter alignment according to "center of gravity"
 
77
  d(1) = -floor(sum((1:L)'.*abs(g{1}).^2)/sum(abs(g{1}).^2));
 
78
  d(2) = -floor(sum((1:L)'.*abs(g{2}).^2)/sum(abs(g{2}).^2));
 
79
  if rem(d(1)-d(2),2)==1
 
80
      % Shift d(2) just a bit
 
81
      d(2) = d(2) + 1;
 
82
  end
 
83
 
 
84
 
 
85
g = cellfun(@(gEl,dEl) struct('h',gEl,'offset',dEl),g,num2cell(d),...
 
86
            'UniformOutput',0);
70
87
h = g;
71
88
 
72
89
a= [2;2];