Error with freqz plot

5 ビュー (過去 30 日間)
Stefan
Stefan 2014 年 8 月 8 日
コメント済み: BHASKER GURRAM 2021 年 3 月 28 日
Hello, I am trying to see the frequency plot of the filter but it is showing error as
The Numerator and denominator of the transfr frunstion must be stored in vectors at this line freqz(sos1,1001);
Fs = 100;
Fn = Fs/2;
% Design First Filter:
Ws1 = [0.2 0.35]/Fn;
n1 = 2; % Filter ORder
R = 20; % Stopband Attenuation
[b1, a1] = cheby2(n1,R,Ws1,'stop'); % Create Filter
[sos1,g1] = tf2sos(b1,a1); % SOS Implementation
figure(5)
freqz(sos1,1001) % Plot Normalised Response
Can anyone explain why is the error showing up. thanks.
  2 件のコメント
Star Strider
Star Strider 2014 年 8 月 8 日
No idea. I just ran that code again (I tested it before I posted it) and it ran without errors (R2014a).
BHASKER GURRAM
BHASKER GURRAM 2021 年 3 月 28 日
i am also facing same problem

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

回答 (1 件)

Honglei Chen
Honglei Chen 2014 年 8 月 8 日
If I remember correctly you have an older version of MATLAB which does not support this syntax. You could try the following instead
freqz(b1,a1,1001)
For a 2nd order filter, they should be pretty much the same.
HTH

カテゴリ

Help Center および File ExchangeDigital Filter Analysis についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by