Issue Band Pass Filtering Matlab

Viewed 24

I'm trying to bandpass filter the signal between 10 to 450Hz, but something keeps making the output weird. The when the lower cutoff is 30, it still works as expected, but if it gets to 20 or below it get's wonky. Why is this happening?

Fs = 1000; 
t = 0:1/Fs:1;
x = [2 10 20 15 2]*sin(2*pi*[5 60 150 250 550]'.*t) + randn(size(t))/10;

Y = fft(x);
L = length(x);
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
f = Fs*(0:(L/2))/L;

x = abs(x);

bandpass(x,[30 450],Fs)

30 Hz cutoff

20 Hz cutoff

0 Answers
Related