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 件のコメント

Ken W
Ken W 2015 年 12 月 17 日
How to calculate variance from spectral density? Could you show me using the source code above?
Thank you.

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

 採用された回答

Star Strider
Star Strider 2015 年 12 月 17 日
編集済み: Star Strider 2015 年 12 月 17 日

0 投票

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 件のコメント

Ken W
Ken W 2015 年 12 月 18 日
Thank you very much
Star Strider
Star Strider 2015 年 12 月 18 日
My pleasure.

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

その他の回答 (0 件)

カテゴリ

質問済み:

2015 年 12 月 17 日

コメント済み:

2015 年 12 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by