How can I transform a transfer function to a filter?
56 views (last 30 days)
Show older comments
Hello,
I am trying to design a filter with the order 2, that equals to this PT2 transfer function:
s
-----------------
s^2 + 4.1 s + 0.4
or as code:
s=tf('s');
pt2 = s/((s+0.1)*(s+4));
You can try
bode(pt2);
to check how it looks (bandpass) - and therefore what I expect the filter to look like.
I have a vector of about 800 freqencies on discrete points, which should be filtered with the given pt2 transfer function (some frequencies more important than others). So that the freqencies will be weighted in the output.
So I am trying to design a filter that looks just as the pt2 tf function (bode plot). Ive read about how to transform a filter to a transfer function, but I didnt figure out if and how to do this the other way round.
What I tried so far:
designedFilter_1 = designfilt('bandpassiir', 'FilterOrder', 2, ...
'PassbandFrequency1', .45, ...
'PassbandFrequency2', .55, ...
'PassbandRipple', 1);
which provides a bandpass that has kind of the same shape as my pt2, but its not the same.
Basically my question is: do I have to try out different options in designfilt, until I get the same shape like my pt2 transfer function. Or can I somehow create a filter directly from my pt2 transfer function?
Any help appreciated.
0 Comments
Accepted Answer
Ameer Hamza
on 5 Dec 2020
Filtering through a transfer function is equivalent to simulating the dynamic control system with an unfiltered signal at the input and getting the filtered output. Therefore, you can use lsim(): https://www.mathworks.com/help/control/ref/lti.lsim.html
0 Comments
More Answers (0)
See Also
Categories
Find more on Analog Filters in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!