lsim not working with a single pole system

I'm trying to simualte the response of a first oreder low pass system, but I'm getting a strange result so I tried to simulate first a sine input. The result does not appear to be another sine with modified amplitude and phase, so it looks like the output of a non-linear system, so I must be doing something wrong. Here is the code
% system definition
p = -200e3;
z = [];
sys = zpk(z, p, prod(abs(p)));
% input definition
f = 300e3;
x = linspace(0, 2*pi/f, 100e3);
y = sin(f*x);
% simualte
lsim(sys,y,x);
I'm trying to define a low-pass system with a cutoff frequency of 200 kHz. This is the output I'm getting
output.png

답변 (1개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2019년 5월 13일

0 개 추천

Hi,
Everything you have done is ok except for one small (but crucial point):
y = sin(f*x); has to be y = sin(2*pi*f*x);
Then you will get a nice and neat response that can be also verified in Simulink.
Good luck.

카테고리

질문:

2019년 5월 12일

답변:

2019년 5월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by