Designing a Butterworth Filter
7 views (last 30 days)
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 :)
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);