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?

 採用された回答

Star Strider
Star Strider 2016 年 7 月 18 日

3 投票

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

4 件のコメント

Kapal
Kapal 2016 年 7 月 19 日
So if the sampling frequency is 366 Hz the normalized will be 183 but it should be between 0 to 1 how??
Star Strider
Star Strider 2016 年 7 月 19 日
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 2022 年 9 月 21 日
why should I use normalization for the cut off frequency?
Star Strider
Star Strider 2022 年 9 月 22 日
@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.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

質問済み:

2016 年 7 月 18 日

コメント済み:

2022 年 9 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by