energy of a signal in t and f domain
5 ビュー (過去 30 日間)
古いコメントを表示
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?
0 件のコメント
採用された回答
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 件)
Paul
2024 年 11 月 10 日 4:22
For a finite duration signal x[n] of length N, and its Discrete Fourier Transform (DFT) X[k] (as computed by fft), the energy relationship is given by Parseval's Theorem: sum(abs(x[n]^2)) = sum(abs(X[k])^2))/N
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
Parseval's Theorem:
[sum(abs(x).^2) sum(abs(y).^2)/n]
If the first term is multiplied by dx, then the second must also be multiplied by dx = 1/fs
[sum(abs(x).^2)*dx sum(abs(y).^2)/n/fs]
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Spectral Measurements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!