# Calculating stopband cut-off frequency and stopband attenuation for FIR lowpass window filter

I am aiming to create a digital windowing FIR filter on MATLAB and have been given specs such as a:

• sampling frequency of 360Hz
• maximum filter order of 5
• cut-off frequency of 98Hz/ 1.710rad/sample (normalised)

The cut-off frequency was approximated by doing a DFT on the noisy signal that needs filtering, i have put an image below. I am unsure how to calculate or approximate the stopband cut-off frequency and stopband attenuation and i would really appreciate any advice.

DFT of the noise signal

DFT of original signal

• Maximum order of 5 would be really small (and ineffective) as an FIR filter. The requirement for order<5 would make more sense for an IIR filter. You could filter this with either but you may ultimately be concerned with a maximum tolerable delay. The cutoff freq would typically be where you want the filter to start rolling off, but from your plot and description I think you mean the start of the stopband frequency? What is driving your specs? (Is this a homework problem, or an actual application? And if an application what is the goal?) Commented Mar 23 at 15:20
• This is for an assignment where artificial noise has been put over an original signal where we are being expected to create both FIR and IIR digital filters to get back to the original signal and both must have a maximum order of 5. I had assumed the cut-off would be relating to the passband frequency Commented Mar 23 at 15:30
• Got it, the assignment must be to show you how much better the IIR filter will be when you are limited in total order. Can you also show the spectrum before the noise is added or can we assume it is identical to the spectrum above without the portion that starts after f>100? The plots would be more useful if the vertical axis was in dB. Your filter performance is maximized when you can increase the distance between passband and cutoff so you want the passband as small as acceptable and stopband as high as possible; without seeing the signal without noise, it is tough to set that. Commented Mar 23 at 15:36
• I will edit the post to show the DFT on the original signal but it shows exactly what you said. I understand what you are saying about the gap between passband and stopband. Commented Mar 23 at 15:45