step and impulse response of a system

9 ビュー (過去 30 日間)
SSBGH
SSBGH 2022 年 11 月 13 日
編集済み: Bhavana Ravirala 2023 年 2 月 22 日
i have a question which is the following:
impulse respone of a system is h(t) =( exp(-0.05*t) )
Excitation of a system is x(t) = u(t)*cos(2*pi*t)
1-in subplot 1 show the impulse respone of the system
2-in subplot 2 show the Excitation of the system
3-in subplot 3 show the response of the system
4-in subplot 4 show the step response of the system
where t range is from 0...100
code:
t = 0:100;
u = heaviside(t);
impulse = [];
excitation = [];
for i =1:numel(t)
impulse(i)= exp(-0.05*t(i));
end
for i =1:numel(t)
excitation(i) = u(i).*cos(2.*pi.*t(i));
end
subplot(2,2,1)
plot(t,impulse)
title('impulse response')
subplot(2,2,2)
plot(t,excitation)
title('excitation')
c = conv(excitation,impulse,"same");
subplot(2,2,3)
plot(t,c)
title("Response")
step = conv(u,impulse,"same");
subplot(2,2,4)
plot(t, step)
title("Step Response")
i'm not sure that the solution is correct because i'm getting the response of the system and step response figure both the same, so any ideas whether the solution is good or no?

回答 (1 件)

Bhavana Ravirala
Bhavana Ravirala 2022 年 11 月 16 日
編集済み: Bhavana Ravirala 2023 年 2 月 22 日
Hi,
I understand that you are trying to plot step and impulse response of the system. As the range of ‘t’ is from 0 to 100 you can use “linspace” command. By using these ‘t’ values we will get proper cos signal. And for loops are not required to generate impulse and excitation signals.
t=linspace(0,100); % getting the t values from the linspace command
u=heaviside(t);
excitation=u.*cos(2*pi.*t);
impulse=exp(-0.05*t);
subplot(2,2,1)
plot(t,impulse)
title('impulse response')
subplot(2,2,2)
plot(t,excitation)
title('excitation')
c = conv(excitation,impulse,"same");
subplot(2,2,3)
plot(t,c)
title("Response")
step = conv(u,impulse,"same");
subplot(2,2,4)
plot(t, step)
title("Step Response")

カテゴリ

Help Center および File ExchangeMatched Filter and Ambiguity Function についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by