# How to define Passband and Stopband Attenuation of an IIR Butterworth Filter?

425 views (last 30 days)
EB on 12 Feb 2018
Edited: Shashank on 15 Feb 2018
I want to filter real acceleration data. I have to remove the very low frequencies <1Hz that are dominating my frequency plot. I have designed a HighPass Butterworth IIR Filter usign designfilt, but I don't understand the meaning of stopband and passband attenuation. I know that attenuation at cuttoff is 3db, but how can I calculate the passband and stopband attenuation if I have defined the bandpass frequency and cutoff frequency.
My way of defining the Astop and Apass until now was by guessing, but I guess this is not the correct way of defining these. I would like to know how they can be calculated properly?
This is the PSD of raw acceleration data.
This is the PSD of the filtered data.
Also, this is the code I have used to define the filter
% Sampling frequency in Hz
Fs = 5000;
% Filter order
Nf = 1;
% Band-pass frequency in Hz
Fpass = 1000;
% Cut-off frequency in Hz
Fstop = 0.6;
% Passband attenuation in dB
Apass = 1;
% Stopband attenuation in dB
Astop = 10;
% Design the filter using designfilt
HighPassIIRButterworth = designfilt('highpassiir','PassbandFrequency',Fpass,...
'StopbandFrequency',Fstop,'PassbandRipple',Apass,'StopbandAttenuation',...
Astop,'SampleRate',Fs,'DesignMethod','butter');
% View the filter
fvtool(HighPassIIRButterworth)

Shashank on 15 Feb 2018
Edited: Shashank on 15 Feb 2018
This depends on the filter that you are designing. Generally, it is called Passband ripple and stopband attenuation.
The passband ripple is the amount of variation in the amplitude, within the designated passband of the filter, and stopband attenuation is the minimum attenuation level with the designated rejection band of the filter.