| 155 | } |
| 156 | |
| 157 | void 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 | |
| 177 | void STFT::synthesis(const int channel) |
| 178 | { |
nothing calls this directly
no outgoing calls
no test coverage detected