Presentation is loading. Please wait.

Presentation is loading. Please wait.

EE 113D Fall 2008 Patrick Lundquist Ryan Wong

Similar presentations


Presentation on theme: "EE 113D Fall 2008 Patrick Lundquist Ryan Wong"— Presentation transcript:

1 EE 113D Fall 2008 Patrick Lundquist Ryan Wong http://weep.wikidot.com/

2  The notes in the music are distinguished by their frequency  The note in each octave is twice the frequency of the same note in the previous octave.  Ex: C = 32.7 Hz, 65.4 Hz, 130.8 Hz, 261.6 Hz, 523.2 Hz … etc. EE 113D Fall 20082

3  The frequencies of the C notes are actually 32.7 Hz, 65.4 Hz, 130.8 Hz, 261.6 Hz… etc.  But we use C = 2 x Hz, where X = 5, 6, 7, 8, 9… for the sake of simplicity. EE 113D Fall 20083 C = 32 Hz, 64 Hz, 128 Hz, 256 Hz, etc.

4  A tuner can be aplied to anything that can be measured on a specturm analyzer  Ex: instruments, function generator, human voice.  We can start testing our finished product with a function generator and then move onto the more complicated human voice. EE 113D Fall 20084

5  Human vocal range: 80-1100 Hz  Piano note frequency range: 27.5 – 4186 Hz  Human hearing 20 Hz – 20 KHz EE 113D Fall 20085

6  We are going to start with the simplest case ◦ Tuning to C (32 Hz, 64 Hz… etc.)  We wish to output high if the input is very close to a C in frequency  Output will be low if input is anything else.  The sampling frequency of the tuner will be 8000 Hz. ◦ We chose this frequency because it is twice the maximum frequency of most instruments. EE 113D Fall 20086

7 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 20087

8  Since we are dealing with frequencies, we know a Fourier Transform will be involved. ◦ The rest is just manipulation to get the correct output from various inputs  The result of the Fourier Transform is a delta function at a memory index. ◦ 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 EE 113D Fall 20088

9 Input (Voice/instrument) Sample Signal Fast Fourier Transform Determine Max Frequency Scale to reference frequency Compare to Tuning Key Output signal EE 113D Fall 20089

10 Input (Voice/instrument) Sample Signal Fast Fourier Transform Determine Max Frequency Scale to reference frequency Compare to Tuning Key Output signal Simulation: generated a sine wave Testing: generated sine wave from function generator Real Life: microphone signal input EE 113D Fall 200810

11 Input (Voice/instrument) Sample Signal Fast Fourier Transform Determine Max Frequency Scale to reference frequency Compare to Tuning Key Output signal Simulation: generated a sine wave Testing: sample.asm from lab EE 113D Fall 200811

12 Input (Voice/instrument) Sample Signal Fast Fourier Transform Determine Max Frequency Scale to reference frequency Compare to Tuning Key Output signal Simulation: FFT function in matlab Testing: RFFT.asm files from experiment 5. Uses a Radix-2, DIT EE 113D Fall 200812

13 Input (Voice/instrument) Sample Signal Fast Fourier Transform Determine Max Frequency Scale to reference frequency Compare to Tuning Key Output signal Simulation: Loop through array find max frequency Testing: getfreq.asm file uses finds max frequency index and converts it EE 113D Fall 200813 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

14 Input (Voice/instrument) Sample Signal Fast Fourier Transform Determine Max Frequency Scale to reference frequency Compare to Tuning Key Output signal 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 200814

15 Input (Voice/instrument) Sample Signal Fast Fourier Transform Determine Max Frequency Scale to reference frequency Compare to Tuning Key Output signal 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 200815

16 Input (Voice/instrument) Sample Signal Fast Fourier Transform Determine Max Frequency Scale to reference frequency Compare to Tuning Key Output signal Simulation: Compare to tuning key and output ratio Testing: thold.asm implements lookup table for comparison and lookup table for result EE 113D Fall 200816

17 Simulation: Compare to tuning key and output ratio Testing: thold.asm implements lookup table for comparison and lookup table for result EE 113D Fall 200817  Lookup.word 11585, 11994, 12417, 12855.word 13308, 13777, 14263, 14766.word 15287, 15826, 16384, 16962 …  Magnup.word 16, 32, 64, 128.word 256, 512, 1024, 2048.word 4096, 8192, 16384, 8192 …

18 Input (Voice/instrument) Sample Signal Fast Fourier Transform Determine Max Frequency Scale to reference frequency Compare to Tuning Key Output signal Simulation: Scaling max frequency to known scale: ~16khz Testing: thold.asm file EE 113D Fall 200818

19  Integrate all modules into one continuous program. ◦ Need to add calling and linking of each module. ◦ Timing issues and assembly syntax problems ◦ Also, nops and @ operator provided initial trouble.  Optimizing program to run in real time. ◦ FFT is a time expensive process that reduces the potential for real time tuning. ◦ Difficult to determine when FFT is finished running. EE 113D Fall 200819

20  FFT algorithm does not work with a voice input from microphone. ◦ Further testing required. EE 113D Fall 200820

21  Tune to multiple notes  Determine what note is being played  Convert output to sheet music  Play sheet music EE 113D Fall 200821

22  Questions? EE 113D Fall 200822


Download ppt "EE 113D Fall 2008 Patrick Lundquist Ryan Wong"

Similar presentations


Ads by Google