C++ Reverb – DSP Final Project


This past year (Fall 2018) I took a DSP (digital signal processing) class at Cedarville University. At the end of the class, as a final project we had to implement something “cool” using the techniques we learned in the rest of class on a Raspberry Pi. This was supposed to be done using the Raspberry Pi package for Simulink Coder.

For my project, I decided to implement a digital reverb unit; as I thought it would be interesting. I also thought it would be fun to add reverb to my music library. The reverb unit was first implemented in Matlab and Simulink for testing on a desktop, then the filters were ported to C++ so that they could be directly implemented on the Pi without using Simulink coder.

A sample input and output (along with all the code needed for the C++ implementation are available on github). The files Invention_no1.mp3 and Invention_no1_reverb.mp3 are the input and output files respectively.

This post does not go into the math behind digital signal processing, mostly because I did not feel like writing about it. I might eventually, but I probably won’t.

Continue reading “C++ Reverb – DSP Final Project”

STM32Cube Library – Part 3 Compiling

Okay, I’m finally going to finish this tutorial! This part will cover writing a Makefile to handle compilation and flashing code to the microcontroller.

This is the third part in a multi-part series.

Continue reading “STM32Cube Library – Part 3 Compiling”

STM32Cube Library – Part 2 Hello World

This is part 2 in a multi-part series. Read part 1 here: The STM32Cube library – part 1 Toolchain

We left off by generating a project in the STM32CubeMX application. Today we will modify the automatically generated code to do our bidding; namely blink several LEDs. This will also provide a tour of usage of the STM32Cube HAL library.

I will be using a stm32f4Discovery board for this tutorial, but it should work on most any other stm32 development board, just be sure to use the correct pins.

Continue reading “STM32Cube Library – Part 2 Hello World”

STM32Cube library – Part 1 Toolchain

This series of posts will hopefully help someone looking to set up and use the STM32Cube libraries provided by st-micro. This first post will cover setting up a development toolchain on a Linux system and the next post will cover making a hello world application.

What is this Cube library anyway?

The Cube library is a HAL (Hardware Abstraction Layer) developed by st-microelectronics to take some of the pain out of development with ARM microcontrollers. Their success in goal is debatable, but it does make porting code from other microcontrollers in their products easier. My main gripe is that it has a large memory footprint, and coming from the very space limited world of 8-bit microcontrollers I find the wastefulness annoying. That being said, I have come to use it as it considerably decreases my development time.

Continue reading “STM32Cube library – Part 1 Toolchain”