filtering signal

5 vues (au cours des 30 derniers jours)
Thomas H
Thomas H le 31 Mar 2011
Hi all,
I've been using the FDA-tool in matlab to design a bandpass filter. The frequency area of interest in my case is 2-7 Hz in a biological EEG signal. When I use my filter designed using the FDA-tool it seems to overdamp the signal in the beginning and in the end of the signal. In between it seems alright! I have tried to change my filter design, and to change my input signal, and I doesn't seem to change the overdamping effect. What to do???
My filter function looks like this:
function DataFiltBP = bandpass(dataW)
% M-File generated by MATLAB(R) 7.10 and the Signal Processing Toolbox 6.13.
% Equiripple Bandpass filter designed using the FIRPM function.
% All frequency values are in Hz.
Fs = 200; % Sampling Frequency
N = 1000; % Order
Fstop1 = 1.5; % First Stopband Frequency
Fpass1 = 2; % First Passband Frequency
Fpass2 = 7; % Second Passband Frequency
Fstop2 = 7.5; % Second Stopband Frequency
Wstop1 = 5; % First Stopband Weight
Wpass = 1; % Passband Weight
Wstop2 = 5; % Second Stopband Weight
dens = 20; % Density Factor
% Calculate the coefficients using the FIRPM function.
b = firpm(N, [0 Fstop1 Fpass1 Fpass2 Fstop2 Fs/2]/(Fs/2), [0 0 1 1 0 ...
0], [Wstop1 Wpass Wstop2], {dens});
Hd = dfilt.dffir(b);
DataFiltBP = filter(Hd,dataW);
You can try it out with any input signal, for example:
2*cos(5*pi*t)+sin(2*pi*t)
After using the filter try the following:
t=linspace(0,20,100000)
plot(t,DataFiltBP)
Thanks!

Réponses (1)

altaf adil
altaf adil le 14 Juil 2011
The problem is because of smooth transition of the filter. You can try increasing the density factor.

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by