A real-time digital guitar multi-effects processor built on the Terasic DE1-SoC. The project captures a guitar signal through the board's audio codec, processes each 16-bit sample at approximately 48 kHz, and returns the modified signal through Line Out.
It explores two complementary implementation strategies: low-latency audio effects described directly in VHDL, and time-domain effects programmed in C for an embedded Nios II soft-core processor.
Engineering value: this project demonstrates end-to-end hardware/software co-design for real-time digital signal processing: audio-codec control, fixed-width arithmetic, configurable FPGA datapaths, embedded software, ADC-based user controls, analog impedance matching, and laboratory validation with an oscilloscope and real guitar recordings.
Click the image to watch the processor running on the DE1-SoC:
The repository also contains 18 clean and processed audio recordings covering distortion, overdrive, tremolo, delay, echo, simple reverb, and cathedral reverb.
Traditional analog pedals are defined by their physical components and wiring. An FPGA makes the signal path reconfigurable: effects can be modified, replaced, or connected in a different order by changing the hardware design. It also allows deterministic sample-by-sample processing without a general-purpose operating system in the critical audio path.
This prototype combines that FPGA datapath with a Nios II processor to compare two approaches:
- VHDL effects implement the transformation as dedicated digital hardware.
- Nios II effects use software and memory buffers for algorithms that depend on audio history, such as delay and reverberation.
flowchart LR
A["Electric guitar"] --> B["High-impedance buffer"]
B --> C["WM8731 audio codec<br/>16-bit · ~48 kHz"]
C --> D["AU_IN<br/>serial audio capture"]
D --> E{"Processing path"}
E -->|VHDL| F["Booster · Distortion<br/>Overdrive · Tremolo"]
E -->|Nios II / C| G["Delay · Echo<br/>Reverb"]
F --> H["AU_OUT<br/>serial audio playback"]
G --> H
H --> C
C --> I["Amplifier · headphones<br/>or audio interface"]
J["Potentiometers"] --> K["AD7928 ADC<br/>12-bit controls"]
K --> F
The codec is configured through I²C. Audio samples are exchanged over serial data and synchronization lines, while an AD7928 eight-channel, 12-bit ADC reads external potentiometers used to control effect parameters.
| Effect | Implementation | Controls / behaviour |
|---|---|---|
| Booster | VHDL | Clean sample gain or attenuation |
| Distortion / fuzz | VHDL hard clipping | Output gain and clipping threshold |
| Overdrive | VHDL soft clipping | Output gain and saturation threshold |
| Tremolo | VHDL low-frequency amplitude modulation | Rate, depth, and square, sawtooth, or triangular waveform |
The VHDL effects are independent components and can be instantiated or chained in testaudio_DE1SoC.vhd. The committed top-level revision selects the distortion path by default; alternative instantiation examples are preserved in NOTAS.txt.
| Effect | Implementation | Behaviour |
|---|---|---|
| Bypass | C | Copies each input sample directly to the output |
| Delay | C circular buffer | Mixes the current sample with audio delayed by one second |
| Echo | C buffer with feedback | Repeats and progressively attenuates earlier audio |
| Reverb | C short feedback buffer | Adds a reflection delayed by approximately 100 ms |
| Cathedral reverb | C multi-tap buffer | Combines reflections at approximately 60 ms and 100 ms |
The implementations are collected in qsys_bypass.c. They were developed as alternative main() routines for the original Altera Nios II workflow.
The project processes mono guitar audio using signed 16-bit two's-complement samples. The original design configures the codec for a nominal sample rate of 48 kHz; with the generated 12.5 MHz codec clock, the implemented rate is approximately 48.828 kHz.
Three reusable VHDL blocks manage the codec:
au_setup.vhdconfigures the codec through I²C.au_in.vhdreceives serial samples and asserts areadysignal.au_out.vhdreturns processed samples to both output channels.
The design supports 8 kHz, 32 kHz, and 48 kHz configurations, although the effects and delay lengths in this repository were developed for the 48 kHz setting.
- Terasic DE1-SoC development board with Cyclone V
5CSEMA5F31C6 - USB cable for the on-board USB-Blaster II / JTAG interface
- Electric guitar or another mono audio source
- Powered speakers, headphones, amplifier, or audio interface connected to
Line Out - Recommended: high-input-impedance buffer between a passive guitar and
Line In - For real-time parameter control: up to four 47 kΩ potentiometers connected to the board's ADC header
A passive guitar pickup is a high-impedance, instrument-level source, while the DE1-SoC Line In expects a lower-impedance line-level signal. A direct connection can load the pickup and produce a weak, dull signal with reduced high-frequency response.
The project therefore includes an external unity-gain buffer based on a TL071 operational amplifier. Its high input impedance and low output impedance preserve the guitar signal before it reaches the codec. The complete circuit, simulation, construction, and measurements are documented in the project report.
The original project was developed and validated with:
- Quartus Prime 15.1 Standard Edition
- ModelSim SE-64 10.5
- Altera Monitor Program 15.1 for Nios II software
- NI Multisim 13.0 for the analog buffer
The included Quartus project targets the original toolchain. Newer Quartus releases may request an IP or project migration and have not been validated against this historical revision.
git clone https://github.com/jagumiel/Guitar-Pedal-Effects-on-FPGA.git
cd Guitar-Pedal-Effects-on-FPGA/FPGA-Stompbox/TFG_StompboxOpen testaudio_DE1SoC.vhd and instantiate the required effect between sample_in and sample_out. The current revision enables distortion. Reusable examples for the other effects are available in NOTAS.txt.
For a simple chain, connect the output of one component to the input of the next:
distortion_stage : distortion
port map (
sample_in => sample_in,
dist_pos => pot_distor,
gain => multiplier,
sample_out => sample_dis
);
tremolo_stage : tremolo
port map (
sample_in => sample_dis,
sample_out => sample_out,
LD_Sample => in_ready,
clk => CLOCK_50,
cl => reset,
rate => velocidad,
atack => ataque,
wave => SW(1 downto 0)
);Open the project file in Quartus:
FPGA-Stompbox/TFG_Stompbox/testaudio_DE1SoC.qpf
Then select Processing → Start Compilation. From a Quartus command shell, the equivalent command is:
quartus_sh --flow compile testaudio_DE1SoCThe SRAM Object File is generated at:
output_files/testaudio_DE1SoC.sof
- Power the DE1-SoC and connect its USB-Blaster interface.
- Open Tools → Programmer in Quartus.
- Select the detected USB-Blaster hardware.
- Add
output_files/testaudio_DE1SoC.sofif it is not already listed. - Enable Program/Configure and press Start.
- Connect the guitar to the impedance buffer.
- Connect the buffer output to the DE1-SoC
Line Inconnector. - Connect
Line Outto powered speakers, an amplifier, or an audio interface. - Connect the parameter potentiometers to the ADC header if the selected effect uses them.
- Press
KEY0to reset and initialize the codec.
Start with the output volume low. Verify the buffer supply, grounds, and ADC voltage range before connecting external circuitry to the board.
The committed Quartus reports record a successful build of the VHDL design on 31 August 2017:
| Metric | Recorded result |
|---|---|
| Target device | Cyclone V 5CSEMA5F31C6 |
| Logic utilization | 112 / 32,070 ALMs (< 1%) |
| Registers | 162 |
| DSP blocks | 1 / 87 (1%) |
| Block memory | 0 / 4,065,280 bits |
| Setup slack, 50 MHz clock | +10.282 ns at slow 85 °C corner |
| Hold slack, 50 MHz clock | +0.327 ns at slow 85 °C corner |
These values describe the committed distortion-oriented top-level configuration, not every possible combination of effects. See the original flow and timing reports for details.
.
├── FPGA-Stompbox/
│ └── TFG_Stompbox/ # Quartus project and reusable VHDL effects
├── NIOS-Stompbox/
│ └── nios_audio_system/ # Nios II system artifacts and C effects
├── Audio-Samples/
│ └── muestras_audio.zip # Clean and processed guitar recordings
├── TFG-JA_Gumiel-Pedal_de_Efectos.pdf
├── LICENSE
└── README.md
The effects were evaluated with several complementary methods:
- A function generator supplied controlled low-frequency waveforms.
- A two-channel oscilloscope compared input and processed output signals.
- Real guitar recordings were captured before and after processing.
- The impedance adapter was simulated and then validated as a physical circuit.
- Delay, echo, and reverb behaviour was checked after removing the input signal and observing the remaining output over time.
This evidence is shown in the full technical report and the included audio sample archive.
- Technical report — Spanish: Pedal de efectos digital para guitarra basado en FPGA (90 pages)
- Project overview — Spanish: Pedal de Efectos Digital para Guitarra Eléctrica
- Video demonstration: Watch on YouTube
- Audio comparisons: Download the sample archive
This repository preserves the original 2017 Bachelor's degree project and its toolchain. Before treating it as a production-ready or actively maintained audio platform, consider the following:
- Effect selection is performed by editing the VHDL top-level design.
- The repository does not yet provide automated VHDL testbenches or CI.
- The Nios II material contains original source and generated artifacts, but is not packaged as a clean, one-command reproducible Platform Designer build.
- Some VHDL files use legacy Synopsys arithmetic packages alongside
numeric_std. - Delay lengths and several gain constants are fixed in the source.
- Overflow handling is deliberately simple and could be improved with explicit saturation arithmetic.
- Generated Quartus and simulation files are still versioned in the repository.
- Refactor the audio effects into a clean reusable VHDL library
- Use
ieee.numeric_stdconsistently throughout the design - Add run-time effect selection and effect chaining through board switches
- Add self-checking VHDL testbenches and GHDL-based continuous integration
- Rebuild and document the Nios II system with a reproducible Platform Designer project
- Parameterize delay time, feedback, wet/dry mix, clipping threshold, and tremolo controls
- Add saturating fixed-point arithmetic and automated audio regression tests
- Remove generated build artifacts and provide a focused Quartus
.gitignore
Contributions that modernize the toolchain, add an effect, improve the fixed-point DSP, or make the project easier to reproduce are welcome.
- Fork the repository.
- Create a topic branch.
- Keep each effect modular and document its sample format and latency.
- Include a testbench, waveform, or audio comparison when possible.
- Open a pull request explaining both the algorithm and its FPGA resource cost.
Jose Ángel Gumiel
Embedded systems, cybersecurity, FPGA, and electronic engineering
This project is released under the MIT License.
