|
-
-
-
- #include <Audio.h>
-
-
- AudioInputI2S i2s1;
- AudioFilterStateVariable filter1;
- AudioAmplifier amp1;
- AudioAnalyzeFFT1024 fft1024_1;
- AudioConnection patchCord1(i2s1, 0, filter1, 0);
- AudioConnection patchCord2(filter1, 2, amp1, 0);
- AudioConnection patchCord3(amp1, fft1024_1);
-
-
- void setup() {
- AudioMemory(50);
- filter1.frequency(30);
- amp1.gain(8.5);
- }
-
- void loop() {
- if (fft1024_1.available()) {
-
-
- Serial.print("FFT: ");
- for (int i = 0; i < 20; i++) {
- float n = fft1024_1.read(i);
- if (n >= 0.001) {
- Serial.print(n, 3);
- Serial.print(" ");
- } else {
- Serial.print(" -- ");
- }
- }
- Serial.println();
- }
- }
|