o
odinpkg.dev
packages / library / Goertzel_algorithm_in_Odin

Goertzel_algorithm_in_Odin

2d4c4eblibrary

A very simple lib to calculate the power and, the real and imag in the frequency domain for a specific frequency.

No license · updated 6 months ago

Goertzel algorithm in Odin

A very simple lib to calculate the power and, the real and imag in the frequency domain for a specific frequency.

Description

Implements Goertzel algorithm for a single target frequency, returns power and, real and imag components. This lib uses f32 to be faster. The Goertzel algorithm is very usefull when you just need to know the info on a small number of frequencies, in those cases it is faster then the calculation of all the datapoints of a buffer in a normal FFT.

Functions

  • goertzel_power( )
    Uses power formula that doesnt need complexs.

  • goertzel_complex( )
    Gives also the you real and imag and that is useful if you want also the phase.

Compile and run

make
make run

License

MIT Open Source license

Have fun

Best regards,
Joao Carvalho