フィルターのクリア

How do I normalize the fft output for a signal?

3 ビュー (過去 30 日間)
Tom
Tom 2011 年 2 月 1 日
I've got data taken at 1000hz (1millisecond per sample), and am trying to convert it into the frequency domain. My code is so far
resolution = size(footfall,2);
tempfftvar = abs(fft2(detrend(footfall(:)'),1,2^nextpow2(size(footfall,2))));
fftvar = tempfftvar(1:(size(tempfftvar,2)/2))/resolution;
where footfall is my data. This gives my a graph that looks right, but the frequency scale is incorrect. I read somewhere that MATLAB FFT function doesn't normalise automatically, so above I tried to divide by N, num of samples. This still does not give me the scale I want.
  1 件のコメント
Vieniava
Vieniava 2011 年 2 月 1 日
Why do you use 2D FFT? Do you have image for processing?
Resolution is derived in a wrong way.

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

回答 (1 件)

Vieniava
Vieniava 2011 年 2 月 1 日
Try this:
Fs=1000; % Hz
NFFT=2^nextpow2(size(footfall,2));
resolution=Fs/NFFT; % Hz/bin
faxe=(1:(NFFT/2) - 1)*resolution; % half of spectrum. DC component is taken into account via "-1"

カテゴリ

Help Center および File ExchangeSpectral Measurements についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by