Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Spectrum formula

According to the documentation for the CNIMath::Spectrum the following formula is used to calculate the power spectrum:
 
ps= |FFT(x)|^2 / n^2
 
This definition is inconsistent with Oppenheim's defintion (Discrete-Time Signal Processing, Oppenheim AV) as well as Matlabs definition of the power spectrum. Their definition is:
 
ps = |FFT(x)|^2 / n
 
Can someone explain the reason for NI's definition?
 
Regards,
Per
 
 
0 Kudos
Message 1 of 5
(4,254 Views)
Per,

I am currently looking into the exact calculations for this formula.  Have you compared the result you get from MatLab and Measurement Studio?  There are several ways to calculate power spectrum, and we could be using a different definiton to calculate power spectrum.

Tyler T.
0 Kudos
Message 2 of 5
(4,231 Views)

Hi Tyler,

I did compare the results from Matlab and CNIMath and the results are as expected according to their definitions.

NI shows the "correct" definition of Power Spectrum  in the document "LabView Analysis Concepts"  in equation 4-8 (page 4-22).

http://www.ni.com/pdf/manuals/370192c.pdf

If that is correct, then LabView is using one definition of Power Spectrum and Measurement Studio is using another.

Any clarification is greatly appreciated.

/Per 

0 Kudos
Message 3 of 5
(4,222 Views)
Per,

I am attempting to contact the National Instruments developer for these functions.  In most of my research on this issue, it does appear that using N, rather than N squared is the proper method.  However, there also could be assumptions that are made about the spectrum function.  If you have LabVIEW, try looking at the Auto Power Spectrum function.  The documentation for that function uses N ^ 2.

I will look into this further.

Tyler T.
0 Kudos
Message 4 of 5
(4,200 Views)
I agree that the proper usage would be to divide by N. I only brought up the LabView documentation as an example on NI's (correct?) definition of power spectrum. 
It would be interesting to hear from the reasoning for their definition from the NI developers. In the mean time, I will multiply the output of the Spectrum function with N in order to get the correct output.
 
/Per
0 Kudos
Message 5 of 5
(4,180 Views)