GIT.Harvie.CZ
/
mirrors
/
Programs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Aktualni
[mirrors/Programs.git]
/
c
/
goertzel
/
goertzel.c
diff --git
a/c/goertzel/goertzel.c
b/c/goertzel/goertzel.c
index 19bfdf56eec479d9e372c6f1d3067241b0384fa2..85637ae43652097beb365abc5f943cdc8dc8a904 100644
(file)
--- a/
c/goertzel/goertzel.c
+++ b/
c/goertzel/goertzel.c
@@
-29,10
+29,11
@@
float goertzel_mag(int numSamples,float TARGET_FREQUENCY,int SAMPLING_RATE, floa
// calculate the real and imaginary results
// scaling appropriately
// calculate the real and imaginary results
// scaling appropriately
- real = (q
2 - q1 * cosine
) / scalingFactor;
+ real = (q
1 * cosine - q2
) / scalingFactor;
imag = (q1 * sine) / scalingFactor;
magnitude = sqrtf(real*real + imag*imag);
imag = (q1 * sine) / scalingFactor;
magnitude = sqrtf(real*real + imag*imag);
+ //phase = atan(imag/real)
return magnitude;
}
return magnitude;
}
This page took
0.22692 seconds
and
4
git commands to generate.