Presentation is loading. Please wait.

Presentation is loading. Please wait.

EGUITAR TUNER Mark Stocker Eastern Kentucky University Department of Technology.

Similar presentations


Presentation on theme: "EGUITAR TUNER Mark Stocker Eastern Kentucky University Department of Technology."— Presentation transcript:

1 EGUITAR TUNER Mark Stocker Eastern Kentucky University Department of Technology

2 2 OUTLINE Automatic Guitar tuning Amplification of signal Frequency Measurement Harmonic Interference

3 3 MOTIVATION Beginners often have trouble tuning their guitar properly. Self tuning guitars such as the Gibson Robot are extremely expensive ($4000!) om/watch?v=WetVXb YRfWk om/watch?v=WetVXb YRfWk

4 4 INTRODUCTION Each guitar string vibrates at a unique fundamental frequency. The fundamental frequency of the string directly relates to the musical note being played via the formula: n is the number of steps away from middle A (which is exactly 440Hz)

5 5 PROBLEM STATEMENT Frequency measurement is typically done by custom made Digital Signal Processors (DSPs). DSPs take a lot of time and money to develop into a working product.

6 6 PROPOSED SOLUTION Analyze and tune the guitar using general purpose devices that are easily acquired and very inexpensive. Perform the signal processing and motor control in software instead of a hardware DSP device.

7 7 FREQUENCY MEASUREMENT Measure the voltage of the guitar signal using the Atmel AVR built in Analog-to-Digital convertor (ADC). Sample the change in voltage at a very high rate (200uS) to detect each time the waveform crosses the zero point or bias. After a predetermined number of zero crossings have been detected, determine frequency using the formula 1/T where T is the amount of time that passed during the sample.

8 8 FREQUENCY MEASUREMENT

9 9 Compare the measured readings to those known to be in the correct range (+/-.05% of intended frequency) and tune string accordingly with a stepper motor. Standard Guitar Tuning: Frequency 200uS E = A = D = G = B = e =

10 10 PROBLEM #1 The output of the guitar is very weak. 3mV peak-to- peak is typical. The 8-bit ADC of the AVR is setup to use a 5V reference voltage. We have 255 usable steps over the 5 volt range which is equal to 19mV per step. This will not allow us enough precision to detect the zero crossings of the wave form. The bias or baseline of the guitar signal needs to be at 2.56 volts, so we can detect both the positive and negative part of the waveform.

11 11 SOLUTION #1 Amplify and bias the signal using a simple op-amp circuit.

12 12 PROBLEM #2 Due to the varying stiffness of steel guitar strings, along with the fundamental frequency, harmonic frequencies are also generated, which can be quite powerful as seen below:

13 13 PROBLEM #2 The 2 nd harmonic is especially powerful. Since we are only measuring zero crossings of the waveform, the harmonics end up being measured also, producing incorrect results.

14 SOLUTION #2 To prevent false readings, we will filter the harmonics from the signal in software, with the filter customized for each string. I use a bitshift in this filter (>>) to do the division in order to save CPU cycles. The value of filter is set according to current string selection. Lower values create a more narrow band- pass. 14 signal = ((filter * last_sample_value + (16 – filter) * sample_value)>>4);

15 15 RESULTS The circuit and program are successful at reading determining the input frequency accurately. The stepper motor assembly is successful at tuning the strings automatically, although slow.

16 16

17 17

18 18 AVR uC String Selection BIAS OP-AMP Guitar Input Darlington Array

19 Stepper Motor Gear Reduction unit Guitar Interface

20 MEDIA 20 eGuitar tuner in action: eGuitar put to the test against commercial tuner: eGuitar C code: ml

21 21 CONCLUSIONS Considering commercial guitar tuning devices use specialized DSPs, I was quite surprised at how well the AVR functioned. I learned many new things during the project, such as filtering signals in software, the use of AVR ADC and Timers, and stepper motor control.

22 22 COST DeviceCostSource AVR uC$3Mouser LM324 op-amp$0.50Mouser Components$2Mouser 4x20 LCD Display$10EBay Stepper assembly$0Junk FB Scanner Power Supply$0Junk Box Total Cost:$15.50 Commercial Tuner:$80 Savings:$64.50

23 23 FUTURE WORK Use a shielded enclosure to prevent outside interference. Fine tune the OP-AMP circuit and implement hardware filters for faster and more accurate tuning. Streamline the program by writing it in pure assembly code.

24 SOFTWARE Only free / open source software was used in the making of this project, except for Microsoft PowerPoint. Operating System: Ubuntu Linux running KDE Development Environment: KATE Compiler: AVR-GCC AVR Programmer:AVRdude Signal Generation:Siggen 24

25 REFERENCES Atmel Corporation, ATtiny261/461/861 Datasheet, November 7 th 2006, Retrieved from: Atmel Corporation, Digital Filters with AVR, July 16 th 2008, Retrieved from: NonGNU.org, AVR Libc Online Manual, Retrieved from: 25


Download ppt "EGUITAR TUNER Mark Stocker Eastern Kentucky University Department of Technology."

Similar presentations


Ads by Google