| 87 | } |
| 88 | |
| 89 | void FFTFrame::multiply(const FFTFrame & frame) |
| 90 | { |
| 91 | FFTFrame & frame1 = *this; |
| 92 | const FFTFrame & frame2 = frame; |
| 93 | |
| 94 | float * realP1 = frame1.realData(); |
| 95 | float * imagP1 = frame1.imagData(); |
| 96 | const float * realP2 = frame2.realData(); |
| 97 | const float * imagP2 = frame2.imagData(); |
| 98 | |
| 99 | int halfSize = m_FFTSize / 2; |
| 100 | float real0 = realP1[0]; |
| 101 | float imag0 = imagP1[0]; |
| 102 | |
| 103 | // Complex multiply |
| 104 | VectorMath::zvmul(realP1, imagP1, realP2, imagP2, realP1, imagP1, halfSize); |
| 105 | |
| 106 | // Multiply the packed DC/nyquist component |
| 107 | realP1[0] = real0 * realP2[0]; |
| 108 | imagP1[0] = imag0 * imagP2[0]; |
| 109 | |
| 110 | // Scale accounts for vecLib's peculiar scaling |
| 111 | // This ensures the right scaling all the way back to inverse FFT |
| 112 | float scale = 0.5f; |
| 113 | |
| 114 | VectorMath::vsmul(realP1, 1, &scale, realP1, 1, halfSize); |
| 115 | VectorMath::vsmul(imagP1, 1, &scale, imagP1, 1, halfSize); |
| 116 | } |
| 117 | |
| 118 | void FFTFrame::computeForwardFFT(const float * data) |
| 119 | { |