09-22-2008 02:25 AM
Hi guys,
I'm new to meassurement studio and C++.
now i got a CNiReal64Matrix signal from my DAQ card.
ex:
//
CNiReal64Matrix ReceiveData;
m_reader->ReadMultiSample(1000, ReceiveData);
//
and I have to use CNiReal64Vector to do some analysis.
ex: PowerSpectrum(), FFT(), RMS() etc.
I'm trying this:
CNiReal64Vector myWave(ReceiveData);
then I could do RMS(myWave);
but I wonder there are some another way to do that or I have to declare lots of vars.
Thanks a lot.
br,
10-09-2008 11:35 PM
When converting a matrix -> vector type, the channel count and data count ( #of samples) are separated by using the GetRows() & GetCols(), respectively.
Say your matrix, has a sample size of 100 derived from channel ai0 - > ai1.
CNiReal64Matrix voltageMatrix;
int channelCount = voltageMatrix.GetRows();
int dataCount = voltageMatrix.GetCols();
CNiReal64Vector voltageVector;
for (int i = 0; i < dataCount; i++) {
voltageMatrix.CopyColumn(i, v);
........
........
}
work out the channel count part so you can cover all channels.