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개)

카테고리

도움말 센터File Exchange에서 Parametric Spectral Estimation에 대해 자세히 알아보기

질문:

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