Why does the magnitude response of freqz change with the value of the input argument n?

2 ビュー (過去 30 日間)
Cyrus
Cyrus 2018 年 11 月 4 日
コメント済み: Cyrus 2018 年 11 月 4 日
I am using the freqz command, and the second argument, n, is documented as N-point frequency response. Therefore, I take it to mean that as n gets larger, the resolution of the frequency response should get finer and more smooth. But when I run this command, this is not what happens. Instead, I see the magnitude values changing. This makes no sense, and the documentation is quite poor.

採用された回答

Cyrus
Cyrus 2018 年 11 月 4 日
OH OH OHHHH, I think I found the problem. it should be the third input argument. When I had it as the second, it was changing the actual FIR filter itself!
freqz(B,1,n)
  2 件のコメント
Star Strider
Star Strider 2018 年 11 月 4 日
Please note: you did not ever post the code you used in your freqz call.
Our ability to read minds is in general severely lacking.
Cyrus
Cyrus 2018 年 11 月 4 日
my apologies Star!

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

その他の回答 (2 件)

Cyrus
Cyrus 2018 年 11 月 4 日
編集済み: Cyrus 2018 年 11 月 4 日
To be more clear, when I run freqz(B) the amplitude is nearly 1 until the cutoff, and then falls off to zero - as it should. It's a low pass filter of order 80 using fir1.
When I do freqz(B,2000), the amplitude from zero to the cutoff is now no where near 1, its down to 0.00003. This makes no sense.

Cyrus
Cyrus 2018 年 11 月 4 日
編集済み: Cyrus 2018 年 11 月 4 日
Run this code and change freqz(B) to instead say freqz(B,2000) and see what happens:
rps2Hz = 1/(2*pi);
fs = 1000;
M = 15;
fpass = 0:0.1:fs/(2*M);
frej = fs/(2*M):0.1:fs/2;
order = 80;
wn = 1/M;
B = fir1(order,wn,hamming(order+1));
[h,w] = freqz(B);
figure(2);
plot(fs*w*rps2Hz,abs(h),'linewidth',2.0);
xlabel('freq (Hz)');
ylabel('Amplitude');

カテゴリ

Help Center および File ExchangeBartlett についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by