Skip to content

Commit

Permalink
Changed to 104 bands (12 bands per octave)
Browse files Browse the repository at this point in the history
  • Loading branch information
gearsincorg committed Nov 26, 2021
1 parent 500dddc commit 95b73f6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
Binary file modified FFT-Band-Bin calculator-108B-9x12.xlsx
Binary file not shown.
16 changes: 7 additions & 9 deletions VisualEar.ino
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
#include "FastLED.h"

// -- LED Display Constants
#define START_NOISE_FLOOR 80 // Frequency Bin Magnitudes below this value will not get summed into Bands. (Initial high value)
#define BASE_NOISE_FLOOR 40 // Frequency Bin Magnitudes below this value will not get summed into Bands. (Final minimumm value)
#define START_NOISE_FLOOR 80 // Frequency Bin Magnitudes below this value will not get summed into Bands. (Initial high value)
#define BASE_NOISE_FLOOR 40 // Frequency Bin Magnitudes below this value will not get summed into Bands. (Final minimumm value)

#define UI_HOLD_MS 3000
#define UI_STEP_MS 200
Expand All @@ -45,12 +45,11 @@ const int myInput = AUDIO_INPUT_LINEIN;
float upGainAccumulator = 0;
float downGainAccumulator = 0;


// -- LED Display Data
uint32_t bandValues[NUM_BANDS];
uint16_t LO_bandBins[NUM_LO_BANDS + 1] = {17,18,19,20,21,22,23,24,25,26,27,28,30,31,32,34,35,37,38,40,42,44,46,48,50,52,54,57,59,62,64,67,70,73,77,80,84};
uint16_t MD_bandBins[NUM_MD_BANDS + 1] = {42,44,46,48,50,52,54,57,59,62,64,67,70,73,77,80,84,87,91,95,99,104,108,113,118,123,129,135,141,147,153,160,167,174,182,190,199,207,217,226,236,247,258,269,281,293,306,320,334};
uint16_t HI_bandBins[NUM_HI_BANDS + 1] = {42,44,46,48,50,52,54,57,59,62,64,67,70,73,77,80,84,87,91,95,99,104,108,113,118,123,129,135,141,147,153,160,167,174,182,190,199,207,217,226,236,247,258,269,281,293,306,320,334,349,364,381,397};
uint16_t LO_bandBins[NUM_LO_BANDS + 1] = {13,14,15,16,17,18,20,21,22,23,25,26,28,29,31,33,35,37,39,41,44,46,49,52,55,58};
uint16_t MD_bandBins[NUM_MD_BANDS + 1] = {29,31,33,35,37,39,41,44,46,49,52,55,58,62,66,70,74,78,83,88,93,98,104,110,117,124,131,139,147,156,165,175};
uint16_t HI_bandBins[NUM_HI_BANDS + 1] = {25,27,28,30,32,33,35,37,40,42,45,47,50,53,56,60,63,67,71,75,79,84,89,94,100,106,112,119,126,134,142,150,159,168,178,189,200,212,225,238,252,267,283,300,318,337,357,378,400};

// Create the Audio components. These should be created in the
AudioInputI2S audioInput; // audio shield: mic or line-in
Expand Down Expand Up @@ -129,7 +128,7 @@ void runUI() {
pressReset();
}

// Look for button release. Bump gain up unless we were already going down (holding)
// Look for button release. Bump mode
if (!UIButton && lastUIButton) {
if (!UIHolding) {
bumpMode();
Expand Down Expand Up @@ -182,8 +181,7 @@ void runAGC(){
Serial.print(", Gain Number ");
Serial.println(gainNumber);
*/

}
}

void bumpGain(int step ) {
buttonStart = millis();
Expand Down
6 changes: 3 additions & 3 deletions devconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#define FLIP_LED_ORDER true
#define NUM_MODES 4

#define NUM_LO_BANDS 37 // Number of LOW frequency bands
#define NUM_MD_BANDS 48 // Number of MID frequency bands
#define NUM_HI_BANDS 52 // Number of HIGH frequency bands
#define NUM_LO_BANDS 25 // Number of LOW frequency bands
#define NUM_MD_BANDS 31 // Number of MID frequency bands
#define NUM_HI_BANDS 48 // Number of HIGH frequency bands
#define NUM_BANDS (NUM_LO_BANDS + NUM_MD_BANDS + NUM_HI_BANDS) // Total Number of frequency bands being displayed

#define NUM_LEDS NUM_BANDS // One LED per Band
Expand Down

0 comments on commit 95b73f6

Please sign in to comment.