# Low Pass FIR Filter [closed]

I want to design FIR low-pass filter with the following specifications:

 Cut-off frequency: 200 Hz

Order: 20

Sampling frequency: 1000 Hz


what should be the stepwise method to do so

• Which software do you use? Or do you need to do this by hand? Note that your specs are very general and for this reason many methods are possible. – Matt L. Apr 28 '14 at 19:58
• using matlab but not but in funtions – farhan Apr 28 '14 at 20:21
• So you cannot use any functions of the Signal Processing Toolbox? – Matt L. Apr 28 '14 at 20:25
• No, I cannot use any of the function from signal processing tool box. – farhan Apr 28 '14 at 20:28

Your filter is highly under-specified, so I assume that your design is supposed to be very basic. A very basic method would be to simply truncate and shift the impulse response of an ideal low pass filter with cutoff frequency $\omega_c=2\pi f_c/f_s=0.4\pi$ (where $f_s$ is the sampling frequency):

$$h_{ideal}(n)=\frac{\sin(\omega_c n)}{\pi n}$$

Note that since your filter must be causal you need to shift and truncate the ideal impulse response such that it is symmetric with respect to its maximum:

$$h(n)=\frac{\sin(\omega_c (n-10))}{\pi (n-10)},\quad n=0,1,\ldots,20\tag{1}$$

Equation (1) gives you the 21 filter coefficients $h(n)$ of a causal FIR filter approximating an ideal low pass filter response. Note that the filter order is 20.

A simple Matlab/Octave code could look like this:

n = -10:10;
omc = 0.4*pi;           % normalized cut-off frequency in rad
h = sin(omc*n)./(pi*n); % impulse response
h(11) = omc/pi;         % correct NaN value at n=0
H = fft(h,1024);        % complex frequency response
f = 1000/1024*(0:512);  % FFT frequency grid up to fs/2
plot(f,abs(H(1:513)));  % plot magnitude of frequency response

• @farhan: You're welcome! If you feel that your question has been answered satisfactorily, you can accept it by hitting the 'accept' button next to the answer. – Matt L. Apr 29 '14 at 18:16
• there are options of active and oldest no option of accept any where – farhan Apr 29 '14 at 18:43
• can u help me if I wanted to draw a filter using rectangular window? – farhan Apr 29 '14 at 18:58
• @farhan: There's a checkmark on the top left of the answer. What do you mean exactly by "draw a filter using rectangular window"? Make a plot of its frequency response? – Matt L. Apr 29 '14 at 19:38
• Yes, I really want that code – farhan Apr 29 '14 at 20:44