フィルターのクリア

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 Center および File ExchangeDigital Filter Analysis についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by