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

« back to all changes in this revision

Viewing changes to inst/filterbank/filterbanktight.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:
23
23
%   reconstruction error. 
24
24
%
25
25
%@end verbatim
26
 
%@strong{Url}: @url{http://ltfat.sourceforge.net/doc/filterbank/filterbanktight.php}
 
26
%@strong{Url}: @url{http://ltfat.github.io/doc/filterbank/filterbanktight.html}
27
27
%@seealso{filterbank, filterbankdual, ufilterbank, ifilterbank}
28
28
%@end deftypefn
29
29
 
30
 
% Copyright (C) 2005-2014 Peter L. Soendergaard <soender@users.sourceforge.net>.
31
 
% This file is part of LTFAT version 2.0.1
 
30
% Copyright (C) 2005-2015 Peter L. Soendergaard <peter@sonderport.dk>.
 
31
% This file is part of LTFAT version 2.1.0
32
32
%
33
33
% This program is free software: you can redistribute it and/or modify
34
34
% it under the terms of the GNU General Public License as published by
49
49
   L = [];
50
50
end
51
51
 
52
 
if isempty(L)
53
 
    if ~all(cellfun(@(gEl) isfield(gEl,'H'),g))
54
 
        % All filters are FIR, therefore filterbankwin can be called without L
55
 
        [~,info]=filterbankwin(g,a);
56
 
        if ~info.isfir
57
 
            % Just a sanity check
58
 
            error('%s: Internal error. Filterbank should be FIR. ',...
59
 
                  upper(mfilename));
60
 
        end
61
 
        % Use next suitable length
62
 
        L = filterbanklength(info.longestfilter,a);
 
52
[g,asan,info]=filterbankwin(g,a,L,'normal');
 
53
if isempty(L) 
 
54
    if info.isfir
 
55
        % Pick shortest possible length for FIR filterbank
 
56
        L = filterbanklength(info.longestfilter,asan);
63
57
    else
64
 
        error(['%s: L must be specified when working with filters defined ',...
65
 
           ' in frequency.'], upper(mfilename));
66
 
   end
 
58
        % Just thow an error, nothing reasonable can be done without L
 
59
        error(['%s: L must be specified when not working with FIR ',...'
 
60
               'filterbanks.'], upper(mfilename));
 
61
    end
67
62
end
68
 
 
69
 
[g,info]=filterbankwin(g,a,L,'normal');
70
63
M=info.M;
71
64
 
72
65
if L~=filterbanklength(L,a)
81
74
 
82
75
if info.isuniform
83
76
  % Uniform filterbank, use polyphase representation
84
 
  if isempty(L)
85
 
      error('%s: You need to specify L.',upper(mfilename));
86
 
  end;
87
 
 
88
77
  a=a(1);
89
78
 
90
 
  % G1 is done this way just so that we can determine the data type.
91
 
  G1=comp_transferfunction(g{1},L);
92
 
  thisclass=assert_classname(G1);
93
 
  G=zeros(L,M,thisclass);
94
 
  G(:,1)=G1;
95
 
  for ii=2:M
96
 
    G(:,ii)=cast(comp_transferfunction(g{ii},L),thisclass);
97
 
  end;
 
79
  % Transfer functions of individual filters as cols
 
80
  G = filterbankfreqz(g,a,L);
 
81
  thisclass = class(G);
98
82
  
99
83
  N=L/a;
100
84
  
125
109
  
126
110
else
127
111
    if info.ispainless
128
 
        if isempty(L)
129
 
            error('%s: You need to specify L.',upper(mfilename));
130
 
        end;
131
 
        
132
 
        gtout = comp_painlessfilterbank(g,info.a,L,'tight',0);
133
 
        
 
112
        gtout = comp_painlessfilterbank(g,asan,L,'tight',0);
134
113
    else
135
114
        error(['%s: The canonical dual frame of this system is not a ' ...
136
115
               'filterbank. You must call an iterative ' ...