Synthesis of the sound has a long history and different methods of synthesis were developed. The most common method is called subtractive : basic waveforms are generated by the processor (wavetable synthesis) or analog components; then applied to filter and mixed to generate an output signal. Additive synthesis is more complex; it's based on Fourier transform.
Fourier Transform decomposes a function of time (a signal) into frequencies that make it up. Transform gives the coefficients of amplitude and phase shift. Every periodic signal can be described by a sum of sine waves with different frequency, amplitude, phase shift.
Additive synthesizer works by summing sine waves, which have frequencies based on input frequency (it's called pitch of the sound).
This project utilizes three components:
- Digilent Nexys Video (FPGA platform)
- Digilent PMOD BT2 (Bluetooth interface, connected to the JA port of FPGA)
- Digilent Analog Discovery 2 (oscilloscope for observing signal shape)
Additionally, a mobile phone with Bluetooth is needed to communicate with the system.
The focus of this project is to generate sounds in another way that is nowadays. Additive synthesis gives the possibility to create all existing shapes of a signal by its definition (Fourier series). Also, we can record FFT of the signal from a microphone and reproduce it by sine waves (after that, it's possible to edit single sine wave in signal!).
Architecture is developed in VHDL (audio codec driver, additive synthesis generator). Soft processor Microblaze is used for controlling signal flow (FFT, DMA channel to codec, memory, Bluetooth, additive generator coefficients). The code is implemented in C.
ArchitectureSystem consists of:
- Microblaze processor
- DDR3 Memory
- Audio codec driven by custom IP (with Central DMA channel and 512 samples FIFOs [L and R audio channels])
- Xilinx FFT IP with FIFO
- Bluetooth UART
- Additive Generator IP
Additive Generator IP
- AXI Memory-Mapped - block provided by Xilinx, allows Microblaze processor to access IP memory, which stores data about the sound pitch, amplitude(k), phase shift(k), where k is an index of the sine wave.
- Phase generator - computes phase value based on sound pitch, phase shift, and previous phase value.
- Data generator - provides signal flow to DDS Compiler
- DDS Compiler - Xilinx IP, stores sine wavetable in Block RAM. Input : 16 bit phase value, output : 16 bit sine wave value.
- Amplitude Multiplier - perform equation A * sin[n], where A is (0 ; 1) (16 bit fraction value).
- Mixer - adds all of the sine waves.
- Normalize - multiply output by a factor based on the count of the sine waves (provides full-scale output)
In the current stage, the peripherals (audio codec driver, Bluetooth) and processor architecture (DMA, memory, FFT) are fully completed and tested. The additive generator works in software (supported by Adder, Multiplier, Normalizer IPs and DDS Compiler IP) and is capable of generating signal containing up to 10 sine waves in real time.
Steps Completed:
- Audio Codec driver IP with data stored in FIFOs transmitted by DMA channels - audio codec demo was shared by Digilent, unfortunately, system wasn't able to play sound in real time (demo was designed for playing recorded package of data), design was modified and now sound is played without any delays, clicks, noises etc.
- Android Application - allows to interface with the system (by Bluetooth), Graphics interface for setting 10 sine waves was developed
- Base blocks of Additive Generator IP
Future Steps:
- Integrate Additive Generator into one block capable of generating 1024 sine waves
- Instantiate more blocks of Additive Generator (main goal : 10000 sine waves)
- Develop the Android application to draw spectrum by user and add setting phase shift capability (now a user can set only amplitude of sine waves)
- Add record FFT & reproduce signal option
- Add modulation - change of amplitude and phase shift of group of sine waves in a period of time
- Add MIDI support
- Power-up your Nexys Video board and program it with design_1_wrapper.bit (output folder), make SDK project and program Microblaze (sdk folder). All files can be downloaded from my GitHub repository : GitHub
- Connect PMOD BT2 module to JA port of Nexys Video. Set jumper J2 on BT2 (now BT2 automatically accepts pair request from bluetooth master device).
- Connect your headphones or speaker to the headphones port (black jack port). You can also connect Analog Discovery 2 as an osciloscope (you will need jack cable).
- Install android application on your mobile phone - app-debug.apk (folder output in my GitHub repository). It's unauthorized application and your phone doesn't allow you to install it : how to install.
- Pair your phone with BT2 and run Bluetooth MIDI application.
- You can control pitch of the sound (frequency) and amplitude of 10 sine waves (harmonics)
- That's it!
Comments