01-22-2009 01:04 PM
I'd like to use the FFT2D function in LabWindows CVI 8.5 Analysis Library. Unfortunately the help section isn't very informative: the input signal to be transformed, and the returned 2D fft are both type pointer to void. I'd like to pass an array of type double, and I would expect a returned array of a complex data type, possibly a structure with a real and imaginary component. There is a 2dfft example in the /samples/analysis directory, but in that code they essentially rewrite the fft algorithm, and use global variables to get the data out. What's the right way to call this function?
As an alternative, I've been looking to use the FFTW .dll. This package comes with a .dll and .def files, but no library (.lib) file. On this page http://zone.ni.com/devzone/cda/tut/p/id/3341 the following statement is made: "If you do not have the DLL import library, you can create one using the tools LabWindows/CVI provides" but it fails to tell you how do this. So how does one generate the .lib file from the .dll and .def files in LabWindows?
Thanks
Solved! Go to Solution.
01-23-2009 04:28 AM
CVI can generate a .lib file for a dll, if it has an associated .h file. On CVI 7, open the .h file in the editor window and then click on the main menu Options item. You will see a line "Generate DLL Import Library" - click this and follow the prompts from there.
JR
01-27-2009 02:10 PM
01-28-2009 08:02 AM
The Help that is built into LabWIndows/CVI does not give much explanation on the FFT2D function, but the LabWindows/CVI Online Help does a much better job of explaining the parameters and return values. Please reference the LabWIndows/CVI Help for a more in depth explanation.
-Adri K.
01-28-2009 06:50 PM
This is the same help info I get from the Labwindows/CVI help page. The link you provided does not explain the format of the numeric arrays, e.g. how complex numbers are handled.
01-29-2009 09:54 AM - edited 01-29-2009 10:01 AM
With the FFT2D function you can select what data type you are using (for your case, array of double). The result should also be an array of double to represent the two-dimensional matrix, xk. Here is an example of how it could be used...
static double timesig[500];
static double testfft[1000];
.
.
.
FFT2D (timesig, 5, 5, 5, 5, 0, fftret);
01-29-2009 01:52 PM
01-29-2009 02:08 PM
Ok, thanks. That answers my question.
01-30-2012 05:21 AM
I was able to follow the instruction and create a .lib file for the dll of fftw and include it in the project. Still I have problems to understand how the calls to the functions in the dll should be done. The syntax of the h-file is far from straight forward (to me). I would be greatful for an example how to call one of the fftw functions. Thanks
/Niclas
01-31-2012 10:04 AM
Since this thread is a little old, you may want to check out the shipping examples that come with CVI. You can find these from the CVI splash when you first open up the program, "Find Examples" or from the environment by clicking Help»Find Examples. There are a handful of worksheets available on FFT if you browse to Analyzing and Processing Signals»FFT and Frequency Analysis. While not specific to the example posted here, it is at least a starting point to work with, especially considering that some of the previous posts are by members who haven't posted in a while.
If you interested in learning more about the fundamentals of FFT, this article contains a lot of information on how the analysis occurs (not specific to the development environment).
Hope this helps
Luke W