I have been attempting to design a digital narrow band-pass filter with following parameters. Sampling frequency $f_s = 10^4\,\mathrm{Hz}$, low cutoff frequency $f_{cl} = 290\,\mathrm{Hz}$ and high cutoff frequency $f_{ch} = 310\,\mathrm{Hz}$.
After problems with stability of the iir type I have decided to use the fir type filter. Due to the fact that I am very beginner in the dsp (and I don't have Matlab) I have attempted to exploit the DSP Guide and the Scilab wfir command.
The problem which I have is the filter order. Let's say I will use the design approximation from the DSP Guide (Chapter 16) $M\approx\frac{4}{bw}$. For my filter parameters following holds $bw = \frac{310 - 290}{10^4} = 0.002$ i.e. $M \approx \frac{4}{bw} = 2000$. It seems to me to be a huge filter order. Neverthless I have finished the design
Ts = 100*10^(-6); // sampling period (s) fs = 1/Ts; // sampling frequency (Hz) fbp_low = 290; // low cut-off frequency (Hz) fbp_high = 310; // high cut-off frequency (Hz) // difference equation calculation [filter_coeffs] = wfir('bp', 2000, [fbp_low/fs, fbp_high/fs], 'hm', [0, 0]); // coefficients of the polynomial in the numerator of the transfer funtion B = filter_coeffs; // coefficients of the polynomial in the denominator of the transfer funtion A = 1.0; // Frequency response // polynomial in the numerator of the transfer function in z^-1 num = poly(B, 'invz', 'c'); // polynomial in the denominator of the transfer function in z^-1 den = poly(A, 'invz', 'c'); // relative frequency - w*k*Ts = 2*pi*f/fs*k, maximum of the frequency is f = fs/2 // fr_max = f_max/fs = 0.5 fr = (0:0.0001:0.5); // complex frequency response (transfer function in z^(-1)) // z = exp(s*T) = exp([sigma + j*omega]*T) hf = freq(num, den, exp(-%i*2*%pi*fr)); // magnitude magnitude = abs(hf); // phase hf_imag = imag(hf); hf_real = real(hf); phase = atand(hf_imag, hf_real); scf(); plot(fr, magnitude, 'Linewidth', 2); title('Magnitude'); xlabel('$f_r = \frac{f}{f_s}$'); ylabel('$Mag(H(z))\,(\mathrm{-})$'); xgrid; scf(); plot(fr, phase, 'Linewidth', 2); title('Phase'); xlabel('$f_r = \frac{f}{f_s}$'); ylabel('$Arg(H(z))\,(\mathrm{^\circ})$'); xgrid; and evaluated the frequency response of this filter
As far as the magnitude part I would say that the design specifications have been met. But the filter order seems to me to be so huge that it rules out this filter for practical usage (real time control software). May I ask you for an advice how to set the filter order to get a practically realizable narrow band-pass filter which mets the specification?


