DSPRelated.com
Forums

Power Spectral Density Code

Started by Bum February 10, 2006
Does anyone know of a PSD calculating routine other than in Matlab?  

I'm trying to find something I can include into vb 6.0 or vb.net...perhaps
a dll, activeX, or the code itself!  Unfortunately I'm not versed in the
realms of PSD enough to write my own.  I do use a routine from national
instruments DSP toolbox called Auto Power Spectrum which gives the auto
power spectrum (whatever that is) in E.U. rms^2 (like G rms^2).  Would it
be correct to say there is a way to convert this to G rms^2/Hz?  I have an
fft routine that I can use in the calculation if necessary.  Any help would
be greatly appreciated.

Thanx,

B



"Bum" <bradley.bumgardner@us.army.mil> skrev i en meddelelse 
news:W_adnbLcKpaJGXHenZ2dnUVZ_sSdnZ2d@giganews.com...
> Does anyone know of a PSD calculating routine other than in Matlab? >
I assume you are familiar with complex numbers. If you have a sequence x of numbers where x(1) is the first number and x(N) is the last number in your sequence then you can calculate the power spectrum X like this: for k=1 to N tmp_sum=0 for n=1 to N tmp_sum=tmp_sum+x(n)*exp(-j*2*pi*(k-1)*(n-1)/N) end X(k)=abs(tmp_sum)^2 end It's not an optimal way of doing it, but it's straightforward and easy to understand.