filters : why very high orders of highpass filters cause frequency shifts in the fft ?

1 view (last 30 days)
Hi everyone, My problem is quite specific, hence the long introduction I have a signal called fileC22. this is a dynamic pressure signal. The acquisition frequency is 1613Hz and the length is 195173 points (see attached file)
I want to plot the DSP of this signal. here is my code :
fdsp(fileC22,'dsp be 5Hz-200A-0,478-2,40 Insta');
where :
function fdsp(X,str)
Fs = 1613; L = 195173;
Y = fft(X);
P2 = abs(Y/L);
P1 = P2(1:(L-1)/2+1);
P1(2:end-1) = 2*P1(2:end-1);
f = Fs*(0:(L/2))/L;
figure1 = figure('Name',str,'Position',[400,100,1200,900]);
% Create axes
axes1 = axes('Parent',figure1,...
'Position',[0.174872665534804 0.112980769230769 0.713073005093379 0.735576923076924]);
hold(axes1,'on');
plot(f,P1)
%set axes' limits
xlim([0 70]);
ylim([0 0.03]);
%create title
title(str,'FontSize',14,'Color',[1 0 0]);
%creat label
xlabel('f (Hz)')
ylabel('amplitude (bar/Hz)')
%save figure
figure1.PaperPositionMode = 'auto';
saveas(figure1,str,'png');
The code works perfectly and returns
however, frequencies that appear upper than 20Hz and lower than 0.1 Hz are parasitic. In order to get rid of them, I apply two filters : one lowpassfir and one highpassfir. Here are their caracteristics
function Sfilt = fflitrage(S,fcoupurehaut, fcoupurebas)
Fech = 1613;
dfhaut = designfilt('lowpassfir','FilterOrder',200,'CutoffFrequency',fcoupurehaut/Fech);
dfbas = designfilt('highpassfir','FilterOrder',4000,'CutoffFrequency',fcoupurebas/Fech);
Sfilt = filter(dfhaut,S);
D = mean(grpdelay(dfhaut));
Sfilt = Sfilt(D+1:end); %ajustement retard
Sfilt = filter(dfbas,Sfilt);
D = mean(grpdelay(dfbas));
Sfilt = Sfilt(D+1:end); %ajustement retard
Sfilt = Sfilt+S(1)-Sfilt(1); %ajustement décalage ordonnées
I need to get rid of frequencies lower than 0.1 Hz but frequencies between 0.1 and 1Hz are physical phenomenons and I need to keep them. That's why I need a very high order for the highpassfilter
this code :
fcoupurehaut = 15; fcoupurebas = 0.1;
fileC22filt = fflitrage(fileC22,fcoupurehaut, fcoupurebas);
fdsp(fileC22filt,'dsp fe 5Hz-200A-0,478-2,40 Insta');
returns
Now, here is the problem, As you might see, very low frequencies didn't disappear on the second figure, even with a 4000 order high pass filter. I tried to skyrocket the order and here is the result :
instead
dfbas = designfilt('highpassfir','FilterOrder',4000,'CutoffFrequency',fcoupurebas/Fech);
I put
dfbas = designfilt('highpassfir','FilterOrder',50000,'CutoffFrequency',fcoupurebas/Fech);
and here is the result (with the same code than previously)
First we couldn't erase the very low frequencies and second we observe that the 10Hz maximum shifts to lower frequencies. Is anyone able to explain me why, and tell me how to do to finally erase very low frequencies (without shifting the others) ?

Answers (0)

Community Treasure Hunt

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

Start Hunting!