energy of a signal in t and f domain

5 visualizaciones (últimos 30 días)
Ray Lee
Ray Lee el 3 de Dic. de 2014
Respondida: Paul el 10 de Nov. de 2024 a las 4:22
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?

Respuesta aceptada

Star Strider
Star Strider el 3 de Dic. de 2014
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 comentarios
Ray Lee
Ray Lee el 4 de Dic. de 2014
Before, I got ey/ex=16
after normalization, I got ey/ex=1.6000e-07
Ray Lee
Ray Lee el 5 de Dic. de 2014
it seems y = fft(x) / fs

Iniciar sesión para comentar.

Más respuestas (2)

Ray Lee
Ray Lee el 5 de Dic. de 2014
I found the solution myself.
Normalizing spectral amplitude by fs will work.
But I don't know why to do this.

Paul
Paul el 10 de Nov. de 2024 a las 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]
ans = 1×2
825.5910 825.5910
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
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]
ans = 1×2
206.3977 206.3977
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>

Categorías

Más información sobre Spectral Measurements en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by