I am currently working on doing fft on my wav audio signal. My goal is to recreate Matlab's function called "spectrogram", which does a STFT with moving Hammington window.
My first attempt was to represent my input data as a vector (size of the window, padded with zeros) and output is vector with same size. It was working nice, I got almost the same result as other function in Matlab using fft.
But since Matlab spectrogram is giving me results represented as complex numbers, I want to do the same with MKL using C.
In user guide manual - page 2708, I can perform the fft by using this procedure:
status= DftiComputeForward(desc_handle, xre_in, xim_in, yre_out, yim_out);
So my thinking was to declare xre_in, xim_in, yre_out, yim_out ad arrays of doubles,where: xre_in is vector of my input data, xim_in is vector with zeros.
FFT part looks like this:
status = DftiCreateDescriptor(&fft_handle, DFTI_DOUBLE, DFTI_REAL, 1, fftpoint);
status = DftiSetValue(fft_handle, DFTI_PLACEMENT, DFTI_NOT_INPLACE);
status = DftiCommitDescriptor(fft_handle);
status = DftiComputeForward(fft_handle, Fft_input.pVector, input_imag.pVector, Fft_output.pVector, output_imag.pVector);
status = DftiFreeDescriptor(&fft_handle);
Unfortunately my outputs are all zeros after computing, so I guess my process of thinking was wrong. Where have I done mistake?
I am working with Visual Studio 2010, I don't think I have C99 standard, because I cannot declare complex numbers, and dealing with real ones is easier.