MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / modification

Method modification

src/audio_effects/STFT.cpp:157–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157void STFT::modification(const int channel)
158{
159 fft->perform(time_domain_buffer, frequency_domain_buffer, false);
160
161 for (int index = 0; index < fft_size / 2 + 1; ++index) {
162 float magnitude = abs(frequency_domain_buffer[index]);
163 float phase = arg(frequency_domain_buffer[index]);
164
165 frequency_domain_buffer[index].real(magnitude * cosf (phase));
166 frequency_domain_buffer[index].imag(magnitude * sinf (phase));
167
168 if (index > 0 && index < fft_size / 2) {
169 frequency_domain_buffer[fft_size - index].real(magnitude * cosf (phase));
170 frequency_domain_buffer[fft_size - index].imag(magnitude * sinf (-phase));
171 }
172 }
173
174 fft->perform(frequency_domain_buffer, time_domain_buffer, true);
175}
176
177void STFT::synthesis(const int channel)
178{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected