Skip to content
Snippets Groups Projects
Commit b9e8093f authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

use std::hypot

parent 8d0ad65d
No related branches found
No related tags found
1 merge request!2653Add inverse FFT
Pipeline #150629 passed
......@@ -306,9 +306,7 @@ void FourierTransform::fft2amp(complex2d_t& source, double2d_t& result)
for (int i = 0; i < ws.h; i++) {
int k = (i == 0) ? 0 : ws.h - i;
for (int j = 0; j < ws.w_fftw; j++) {
double re = source[i][j].real();
double im = source[i][j].imag();
result[i][j] = sqrt(re * re + im * im);
result[i][j] = std::hypot(source[i][j].real(), source[i][j].imag());
if (j != 0)
result[k][ws.w_real - j] = result[i][j];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment