This repository is licensed under GPL-3.0. Third-party libraries used are distributed under their own licenses.
This is an audio spectrum analyzer written in C/C++ on the STM32F4 discovery kit using FFT of wav audio file read from microSD card through FatFS displayed onto an OLED screen. Credits to anweshct3 for initial project inspiration. This project also stemmed from my wanting to learn/practice C++, DSP, ARM, CppUTest, and integrating different libraries. Project includes the audio spectrum analyzer on the STM32F4 discovery kit, and an audio spectrum analyzer written in python for the host computer.
I first started out writing the audio spectrum analyzer in python to establish a base "truth." It was much easier to code and debug in python first, and then approach programming it on the STM32F4 discovery board. The python program was useful in debugging what was wrong with my implementation on the STM32F4, such as discovering that I needed to skip the first 44 bytes of a wav file since it was metadata.
Another thing helped with development was integrating CppUTest, a C/C++ unit test framework. I much prefer ceedling, but unfortunately it doesn't support C++, but it was a good opportunity to learn about a new tool. CppUTest helped with ensuring that my logic was correct with unit tests before even uploading the code to the microcontroller.
- Write audio spectrum analyzer in python
- Integrate libopencm3 open source HAL
- Set up programming stm32f4-disc1 through openocd
- Set up Makefile for stm32f4-disc1
- Integrate with ARM-CMSIS library (DSP
- Set up debugging for stm32f4-disc1
- Integrate CppUTest for unit/integration testing
- Learn how to use CppUTest to write a mock
- Write middleware for FatFS to integrate w/ microSD card
- Write module for OLED driver
- Test CMSIS-4 DSP functions with audio wav file
- Display DSP output onto OLED
- Fix FatFS glue function to read more than 512 bytes at a time
- Use timers to handle timeouts
- Speed up using DMA
- Use I2C to allow audio playback
build: makefile for building and flashing project
test: makefile for running unit & integration tests using CppUTest
lib: external libraries
src: contains src and header files for building the project split into application, bsp, and driver
misc: audio spectrum analyzer written in python3 & wav files
Coming soon! :-)
- [CppUTest] How to write a makefile for CppUTest
- [CppUTest] CppUTest Starter Project
- [FFT] CMSIS-4 Library
- [FFT] STM32 Fast Fourier Transform (CMSIS DSP FFT) - Phil's Lab #111
- [FFT] ESP32 spectrum analyser VU meter using arduinoFFT and a FastLED matrix
- [FFT] Configuring CMSIS DSP Package and Performing a Real FFT
- [FatFS] How to integrate FatFS using SPI
- [FatFS] FatFS SD card Initialization Process
- [FatFS] Example integration FatFS on stm32
- [FatFS] Example #2 integration FatFS on stm32
- [FatFS] microSD card initialization in SPI mode. ACMD41 always returns 0x01
- [FatFS] SDHC microSD card and SPI initialization
- [FatFS] Initializing SD card in SPI issues