Normalizing frequency for fir1() matlab function:??

I am trying to implement an FIR low pass filter using fir1() function but I am confused in normalizing the frequencies.Whether I had to divide my frequencies by fs or fs/2 for normalization to be used as Wn. Which one will give me the correct results?

 Respuesta aceptada

Star Strider
Star Strider el 18 de Jul. de 2016

3 votos

Always normalise by the Nyquist frequency, in your example ‘fs/2’ if ‘fs’ is your sampling frequency.

4 comentarios

Kapal
Kapal el 19 de Jul. de 2016
So if the sampling frequency is 366 Hz the normalized will be 183 but it should be between 0 to 1 how??
The filter frequencies have to be less than 183 Hz, so for example for your lowpass filter, if you choose a cutoff frequency of 70 Hz, the frequency you would give to fir1 would be 70/183:
filtord = 48; % Filter Order
Fs = 366; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
Fc = 70; % Cutoff Frequency
blp = fir1(filtord, Fc/Fn); % Calculate Filter Coefficients
Filter designs are low-pass by default, so you do not need to specify that for your filter. (You would have to specify different designs for all other types.) You can add window functions and other options for your filter by adding the necessary arguments to your fir1 call.
I also always use freqz to look at the Bode plot of the filter to be sure it does what I want it to.
Merve ozdas
Merve ozdas el 21 de Sept. de 2022
why should I use normalization for the cut off frequency?
Star Strider
Star Strider el 22 de Sept. de 2022
@Merve ozdas — Simply because that is the way digital filters are specified and designed. The normalised frequency extends on the interval from 0 (D-C) to π radians/unit (units can be seconds, millimetres, parsecs, or whatever) defining the interval from D-C to the Nyquist frequency. The Nyquist frequency is the highest uniquely identifiable frequency in a sampled signal, and is one-half of the sampling frequency.

Iniciar sesión para comentar.

Más respuestas (0)

Preguntada:

el 18 de Jul. de 2016

Comentada:

el 22 de Sept. de 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by