diff --git a/applications/lofar2/model/pfir_coeff.m b/applications/lofar2/model/pfir_coeff.m index aaad53b2b40ee985d793f23dff60e5a9a89676b3..af6c3ae340b7243fbd4535fd6523300922f976a2 100644 --- a/applications/lofar2/model/pfir_coeff.m +++ b/applications/lofar2/model/pfir_coeff.m @@ -64,11 +64,12 @@ elseif M2<=1024 else Q = L; % use interpolation to speed up calculation %Q = 1; % no interpolation -end +end % initial filter length M1=N*L/Q; -% pass bandwidth +% pass bandwidth, w_pb, is the normalized cutoff frequency in the range between 0 and 1 (where 1 corresponds to the +% Nyquist frequency (as defined in fircls1) w_pb = Q * BWchan; % compute initial filter @@ -97,7 +98,7 @@ else % 1b) Use DIY fourier interpolation method f1=fft(h_comp); f2=zeros(1, M2); - % copy the lower frequency half. + % copy the lower frequency half. n=0:M1/2; f2(1+n)=f1(1+n); % to make the impulse response symmetric in time, @@ -108,10 +109,10 @@ else f2(M2-n)=conj(f2(2+n)); % back to time domain h_fourier = real(ifft(f2)); - + % 2) Use resample interpolation method h_resample = resample(h_comp, Q, 1); - + % select FIR coefficients from either interpolation method (all are good, but resample causes peek gratings in stopband when N>64) if strcmp(config.interpolate, 'resample') h_fir = h_resample; @@ -142,4 +143,4 @@ if nof_bits>0 end; % output FIR coefficient -coeff = h_fir; \ No newline at end of file +coeff = h_fir;