Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use MS to take the inverse fft of a complex vector?

I have used Measurement Studio under Visual C++ to calculate the Cross Spectrum of two input signals:

err = CNiMath::CrossSpectrum (in1, in2, outComplex);

Now, I want to take the inverse fft of outComplex.  How can I do this?

Thanks,
Val Veirs
Professor of Physics
0 Kudos
Message 1 of 4
(6,822 Views)
Hello Val,
 
I suggest that you take a look at the CNiMath::InverseFFT function in the MS reference Help.  Here is the prototype for the function:
 
static MathError __cdecl InverseFFT(const CNiVector& fft, bool shiftDC, CNiComplexReal64Vector& tmSig);

Please let me know if you need any additional assistance with this function.
Regards,
Ben M
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(6,808 Views)
Hi Ben,

I have looked at InverseFFT but it takes a real vector as input.  What I have is the real (cos) and imaginary (sin) vectors that were the result of earlier FFT's.  I want to take the inverse FFt of this fourier transform pair, i.e., the invererse FFt of a complex vector.  Looking around in MS I can't find a supported function that does this job.  I do see an obsolete function that looks like the right idea.

Declaration

static MathError __cdecl InverseFFT(
CNiReal64Vector& xReal,
CNiReal64Vector& xImag);

Description

This function is obsolete: use an overload of this function to achieve the same funtionality.

Parameters

xReal

On input, contains the real part of the data to process.

On output, contains the real part of the inverse FFT data.

xImag

On input, contains the imaginary part of the data to process.

On output, contains the imaginary part of the inverse FFT data.

////////////////////////////////////////

So, my question remains, is there a supported way to perform an inverse fft on a complex vector?  Or, how should I overload this function and is this a good idea?

Thanks for your advice.

Val

0 Kudos
Message 3 of 4
(6,800 Views)

Hello Val,

Are you using the CNiMath FFT functions in order to generate these vectors?  If it is not too large, a code snippet would help me understand your data types and how we can approach a solution.

Message Edited by Ben M on 05-31-2007 10:46 AM

Regards,
Ben M
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(6,791 Views)