function h = antialiasingfilter( q, fftlength, N)
% h = antialiasingfilter( q, fftlength)
%
%   Computes the firls anti-aliasing filter corrsponding
%   to a subsampling of 1/q and having a fft length of
%   fftlength

beta = 5;
if nargin < 3
  N=10; % Length of the FIR filter
end
fc = 1/q;
L = 2*N*q + 1;
%h = p*firls( L-1, [0 2*fc 2*fc 1], [1 1 0 0]).*kaiser(L,beta)' ;
h1 = firls( L-1, [0 fc fc 1], [1 1 0 0]).*kaiser(L,beta)' ;
h = zeros( fftlength, 1);
h(1:L) = h1(:);


