Dynamic Signal Acquisition

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the proper way to analyze a sample sinewave to get the amplitude in 'Linear Vpk' for frequencies present?

The frequencies present returned from AutoPowerSpectrum are fine but their amplitude is way too high.

The logic is based on that provided with the LabWindows/CVI spectrum analyzer sample application. Unfortunately it displays the exact same problem.

The Spectrum Analyzer LabView vi provides the results that I was expecting. To me this confirms that the signal is ok.

Sample Code that produces significantly too high amplitude values as output from AutoPowerSpectrum.

I have screen shots of the results being plotted as well as an Excel spreadsheet of values I thought were relevant. If interested please provide me with an e-mail add
ress to send them to.

Real64* pVoltBuffer = ( Real64* )
::GlobalLock( pScanInfo->Sample->m_hSample );

CNiReal64Vector oVoltageReadings(
pScanInfo->Sample->m_lCount, pVoltBuffer );

CNiReal64Vector oSpectrum;
CNiMath::WindowConstants oWindowConstants;
double dNIDAQFreq;

// Apply window
CNiMath::ScaledWindow(
oVoltageReadings,
oWindowConstants,
CNiMath::FlatTop
);

// calculate the power spectrum for a
// time domain signal
CNiMath::AutoPowerSpectrum(
oVoltageReadings,
oSpectrum,
dNIDAQFreq,
(Real64)
1 / pScanInfo->Sample->m_dScanRate
);
0 Kudos
Message 1 of 2
(7,534 Views)
This gave me what I desired but now I need help understanding in detail why it solved it.

CNiReal64Vector oConvertedSpectrum( Spectrum.GetSize() );
CString oUnitsString = "V";
CNiMath::SpectrumUnitConversion(
oSpectrum, oWindowConstants,
oConvertedSpectrum, oUnitsString,
CNiMath::Power, CNiMath::LinearScaling,
CNiMath::VoltsPeak, dNIDAQFreq
);
0 Kudos
Message 2 of 2
(7,534 Views)