thank you for your reply, but i want know how to calculate value of the signal energy, from its FFT, the area under the curve is equal to energy of the signal? below code is correct to calculate energy of signal?
fs = 10000; % Sample frequency (Hz)
load imf1.txt;
x=imf1;
t = 1:length(x);
m = length(x); % Window length
n = pow2(nextpow2(m));% Transform length
y = fft(x,n); % DFT
f = (0:n-1)*(fs/n); % Frequency range
power = y.*conj
/n; % Power of the DFT
m = max((fft(x,n)));
figure(1);
plot(f,power)
xlabel('Frequency (Hz)')
ylabel('Power')
title('{\bf Periodogram}')
y0 = fftshift
; % Rearrange y values
f0 = (-n/2:n/2-1)*(fs/n); % 0-centered frequency range
power0 = y0.*conj(y0)/n;% 0-centered power
figure(2);
plot(f0,power0)
xlabel('Frequency (Hz)')
ylabel('Power')
title('{\bf 0-Centered Periodogram}')
figure(3);
h = area(fft(x).^2);
the value of "h" will give the energy of the signal in FFT?? and how to calculate center frequency of the FFT?
please help me!!