Audio spectrum analyzer on PIC32 using pic microcontoller

Audio spectrum analyzer

This simple audio spectrum analyzer is based on PIC32 proto board on PIC32MX360F512L with 320×240px colour LCD (LVC75Z779 Eval Board).  The analyzer can be connected to unamplified audio source like PC’s sound card, MP3 player and so on.

Audio spectrum analyzer

SSD1928 Module Schematic diagram

The reference voltage of ADC is set to 1V with potentiometer connected to Vref+ pin of PIC32. Voltage of the audio signal could be negative but PIC’s ADC accepts only positive voltages. That’s why another pot is used to add 0.5V DC to audio signal. Finally coupling capacitor is used to isolate DC bias from audio source.

Software

PIC’s ADC is configured to take samples at ~48kHz frequency. When each sample is converted interrupt is generated and sampled value is placed to the buffer. Sampling is completed when 2048 point buffer is full. It takes about 42ms at 48kHz sampling frequency.

Since sampling is done automatically in background we have enough time to do all calculations to previous samples while sampling new ones. First fast Fourier transform is calculated, then the results of FFT are scaled to volts or decibels and finally spectrum is drawn on LCD. At 80MHz it takes about 35ms to do all calculations and draw image on the screen.

Audio spectrum analyzer

 

 

Read more: Audio spectrum analyzer on PIC32

Leave a Comment

Your email address will not be published. Required fields are marked *