1
function H = comp_nyquistfilt(wintype,fs,chan_max,freqtoscale,scaletofreq,bwmul,bins,Ls)
3
%@deftypefn {Function} comp_nyquistfilt
5
%COMP_NYQUISTFILT high-pass filter for warped filter banks
7
%@strong{Url}: @url{http://ltfat.github.io/doc/comp/comp_nyquistfilt.html}
10
% Copyright (C) 2005-2015 Peter L. Soendergaard <peter@sonderport.dk>.
11
% This file is part of LTFAT version 2.1.0
13
% This program is free software: you can redistribute it and/or modify
14
% it under the terms of the GNU General Public License as published by
15
% the Free Software Foundation, either version 3 of the License, or
16
% (at your option) any later version.
18
% This program is distributed in the hope that it will be useful,
19
% but WITHOUT ANY WARRANTY; without even the implied warranty of
20
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
% GNU General Public License for more details.
23
% You should have received a copy of the GNU General Public License
24
% along with this program. If not, see <http://www.gnu.org/licenses/>.
27
while scaletofreq(kk-bwmul) < fs/2;
32
Minpos = ceil(Ls/fs*scaletofreq(chan_max+1/bins-bwmul));
33
samples = freqtoscale((Minpos-1:floor(Ls/2))*fs/Ls);
35
FILTS = zeros(round(bins*(Maxfilt-chan_max)),numel(samples));
36
for kk = 1:size(FILTS,1)
37
FILTS(kk,:) = firwin(wintype,(samples-(chan_max+kk/bins))/(2*bwmul));
39
H = zeros(2*numel(samples)-1,1);
40
H(1:numel(samples)) = sqrt(sum(abs(FILTS.^2),1));
41
H(numel(samples)+1:end) = H(numel(samples)-1:-1:1);