Programming DSP audio effect in C
This project involved implementing an audio effect of my choosing for an embedded DSP system. I chose the tremolo effect. The tremolo effect modulates the amplitude of an audio signal using a sinusoidal waveform, creating a pulsing sound effect. The project was divided into two phases: simulation in MATLAB and implementation on a DSP board.
Objectives
- Simulate the effect in MATLAB to analyze its behavior in the time and frequency domains.
- Implement the effect on a DSP board (TMS320C5515) to process real-time stereo audio.
- Explore potential extensions, such as additional audio effects like delay.
Features and Functionality
- MATLAB Simulation:
- Loaded audio files and determined sample rates using
audioread
. - Modulated the audio signal with a sinusoidal waveform, adjusting frequency (15 Hz) and modulation depth (0.5).
- Visualized original and processed signals in the time domain and played them for comparison.
- Loaded audio files and determined sample rates using
- DSP Implementation:
- Developed using C in Code Composer Studio.
- Implemented real-time audio processing with:
- Sample-by-sample loopback for stereo input and output.
- Sinusoidal modulation using
generate_sinewave_1
from the DSP library.
- Configured the audio codec and board clock for a 48 kHz sample rate.
- Tremolo Effect Processing:
-
Calculated output samples for left and right channels:
\[\text{output} = \text{input} + (\text{input} \times \text{modulation depth} \times \sin(2\pi f t))\] -
Ensured balanced gain and normalized output to prevent clipping.
-
Future Improvements
- Add delay effects or additional audio processing features.
- Optimize the implementation to reduce noise and enhance audio quality.
- Explore implementation on FPGA platforms for comparison.
Conclusion
The tremolo effect was successfully implemented, functioning as intended with real-time audio processing. Although some noise was present, the project demonstrated effective simulation, design adaptation, and embedded implementation. Extensions like delay were not realized due to time constraints, but the project provided valuable insights into DSP audio processing.
Project supervisor: Sammy Verslype
Time range: November - December 2023
Back to projects