필터 지우기
필터 지우기

Removing DC component at 0 HZ from acceleration data after fft

조회 수: 17 (최근 30일)
Adam Levschuk
Adam Levschuk 2020년 5월 29일
댓글: Nidhi Singh 2022년 2월 11일
Hello,
After i compute the FFT of my acceleration data (Fs = 50 Hz) i am getting a large spike at 0 Hz (the leftover DC component). I have tried subtarcting the mean and detrending my data (detrend(X,2)).
Here is my code:
n = length(acc(:,1));
accX_fft = fft(acc(:,1),n);
PSD = accX_fft.*conj(accX_fft)/n;
freq = linspace(0,50,length(accX_fft));
L = 1:floor(n/2);
plot(freq(L),PSD(L));
The amplitudes of the frequecieis i want to visualize are already very very small, so the spike at 0 Hz is really distorting the view.
Id appreciate any reccomendation on how to get rid of this spike.
  댓글 수: 2
Ameer Hamza
Ameer Hamza 2020년 5월 29일
If subtracting mean does not work, then it might be some other frequency?
Nidhi Singh
Nidhi Singh 2022년 2월 11일
I am having the same doubt. If subtracting the mean doesn't work, than can we use high pass filter here with fft graph?

댓글을 달려면 로그인하십시오.

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 5월 29일
As described here: http://blog.originlab.com/how-to-remove-dc-offset-before-performing-fft try using a high-pass filter to remove very low frequencies from your signal. See highpass(): https://www.mathworks.com/help/releases/R2020a/signal/ref/highpass.html
  댓글 수: 2
Adam Levschuk
Adam Levschuk 2020년 5월 29일
high pass filter worked great. Thanks for the help, Ameer.
Adam
Ameer Hamza
Ameer Hamza 2020년 5월 29일
I am glad to be of help!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Bartlett에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by