changed sign 2/head
authorFrank Mutter <frank@fradcode.de>
Fri, 13 Jul 2018 17:25:38 +0000 (19:25 +0200)
committerFrank Mutter <frank@fradcode.de>
Fri, 13 Jul 2018 17:25:38 +0000 (19:25 +0200)
c/goertzel/goertzel.c

index 19bfdf56eec479d9e372c6f1d3067241b0384fa2..d13a874d9612379d94ca4e07c7de72da16ea7294 100644 (file)
@@ -29,7 +29,7 @@ float goertzel_mag(int numSamples,float TARGET_FREQUENCY,int SAMPLING_RATE, floa
 
     // calculate the real and imaginary results
     // scaling appropriately
-    real = (q2 - q1 * cosine) / scalingFactor;
+    real = (q1 * cosine - q2) / scalingFactor;
     imag = (q1 * sine) / scalingFactor;
 
     magnitude = sqrtf(real*real + imag*imag);
This page took 0.210823 seconds and 4 git commands to generate.