kfrlib / kfr

Fast, modern C++ DSP framework, FFT, Sample Rate Conversion, FIR/IIR/Biquad Filters (SSE, AVX, AVX-512, ARM NEON)
https://www.kfrlib.com
GNU General Public License v2.0
1.64k stars 252 forks source link

goertzel issue #121

Closed mipac closed 10 months ago

mipac commented 3 years ago

I try to calculate 3 goertzel in parallel and I have a strange behaviour


kfr::complex<float> results[3];
    float omega = 0.1;
    float omegas[3] = {omega, omega, omega};
    int N=10000;

    for(float f=0; f<0.6; f+=0.01) {
      {
        auto g = kfr::goertzel( results, omegas );
        kfr::univector< kfr::f32 > x = truncate( kfr::gen_sin( 0, f ), N );

        kfr::process( g, x );
      }

      kfr::println( f, ", ", kfr::cabs(results[0]), ", ", kfr::cabs(results[1]), ", ", kfr::cabs(results[2])  );
    }

results[0] is inf ! the 2 others is ok and equals

dancazarin commented 10 months ago

Fixed in dev branch. Will be moved to main once full tests complete.