LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

about SpectrumUnitConversion

Hi!

I'm using LabWindows 7.0, and I need for the function
AutoPowerSpectrum.

I need to have rad squared / Hz. Using SpectrumUnitConversion it is possible, but, actually, I have some problems....

The "number of elements" is the number of elements of input vector (spectrum calculated by Auto
PowerSpectrum has 1024 elements, in my case), or the double, because PowerSpectrum calculates mono-lateral spectrum?

After this, I am not able to understand "Window Constants" structure.....

Moreover, in function help, it is said that "Display units" can be "Volt rms^2/(Hz^0.5), while in description is written " volts squared rms per Hertz", which is not the same!

Thanks for your help.....
0 Kudos
Message 1 of 3
(3,611 Views)
Graziano,

here you go with a code snippet that shows how to use that function
==========================
static char strUnits[256];
static double ConvSpectrum[512];
static WindowConst wndConstants;
static AnalysisLibErrType powError;
static double deltaF;
static double SpectrumArray[512];
static AnalysisLibErrType erroreSine;
static double sineArray[1024];

// Generating a sinewave, 1024 points
SinePattern (1024, 1.0, 0.0, 10, sineArray);

//Calculating Power Spectrum on the sine array --> 512 elements
AutoPowerSpectrum (sineArray, 512, 1.0, SpectrumArray, &deltaF);

//retrieving the windows constants structure from the sine array
ScaledWindow (sineArray, 1024, 0, &wndConstants);

//Converting Units
SpectrumUnitConversion (SpectrumArray, 512, 0, 0, 6, deltaF, wndConstants, ConvSpectrum, strUnits);

=====================================

I am not quite sure what you need to convert to.
Do you need to have values available for Power Spectral Density (Vrms^2/root Hz)?

let me know

AlessioD
Message 2 of 3
(3,588 Views)
I think that spectral density (PSD) is measured in {squared rad/Hz}, when I am measuring a phase-noise spectrum

If in Volt, you'll have V^2/Hz (or V/root(Hz).... )

Anyway, thanks for your help, it will be usefull!

graziano
0 Kudos
Message 3 of 3
(3,583 Views)