MATLAB: Vibration Analysis FFT – Cut off frequency

cut-off frequencyfft

Hello everyone,
I am new to Matlab and am currently working on the vibration analysis.
I have measured the acceleration at three different points (Fs = 1000 Hz). Since I have a noise signal in my FFT every 50 Hz (50, 100, 150, … Hz) (PICTURE below) I would like to filter this out. I have tried it with a 6th order low pass Butterworth filter (cut-off frequency 40 Hz), but I am very unsure if this does not change my raw data too much, as there are other eigenmodes at about 60 Hz, 130 Hz and 240 Hz.
Thank you!

Best Answer

A FIR ‘comb’ filter is perfect for this sort of problem! The problem with IIR filters (such as the Butterworth design) is that it is necessary to put them in series to get the desired result.
See if this does what you want:
Fs = 1000;
fcomb = [[47 49.5 50.5 52], [47 49.5 50.5 52]+50, [47 49.5 50.5 52]+100, [47 49.5 50.5 52]+150];
mags = [[1 0 1], [0 1], [0 1], [0 1]];
dev = [[0.5 0.1 0.5], [0.1 0.5], [0.1 0.5], [0.1 0.5]];
[n,Wn,beta,ftype] = kaiserord(fcomb,mags,dev,Fs);
hh = fir1(n,Wn,ftype,kaiser(n+1,beta),'noscale');
figure
freqz(hh, 1, 2^20, Fs)
producing this Bode plot:
I wrote the code so that adding more stopbands should be straightforward. To add more of them, simply add more ‘sections’ to ‘fcomb’, ‘mags’ and ‘dev’. I made the stopbands sufficiently narrow so as not to delete excessive data from your signal that you will likely want to keep. (This is a ‘long’ filter — the order is 560 — however if it is only necessary to run it once for each record, it should still be fairly efficient.) Experiment with it to get different results.
Use the filtfilt function to do the actual filtering.
.