FFT variance and spectral density

Hi,
I would like to understand the relationship between variance and spectral density. Below is my source code,
a=1:1:10 b=fft(a)
% Parceval theorem p1=sum(a.^2) p2=sum(abs(b).^2)/length(a)
var(a)
I manage to show that p1 = p2 based on Parceval theorem. But how to show that variance of a is equal to power spectral density.
Thank you.

1 comentario

Ken W
Ken W el 17 de Dic. de 2015
How to calculate variance from spectral density? Could you show me using the source code above?
Thank you.

Iniciar sesión para comentar.

 Respuesta aceptada

Star Strider
Star Strider el 17 de Dic. de 2015
Editada: Star Strider el 17 de Dic. de 2015
If you have the Signal Processing Toolbox, you can use the pwelch function to get the confidence intervals. See the documentation on Upper and Lower 95%-Confidence Bounds. You can specify the confidence bounds you want.
To get the variance, first calculate the probability corresponding to one standard deviation:
Npdf = @(x) (1-erf(-x./sqrt(2)))./2;
SD_1 = diff(Npdf([-1 1]))
SD_1 =
682.6895e-003
so use that as the probability for the 'ConfidenceLevel' value. Square the value the function returns to get the variance. (The Statistics Toolbox normcdf function will also produce this probability value.)

2 comentarios

Ken W
Ken W el 18 de Dic. de 2015
Thank you very much
Star Strider
Star Strider el 18 de Dic. de 2015
My pleasure.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Preguntada:

el 17 de Dic. de 2015

Comentada:

el 18 de Dic. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by