mirror of
https://github.com/cnlohr/lolra.git
synced 2026-06-17 00:09:31 +00:00
Update calculator to handle goertzel
This commit is contained in:
@@ -5,7 +5,7 @@ TARGET_MCU:=CH32V203G6U6
|
||||
TARGET_MCU_PACKAGE:=CH32V203G6U6
|
||||
CH32V003FUN:=../ch32v003fun/ch32v003fun
|
||||
|
||||
EXTRA_CFLAGS:=-Wno-unused-function -I../../lib -I../ch32v203-fft/lib
|
||||
EXTRA_CFLAGS:=-Wno-unused-function -I../../lib -I../lib
|
||||
|
||||
include ../ch32v003fun/ch32v003fun/ch32v003fun.mk
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ SOFTWARE.
|
||||
#include "ssd1306.h"
|
||||
|
||||
|
||||
#define PWM_PERIOD (31-1) //For 27.0MHz, use 36MHz if quadrature -- It appears to be good for *244 in the table? WHY 26MHz???!?!!?
|
||||
#define PWM_PERIOD (31-1)
|
||||
|
||||
#define ADC_BUFFSIZE 512
|
||||
|
||||
@@ -83,7 +83,6 @@ const int32_t g_goertzel_omega_per_sample = 1238618695; // 47/256 -> 27.01920 MH
|
||||
const int32_t g_goertzel_coefficient = 870249096;
|
||||
const int32_t g_goertzel_coefficient_s = 1963250500;
|
||||
|
||||
|
||||
#define LOG_GOERTZEL_LIST 256
|
||||
int32_t gertzellogs[LOG_GOERTZEL_LIST*2];
|
||||
int gertzellogs_head;
|
||||
|
||||
@@ -13,6 +13,7 @@ int32_t g_goertzelp_store, g_goertzelp2_store;
|
||||
int main()
|
||||
{
|
||||
//XXX XXX NOTE If you are computing the coefficients, you can plug the value in here.
|
||||
// You can get this number from calculator.html. I've had better luck with "inverse goertzel" numbers.
|
||||
g_goertzel_omega_per_sample = (47.0/256) * 3.1415926535*2.0*(1<<29);
|
||||
g_goertzel_coefficient = 2 * cos( g_goertzel_omega_per_sample / (double)(1<<29) ) * (1<<30);
|
||||
g_goertzel_coefficient_s = 2 * sin( g_goertzel_omega_per_sample / (double)(1<<29) ) * (1<<30);
|
||||
|
||||
Reference in New Issue
Block a user