Designing a Butterworth Filter
22 views (last 30 days)
Show older comments
Hey there guys and gals,
i want to design a Butterworth filter for a field oriented control of a permanent magnet synchronous machine. Where a sensor in the rotor tracks the mechanical angle of the rotor. This signal is then differentiated. Because of the differentiation the high frequencies of the noise are amplified, so i need to filter it. Ive decided to model a 2nd order Filter. The motor is supposed to accelerate to n = 16000 rpm which is roughly an angular velocity omega of 1675 rad/min. So my cut off frequency is calculated based on fc = 1 / ( 2 *pi * omega (1675 / 60) ) ? And the pass frequency is everything below fc ?
If you need any clarifications, please let me know.
Thanks for your help in advance :)
0 Comments
Answers (1)
Scott MacKenzie
on 19 Mar 2022
Edited: Scott MacKenzie
on 19 Mar 2022
Here's a solution, but it requires MATLAB's Signal Processing Toolbox.
Given, sRate, the sample rate of your data, fc, the desired cuttoff frequency, and y1, your input signal, then...
% create 2nd-order low-pass butterworth filter
[b, a] = butter(2, fc/(sRate/2), 'low');
% filter the input signal (y1)
y2 = filter(b, a, y1);
3 Comments
Scott MacKenzie
on 20 Mar 2022
Edited: Scott MacKenzie
on 20 Mar 2022
@Oliver-Maximilian Klein, you're welcome. BTW, what is the same rate of your data? And is your cutoff frequency simply the frequency of rotation of the motor, i.e., 16000/60 = 266.7 Hz?
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!