Design of a REE476 Final Project: eal-Time Digital Guitar Tuner Using Atmega

EE476 Final Project (1)

Introduction
The goal of this project is to design an algorithm for a real-time digital guitar tuner and implement it using an Atmel AT90S8535 microcontroller. Each of the six strings of a guitar has a unique fundamental frequency, and our goal is to measure this frequency and compare it to the correct frequency. This project combines digital filter design, analog amplifier design, and several data analysis techniques.

EE476 Final Project (1)

High level design
The microcontroller accepts push button inputs which allow the user to select which guitar string is being tuned. It then samples the input waveform at 3000 Hz using the 8535’s on-board ADC. Each time a waveform sample is obtained, the following FIR (finite impulse response) filter algorithm is performed:
where P = 21, xare the most recent 21 samples and care predetermined filter coefficients which are loaded from a lookup table for each string. This filter set to be a bandpass filter centered at the fundamental frequency of the selected guitar string, and it is used to remove unwanted harmonics and other noise from the sampled waveform. Note that we are limited to a 20-tap filter (P = 21) because all operations must be completed within one sample period (.333 mS) in order for the tuner to be true real-time. Generally speaking, the larger P is, the better the filter is.

EE476 Final Project1

After each filter output has been calculated, it is examined to see if it is a rising-edge zero-crossing. The number of sample periods between rising-edge zero-crossings is recorded and averaged, and the result is the fundamental period of the guitar tone. This fundamental period is compared to a series of threshold levels, and a single LED is illuminated to indicate the sharpness or flatness of the tone. The threshold levels (from LED0 – LED7 on the evaluation board) are fundamental +15%, +10%, +4%, +1%, -1%, -4%, -10%, and -15%. If the measured period falls within +1% and -1%, the two middle LEDs are illuminated (LED3 and LED4).

MATLAB Simulation

Extensive MATLAB work was done before the first line of assembly code was written in order to determine whether or not the algorithm could be implemented on the 8535. There are many limitations of the 8535 that we had to consider. In order to perform all of the necessary calculations within one sample period, the multiply routines need to be as fast as possible.

Read more: EE476 Final Project:  Design of a Real-Time Digital Guitar Tuner

Leave a Comment

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