How to filter a signal with a transfer function?
104 次查看(过去 30 天)
显示 更早的评论
Hi!
I have a discrete signal (a vector with many values) I want to filter using a low pass filter but I only have the tranfer function in the
form. How can I do this since the common filter functions dont use
transforms?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/631435/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/631440/image.png)
0 个评论
采纳的回答
Star Strider
2021-5-26
The easiest approach is to first let the Control System Toolbox solve it, then realise it as a discrete filter using the numerator and denominator vectors —
z = tf('z');
H = (1-z^-6)^2 / (1-z^-1)^2
Num = H.Numerator
Den = H.Denominator
figure
freqz(Num{:}, Den{:}, 2^16)
Use ‘Num{:}’ and ‘Den{:}’ with filtfilt to filter the signal.
Remember that it will be necessary to define a sampling interval, ‘Ts’ where ‘Ts=1/Fs’ where ‘Fs’ is the sampling frequency.
.
2 个评论
Star Strider
2021-5-27
No, use the filtfilt function to filter ‘x’.
Assuming that the sampling interval or sampling frequency is defined in the first tf call:
Fs = 1000; % Define Sampling Frequency
Ts = 1/Fs;
z = tf('z',Ts);
H = (1-z^-6)^2 / (1-z^-1)^2
Num = H.Numerator
Den = H.Denominator
figure
freqz(Num{:}, Den{:}, 2^16, Fs)
x = [-233....-667]
x_filtered = filtfilt(Num{:}, Den{:}, x)
and go from there.
.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Digital Filtering 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!