i need to bandpass filter vibration data
i have a signal sampled at 48kHz. i need to extract 40 signals from it. Each of the 40 signal is a band of interest, for example 20 to 600 Hz or 600 to 1200 Hz and so on.
I’v tryed using the command bandpass but is to slow for my needs.
I’v tryed to use fftfilt but it ghives poor result in comparison (amplitude in the filtered waveform is zero! even if the band in the spectrum is occupied by signal)
Could someone help me to find a fast solution for filtering this king of data? (accH is the signal)
This is the code for the 2 kind of filtering:
accH=randn(48000*5,1);% simulating vibration data using randn.
%% bandpass filtering (slow)
LB=0:600:24000-600;LB(1)=20;
UB=600:600:24000;UB(end)=24000-20;
A1=zeros(length(accH),length(LB));
for k=1:length(UB)
A1(:,k)=bandpass(accH,[LB(k) UB(k)],Fs);
end
%% fftfilt filtering (not working)
A=zeros(length(accH),length(LB));
for j=1:length(UB)
bpfilt = designfilt('bandpassfir', ...
'FilterOrder',20,'CutoffFrequency1',LB(k), ...
'CutoffFrequency2',UB(k),'SampleRate',Fs);
`A(:,k)=fftfilt(bpfilt,accH);
end
bandpass vs fftfilt
i attach an image of the results of the filters. In black ther is the waveform of the band from 6000 to 6600 Hz. In red there is the waveform of the fftfilt.
Clearly there are some problems….
I need some suggestion for a fast filtering (i do not need a steep filter)
Sebastian Carta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.