MCPcopy Create free account
hub / github.com/LabSound/LabSound / multiply

Method multiply

src/backends/FFTFrameAppleAcclerate.cpp:89–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89void 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
118void FFTFrame::computeForwardFFT(const float * data)
119{

Callers

nothing calls this directly

Calls 4

zvmulFunction · 0.85
vsmulFunction · 0.85
realDataMethod · 0.45
imagDataMethod · 0.45

Tested by

no test coverage detected