필터 지우기
필터 지우기

Frequency response of discrete PT1

조회 수: 25 (최근 30일)
MOC
MOC 2020년 6월 11일
답변: MOC 2020년 6월 11일
I want to calculate the frequency response of a discrete PT1 system with T=T1 and K=1. (the code is at the bottom of the question)
To validate the magnitude response, I want to use an sinusoidal input signal with linearly increasing frequency from 0 to fs/2.
The magnitude response should be the envelope of the transient response.
However, this is only the case if I change the line
u = sin(2*pi*f.*t);
to
u = sin(pi*f.*t);
Why? I assume that I have any kind of faulty reasoning here, but I can't find it.
Thanks in advance.
clear
%% Input (linear frequency sweep)
Ts = .1e-3;
duration = 30;
t = (0:Ts:duration);
fs = 1/Ts;
f = (fs/2)*t/duration;
u = sin(2*pi*f.*t);
%% PT1-system continuous
T1 = 1e-3;
G = tf(1,[T1 1]);
%% PT1 discretized
H = c2d(G,Ts,'zoh');
%% PT1 trasient response
x0 = 0;
x = lsim(H,u,[],x0,'zoh');
%% PT1 freq. response
[h,~] = freqz(H.Numerator{1:end},H.Denominator{1:end},f,fs);
%% Plot
figure(1),clf(1),hold on
plot(u),plot(x),plot(abs(h))

채택된 답변

MOC
MOC 2020년 6월 11일
Found the error by myself now.
I did not use the instantaneous frequency for the calculation of the sweep signal, as stated here or here.
The corrected code is:
clear
%% Input (linear frequency sweep)
Ts = .1e-3;
duration = 30;
t = (0:Ts:duration);
fs = 1/Ts;
f = (fs/2)*t/duration;
finst = 1/2*(fs/2)/duration*t;
u = sin(2*pi*finst.*t);
%% PT1-system continuous
T1 = 1e-3;
G = tf(1,[T1 1]);
%% PT1 discretized
H = c2d(G,Ts,'zoh');
x0 = 0;
%% PT1 trasient response
x = lsim(H,u,[],x0,'zoh');
%% PT1 freq. response
[h,~] = freqz(H.Numerator{1:end},H.Denominator{1:end},f,fs);
%% Plot
figure(1),clf(1),hold on
plot(u),plot(x),plot(abs(h))

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matched Filter and Ambiguity Function에 대해 자세히 알아보기

제품


릴리스

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by