Yeah, I made a mistake and should have said:
Code:
If=(complex float)I;
I don't think this is necessary, but I just wanted to make sure I wasn't expanding to double.
The line of code was a different thought. It could be "I" or "If". Using "If" is probably not necessary. Either way, it's a bottleneck in my code and I'm trying to figure out why.
I'm actually using FFTW in my program, so my complex values are of type fftwf_complex:
Code:
fftwf_complex *data, temp,*answer;
float *phase;
... //Big loop
temp+=data[xx]*(cosf(phase[xx])+I*sinf(phase[xx]));
...
answer[yy]=temp;
That's the basic idea.
I read someplace that FFTW uses some fast sine and cosine routines, but I haven't been able to figure out how to use them alone...