Azzera filtri
Azzera filtri

Proper (butterworth) bandpass filter

265 visualizzazioni (ultimi 30 giorni)
Emil Brandt
Emil Brandt il 18 Gen 2017
Commentato: Star Strider il 11 Mar 2020
Hey guys! I'm fairly new with signal processing in matlab. I have some labdata that are corrupted by noise. I would like to make a (butterworth) bandpass filter between approx. 0.5 kHz and 1.5 kHz. I have tried a lot of different approaches from browsing the net. My latest attempt looks like this:
%-------- loading time series-----------
time=filtest1000hz(:,1); %time
volin=filtest1000hz(:,2); %volt input [V]
volout=filtest1000hz(:,3); %volt output [mV]
%-------- loading spectrum -----------------
freq=filtestspectrum1000hz(:,1)*10^3; %frequency in kHz
powin=filtestspectrum1000hz(:,2); %power input
powout=filtestspectrum1000hz(:,3); %power output
fs=10*10^(3); %sample rate in kHz
inputsig=powin; %input signal
order=2; %order of filter
fcutlow=0.1; %low cut frequency in kHz
fcuthigh=1.7; %high cut frequency in kHz
filtsig=filter(b,a,inputsig); %filtered signal
This is the output i get (3rd subplot) when i plot the "filtsig" vs. the frequency (freq). You can see the original spectrum (intended) but the filtered spectrum does not even show up:
and this is the format of my data from the time series and the spectrum (input channel and output channel):
I have spend a lot of hours trying to figure out how to do the bandpass properly. Can some of you figure out what is wrong?
Kind regards

Risposte (1)

Jordan Ross
Jordan Ross il 24 Gen 2017
Hello Emil,
I believe the issue is that when you specify the passband frequencies for the filter you are specifying it to be between 0.1 and 1.7Hz instead of the KHz that you are expecting. Therefore, what you need is the following:
fcutlow=100; %low cut frequency in Hz
fcuthigh=1700; %high cut frequency in Hz
Also, I would recommend checking out the Filter Designer tool. In the tool you can export the designed filter to a .m file.
  3 Commenti
Biswajit Ojha
Biswajit Ojha il 11 Mar 2020
For the order, you have to choose numeric values , e.g. 3 or 4 or 5 ..

Accedi per commentare.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by