02-24-2009 10:22 AM
Solved! Go to Solution.
02-24-2009 01:12 PM
Heiko,
You can create an array of type AnalogWaveform<double>[]. You can then save the acquired data to this value.
-Adri
02-25-2009 01:22 AM
Thanks for the hint! It seems to work. But now I have trouble with the FFT. I’m using the following code:
AnalogWaveform<double>[] wf=e.GetData();
waveformGraphInputSignal.PlotWaveforms(wf);
ComplexDouble[] fftOutput= NationalInstruments.Analysis.Dsp.Transforms.RealFft(wf);
When I do it like this, I'll get the following error message: “Cannot convert from ‘NationalInstruments.AnalogWaveform<double>[] to ‘double[]’” I understand the error message but how can I solve the problem? Thanks again!
02-25-2009 02:20 AM
I found it out myself:-)
AnalogWaveform<double>[] wf=e.GetData();
waveformGraphInputSignal.PlotWaveforms(wf);
double[] recordedData = wf[0].GetRawData();ComplexDouble[] fftOutput = NationalInstruments.Analysis.Dsp.Transforms.RealFft(recordedData);
double[] magoutput = new double[fftOutput.Length];for (int i = 0; i < fftOutput.Length; i++)
{
magoutput[i] = fftOutput[i].Magnitude;
}
waveformGraph2.Plots[0].PlotY(magoutput, 100, 1);
02-25-2009 07:41 AM
Hi again,
as I mentioned before, I was able to conduct the FFT with “Analysis.Dsp.Transforms.RealFft”. But actually I would like to have the result onesided.
So I tried to use “SpectralMeasurements.Measurements.AmplitudePhaseSpectrum”. But I have trouble with the parameters.
I found a descriprtion for the parameters, but that doesn’t help much. Do you have any example how to use the method?
Thanks Heiko
02-25-2009 09:25 AM
Heiko,
There is example code that is documented in the Measurement Studio Help for the Measurements.ApmlitudePhaseSpectrum Method. A trick for pulling up the help for a particular method is to place your cursor in the method name and hit F1.
-Adri