Incorrect Frequency response from Transfer Function

6 ビュー (過去 30 日間)
kevin Russell
kevin Russell 2022 年 3 月 18 日
編集済み: Paul 2022 年 3 月 18 日
So I was trying to model the frequency response from a transfer function from an already known output. I'm unsure why my frequencies are way higher than the samples.
Here is the transfer function:
my code:
b = [1 0 0];
a = [1 909.09090909091 206611.57024793];
w = logspace(0,6);
h = freqs(b,a,w);
dB = mag2db(abs(h));
phase = angle(h);
phasedeg = phase*180/pi;
subplot(2,1,1)
semilogx(w,dB)
grid on
yticks(linspace(-120,0,13))
xlabel('Frequency (hz)')
ylabel('Magnitude (dB)')
subplot(2,1,2)
semilogx(w,phasedeg)
grid on
xlabel('Frequency (hz)')
ylabel('Phase (degrees)')
%calculate cut off frecuecy
f=1/(2*pi*10000*220*10^-9);
display(f);
my output:
Correct output:

採用された回答

Paul
Paul 2022 年 3 月 18 日
編集済み: Paul 2022 年 3 月 18 日
The frequency input to freqs is in rad/sec. If you want to match the correct output, the code will at least need to be:
whz = logspace(-1,4,500);
h = freqs(b,a,whz*2*pi); % edit: originally had freqz, not freqs
% etc.

その他の回答 (0 件)

カテゴリ

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