High-pass filter

80 ビュー (過去 30 日間)
Guglielmo Giambartolomei
Guglielmo Giambartolomei 2021 年 5 月 12 日
コメント済み: Star Strider 2021 年 7 月 22 日
Hello,
I'm working on acceleration signals coming from an accelerometer that has a sensitivity change of 0% from 2 Hz to 10000 Hz. When I perform the FFT of one this accelerometric signals I often obtain strong low frequency contents close to 0.1 Hz. I would like to cut away all the frequencies before 2 Hz because I don't think they are correct. The code I used is:
Fca=2; %cutoff frequency
[z,p,k]=butter(8,Fca/(Fsa/2),'high');
sos=zp2sos(z,p,k);
%fvtool(sos,'Analysis','freq')
xafiltfilt=filtfilt(sos,g,xa);
%figure;
%plot(ta,xa,ta,xafiltfilt);
%grid on
%title('xa (accelerometric signal)')
%xlabel('t (s)')
%ylabel('Acceleration (g)')
%legend({'Original xa Signal','Actual xa Signal (filtered and realigned signal)'});
%saveas(gcf,'x_acc_filt_comp','jpg')
Xaf=fft(detrend(xafiltfilt),NFFT2_acc)/Na;
figure;
plot(fa,2*abs(Xaf(1:NFFT2_acc/2+1)))
grid on
title('Single-Sided Amplitude Spectrum of xa(t) filtered and realigned Signal')
xlabel('f (Hz)')
ylabel('Xa_filtered(f)')
I was wondering if this type of filter may be adequate.
Thank you very much,
Guglielmo

採用された回答

Star Strider
Star Strider 2021 年 5 月 12 日
It could work, however a better option could be:
Fca = 2;
Fsa = 1000; % Create Parameter
xa = randn(1E+4,1); % Create Signal
[xafiltfilt,hpdf] = highpass(xa, Fca, Fsa, 'ImpulseResponse','iir');
figure
freqz(hpdf.Coefficients, 2^16, Fsa)
set(subplot(2,1,1), 'XLim',[0 10]) % Zoom Frequency Axis
set(subplot(2,1,2), 'XLim',[0 10]) % Zoom Frequency Axis
Compare to the Butterworth design:
[z,p,k]=butter(8,Fca/(Fsa/2),'high');
sos=zp2sos(z,p,k);
figure
freqz(sos, 2^16, Fsa)
set(subplot(2,1,1), 'XLim',[0 10]) % Zoom Frequency Axis
set(subplot(2,1,2), 'XLim',[0 10]) % Zoom Frequency Axis
.
  28 件のコメント
Guglielmo Giambartolomei
Guglielmo Giambartolomei 2021 年 7 月 22 日
Very easy! You are the best! I will always be grateful for your help! Thank you very much!
I was confused because in the previous example we wrote Ws=1.0/Fn and we said that the stopband corner frequency was 2 Hz. As a matter of fact is 1 Hz.
Best regards,
Guglielmo
Star Strider
Star Strider 2021 年 7 月 22 日
As always, my pleasure!
I do not see where I typed that, however I do not always catch all my typographical errors.
.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatched Filter and Ambiguity Function についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by