Digital Tuner


Published on

Published in: Education, Technology, Business
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Digital Tuner

  1. 1. EE 113D Fall 2008 Patrick Lundquist Ryan Wong
  2. 2. <ul><li>The notes in the music are distinguished by their frequency </li></ul><ul><li>The note of each octave is twice the frequency of the same note in the previous octave. </li></ul><ul><li>Ex: C = 32.7 Hz, 65.4 Hz, 130.8 Hz, 261.6 Hz, 523.2 Hz … etc. </li></ul>EE 113D Fall 2008
  3. 3. <ul><li>The frequencies of the C notes are actually 32.7 Hz, 65.4 Hz, 130.8 Hz, 261.6 Hz… etc. </li></ul><ul><li>But we use C = 2 x Hz, where X = 5, 6, 7, 8, 9… for the sake of simplicity. </li></ul>EE 113D Fall 2008
  4. 4. Output signal magnitude generation is exponential: |2 x -2 x+a |, -0.5<a<0.5 Since notes are base 2 logarithmic, not linear C – 7 th octave C – 8 th octave C – 6 th octave Our output signal varies exponentially with the input signal’s relative distance from the tuning frequency. EE 113D Fall 2008
  5. 5. <ul><li>A tuner can be aplied to anything that can be measured on a specturm analyzer </li></ul><ul><li>Ex: instruments, function generator, human voice. </li></ul><ul><li>We can start testing our finished product with a function generator and then move onto the more complicated human voice. </li></ul>EE 113D Fall 2008
  6. 6. <ul><li>Human vocal range: 80-1100 Hz </li></ul><ul><li>Piano note frequency range: 27.5 – 4186 Hz </li></ul><ul><li>Human hearing 20 Hz – 20 KHz </li></ul>EE 113D Fall 2008
  7. 7. <ul><li>We are going to start with the simplest case </li></ul><ul><ul><li>Tuning to C (32 Hz, 64 Hz… etc.) </li></ul></ul><ul><li>We wish to output high if the input is very close to a C in frequency </li></ul><ul><li>Output will be low if input is anything else. </li></ul><ul><li>The sampling frequency of the tuner will be 8000 Hz. </li></ul><ul><ul><li>We chose this frequency because it is twice the maximum frequency of most instruments. </li></ul></ul>EE 113D Fall 2008
  8. 8. <ul><li>Since we are dealing with frequencies, we know a Fourier Transform will be involved. </li></ul><ul><ul><li>The rest is just manipulation to get the correct output from various inputs </li></ul></ul><ul><li>The result of the Fourier Transform is a delta function at a memory index. </li></ul><ul><ul><li>We calculate frequency based on this index: A/B x F = frequency of signal where F is the sampling frequency, A is the index location B is the total number of indices </li></ul></ul>EE 113D Fall 2008
  9. 9. EE 113D Fall 2008
  10. 10. Simulation: generated a sine wave Testing: generated sine wave from function generator Real Life: microphone signal input EE 113D Fall 2008
  11. 11. Simulation: generated a sine wave Testing: sample.asm from lab EE 113D Fall 2008
  12. 12. Simulation: FFT function in matlab Testing: RFFT.asm files from experiment 5. Uses a Radix-2, DIT EE 113D Fall 2008
  13. 13. Simulation: Loop through array find max frequency Testing: getfreq.asm file uses finds max frequency index and converts it EE 113D Fall 2008
  14. 14. Simulation: Scaling max frequency to known scale: ~16khz Testing: thold.asm file performs a series of bitwise shifts to scale to reference freq. EE 113D Fall 2008
  15. 15. Simulation: Compare to tuning key and output ratio Testing: thold.asm implements lookup table for comparison and lookup table for result EE 113D Fall 2008
  16. 16. Simulation: Scaling max frequency to known scale: ~16khz Testing: thold.asm file EE 113D Fall 2008
  17. 17. Sampled signal EE 113D Fall 2008
  18. 18. RFFT graphed output EE 113D Fall 2008
  19. 19. <ul><li>Integrate all modules into one continuous program. </li></ul><ul><ul><li>Need to add calling and linking of each module. </li></ul></ul><ul><ul><li>Timing issues and assembly syntax problems </li></ul></ul><ul><ul><li>Also, nops and @ operator provided initial trouble. </li></ul></ul><ul><li>Optimizing program to run in real time. </li></ul><ul><ul><li>FFT is a time expensive process that reduces the potential for real time tuning. </li></ul></ul><ul><ul><li>Difficult to determine when FFT is finished running. </li></ul></ul>EE 113D Fall 2008
  20. 20. <ul><li>Tune to multiple notes </li></ul><ul><li>Tune to a wider input frequency </li></ul><ul><li>Record matches to memory or output file </li></ul><ul><li>Convert output to sheet music </li></ul><ul><li>Play sheet music </li></ul>EE 113D Fall 2008
  21. 21. <ul><li>Questions? </li></ul>EE 113D Fall 2008