I have to filter strong motion data using a bandpass n=4 butterworth filter with cut-off frequencies of 0.01 and 40Hz. I have the original time series x(t) which I included in a txt file below. However I'm new with signal processing and I'm not sure if my filter is right and the fft functions are used correctly. Here is the code I have :
Fs=1/Ts; %200Hz
fn=1/(2*Ts);fhc=0.8*fn/(Fs/2); %40Hz
flc=0.01/(Fs/2); %0.01Hz
Wn=[flc fhc];f=(0:Nf-1)*Fs/Nf;X=fft(x,Nf);[b,a]=butter(1,Wn,'bandpass');Y=filtfilt(b,a,X);y=ifft(Y,'symmetric');figure()loglog(f,abs(X*Ts),'b',f,abs(Y3*Ts),'r');hfvt=fvtool(b,a,'FrequencyScale','log','Fs',Fs);
When I plot the fourier's amplitude spectrum I get a downward shift in the spectrum. I'm not sure why it does that as the magnitudes plot using fvtool in between the cut-off frequencies are equal to 0. See below :
<<
>>
Thanks in advance.
Best Answer