Your first amplitude represents 0 frequency. When your data has 0 mean, your first amplitude should also be 0.
FFT
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
I am trying to perform FFT for ambient vibration data and My code calculates such an absurd value like 6.2172e-17 for the first value of Fourier Amplitude Matrix. However, other amplitudes are reasonable and if I plot these amplitudes in loglog figure, I get meaningless plot.
for j=1:3
a{j}=textread(names{j},'%f');
a{j}=detrend(a{j},'constant');
a{j}=detrend(a{j});
if ((60*60)/length(a{j}))==0.02
A{j}=fft(a{j},2^nextpow2(length(a{j})));
A1{j}=abs(A{j}(1:2^nextpow2(length(a{j}))/2))*0.02;
%A1{j}(1)=A1{j}(2);
Fs=50;
f=Fs*(1:2^nextpow2(length(a{j}))/2)/(2^nextpow2(length(a{j})));
figure (j)
loglog(f,A1{j},'b');
title(names1{j});
xlabel('Frequency (Hz)');
ylabel('Fourier Amplitude');
elseif ((60*60)/length(a{j}))==0.01
A{j}=fft(a{j},2^nextpow2(length(a{j})));
A1{j}=abs(A{j}(1:2^nextpow2(length(a{j}))/2))*0.01;
%A1{j}(1)=A1{j}(2);
Fs=100;
f=Fs*(1:2^nextpow2(length(a{j}))/2)/(2^nextpow2(length(a{j})));
figure(j)
loglog(f,A1{j},'b');
title(names1{j});
xlabel('Frequency (Hz)');
ylabel('Fourier Amplitude');
end
end
The cell array are assigned in order to perform 40 FFT calculations for 40 different data texts. What makes Matlab calculate such an absurd value?
댓글 수: 0
답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!