필터 지우기
필터 지우기

Difference in sample time of discrete model and input

조회 수: 2 (최근 30일)
Jatin Sharma
Jatin Sharma 2020년 5월 5일
답변: Abhishek Kumar 2020년 12월 13일
I was going through the algorithms on how MATLAB evaluates convolution in CT system. Example code given on MATLAB is
w2 = 62.83^2;
h = tf(w2,[1 2 w2]);
dt = 0.016;
ts = 0:dt:5;
us = (rem(ts,1) >= 0.5);
hd = c2d(h,dt);
lsim(hd,us)
In the above example sample time of input and TF are the same. I have removed ts from lsim because it was making no difference in this case. So in the output I got 313 samples.
w2 = 62.83^2;
h = tf(w2,[1 2 w2]);
dt = 0.016;
ts = 0:0.02:5;
us = (rem(ts,1) >= 0.5);
hd = c2d(h,dt);
lsim(hd,us)
In the above code sample time of input and TF are different. If i put Ts then it gave an error but when I removed it worked fine. So in the output I had 250 samples. Some of the starting samples matched also.
So my question is how the matlab calculates output in 2nd case ??

채택된 답변

Abhishek Kumar
Abhishek Kumar 2020년 12월 13일
Hi Jatin, given the two codes you have used, the continuous time transfer function is same in both the cases, the differnce is in length of number of samples
>> h1
h1 =
3948
----------------
s^2 + 2 s + 3948
Continuous-time transfer function.
>>dt1 = 0.016;
>>ts1 = 0:dt1:5;
>> length(ts1)
ans =
313
>> h2
h2 =
3948
----------------
s^2 + 2 s + 3948
Continuous-time transfer function.
>>dt2 = 0.016;
>>ts2 = 0:0.02:5;
>> length(ts2)
ans =
251
hence, some of the coefficients are similar you can go through the documentation of functions used for better understanding..

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by