energy of a signal in t and f domain

5 ビュー (過去 30 日間)
Ray Lee
Ray Lee 2014 年 12 月 3 日
コメント済み: Ray Lee 2014 年 12 月 5 日
The energy of a signal is expected to be the same in t and f domain.
n = 1e4;
dx = 0.25;
x = rand(n,1) -0.5;
ex = sum(x.^2) *dx; % energy in t domain
y = fft(x);
fs = 1/dx;
df = fs/n;
ya = abs(y);
ey = sum(ya.^2) *df; % energy in f domain
but from the code, ey/ex=16, exactly the squared fs.
what's the problem?

採用された回答

Star Strider
Star Strider 2014 年 12 月 3 日
You need to normalise the fft by dividing it by the length of the signal:
y = fft(x)/length(x);
See the documentation for fft for details.
  2 件のコメント
Ray Lee
Ray Lee 2014 年 12 月 4 日
Before, I got ey/ex=16
after normalization, I got ey/ex=1.6000e-07
Ray Lee
Ray Lee 2014 年 12 月 5 日
it seems y = fft(x) / fs

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

その他の回答 (1 件)

Ray Lee
Ray Lee 2014 年 12 月 5 日
I found the solution myself.
Normalizing spectral amplitude by fs will work.
But I don't know why to do this.

カテゴリ

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