Lixie-Labs / Emotiscope

Let your eyes enjoy the music too ✨ Extremely low-latency audio processing lets LEDs perfectly synchronize to your music's notation and tempo.
https://emotiscope.rocks/
GNU General Public License v3.0
27 stars 5 forks source link

Design a standardized test for the GDFT pipeline #43

Open connornishijima opened 4 months ago

connornishijima commented 4 months ago

A unit test that runs in-hardware:

In every Emotiscope's filesystem would have a test WAV file which contains some quick frequency sweeps and white noise data.

When triggered via UART or Remotiscope commands, the test darkens the display and fully takes over the system. The I2S mic is swapped with the file as an audio input, and the resulting spectrogram from the test is calculated. Once finished, both the spectrogram and waveform are saved into the flash as a .bin file that can be decoded with Python or JS. This is not a hardware test, since its free of bias from things like the microphone or the room's acoustics. This is a software unit test that runs live in-hardware.

Once Emotiscope's firmware is finalized for 1.0, I'll run this test and save the resulting spectrogram as a golden copy.

All future changes to the audio pipeline will be reflected in the GDFT results and can be compared to the last major release to see improvements or find issues.

Also, it can be a hardware test too! With a different flag attached to the "start test" command, it will use the mic as the input instead, so I can build a test jig with a built-in speaker at a fixed distance to Emotiscope for verifying microphones.