I was working on some vDSP code and I ran into an annoying problem. My code is cross-platform and therefore uses std :: complex to store its complex values.
Now I assumed that I could configure the FFT as follows:
DSPSplitComplex dspsc;
dspsc.realp = &complexVector.front().real();
dspsc.imagp = &complexVector.front().imag();
And then use step 2 in the corresponding vDSP_fft_ * call.
However, this simply does not work. I can solve the problem by running vDSP_ztoc, but this requires temporary buffers that I really don't want to hang out with. Is there a way to use vDSP_fft_ * functions directly on alternating complex data? Also can someone explain why I cannot do what I am doing above with step 2?
thank
Edit: As Bo Persson noted, the real function and imag functions do not actually return a link.
However, it still does not work if I do the following instead
DSPSplitComplex dspsc;
dspsc.realp = ((float*)&complexVector.front()) + 0;
dspsc.imagp = ((float*)&complexVector.front()) + 1;
So my original question is still standing :(
source
share