From 7b8cda0bde5575e2e6d7a7582c4b25a70b6c3b0b Mon Sep 17 00:00:00 2001 From: boblark Date: Sat, 13 Mar 2021 14:20:02 -0800 Subject: [PATCH] add 4096 iq fft --- AudioFilterBiquad_F32.h | 7 +++++++ OpenAudio_ArduinoLibrary.h | 1 + 2 files changed, 8 insertions(+) diff --git a/AudioFilterBiquad_F32.h b/AudioFilterBiquad_F32.h index f94a7f4..5d86346 100644 --- a/AudioFilterBiquad_F32.h +++ b/AudioFilterBiquad_F32.h @@ -24,6 +24,11 @@ * The sign of the coefficients for feedback, the a[], here use the * convention of the ARM CMSIS library. Matlab reverses the signs of these. * I believe these are treated per those rules!! Bob + * + * Algorithm for CMSIS library + * Each Biquad stage implements a second order filter using the difference equation: + * y[n] = b0 * x[n] + b1 * x[n-1] + b2 * x[n-2] + a1 * y[n-1] + a2 * y[n-2] + * The a1 and a2 coeccicients do not have minus signs as do the Matlab ones. */ #ifndef _filter_iir_f32 @@ -182,6 +187,8 @@ class AudioFilterBiquad_F32 : public AudioStream_F32 setCoefficients(stage, coeff); } + // frequency in Hz. q makes the response stay close to 0.0dB until + // close to the notch frequency. q up to 100 or more seem stable. void setNotch(uint32_t stage, float frequency, float q) { double coeff[5]; double w0 = frequency * (2 * 3.141592654 / sampleRate_Hz); diff --git a/OpenAudio_ArduinoLibrary.h b/OpenAudio_ArduinoLibrary.h index bd9ce89..aea0fde 100644 --- a/OpenAudio_ArduinoLibrary.h +++ b/OpenAudio_ArduinoLibrary.h @@ -31,6 +31,7 @@ #include "analyze_fft256_iq_F32.h" #include "analyze_fft1024_iq_F32.h" #include "analyze_fft2048_iq_F32.h" +#include "analyze_fft4096_iq_F32.h" #include "analyze_peak_f32.h" #include "analyze_rms_f32.h" // #include "control_tlv320aic3206.h" collides much with Teensy Audio