lsim: Remove input signal from plot

14 ビュー (過去 30 日間)
rearyia
rearyia 2019 年 11 月 8 日
コメント済み: rearyia 2019 年 11 月 11 日
I am using the function lsim to plot a system response. How can I remove the input signal from the plot so that it only shows the response?

採用された回答

Robert U
Robert U 2019 年 11 月 8 日
Hi cricketking13,
if you don't want to have lsim plot the default plot, just "collect" the output and plot as you desire:
%% LPF
order = 3;
ripple = 1; %pass band ripple
f_c = 22e6;
[num1, den1] = cheby1(order, ripple, 2*pi*1.10*f_c, 'low', 's');
%% Create input signal
Fs = 200e6;
Ts = 1/Fs;
NFFT = 2^12;
Runtime = (NFFT-1)*Ts;
t = 0:Ts:Runtime;
a_in = 1;
fin = 5e6;
phase_in = 0;
y_in = a_in * sin( 2 * pi * fin * t + phase_in ); % 4096 points
%% filter signal
% create system
myFilter = tf(num1,den1);
% apply filter to time domain signal
[y_out, time] = lsim(myFilter,y_in,t);
% plot without y_in
plot(time,y_out')
Kind regards,
Robert
  1 件のコメント
rearyia
rearyia 2019 年 11 月 11 日
Thank you!

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

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by