23
23
% reconstruction error.
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}
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
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
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);
58
error('%s: Internal error. Filterbank should be FIR. ',...
61
% Use next suitable length
62
L = filterbanklength(info.longestfilter,a);
52
[g,asan,info]=filterbankwin(g,a,L,'normal');
55
% Pick shortest possible length for FIR filterbank
56
L = filterbanklength(info.longestfilter,asan);
64
error(['%s: L must be specified when working with filters defined ',...
65
' in frequency.'], upper(mfilename));
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));
69
[g,info]=filterbankwin(g,a,L,'normal');
72
65
if L~=filterbanklength(L,a)
83
76
% Uniform filterbank, use polyphase representation
85
error('%s: You need to specify L.',upper(mfilename));
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);
96
G(:,ii)=cast(comp_transferfunction(g{ii},L),thisclass);
79
% Transfer functions of individual filters as cols
80
G = filterbankfreqz(g,a,L);
127
111
if info.ispainless
129
error('%s: You need to specify L.',upper(mfilename));
132
gtout = comp_painlessfilterbank(g,info.a,L,'tight',0);
112
gtout = comp_painlessfilterbank(g,asan,L,'tight',0);
135
114
error(['%s: The canonical dual frame of this system is not a ' ...
136
115
'filterbank. You must call an iterative ' ...