Presentation is loading. Please wait.

Presentation is loading. Please wait.

Guitar Tuner implemented in Matlab

Similar presentations


Presentation on theme: "Guitar Tuner implemented in Matlab"— Presentation transcript:

1 Guitar Tuner implemented in Matlab
Project group 2 James Andrew Reed, James Nguyen, Cedric Mayfield, Oluwasey Allen and Joseph Hearron

2 Idea Develop a precision instrument tuner that would be able to determine within a finite range perfect intonation.

3 Basis Notes in the musical scale Frequency of the given note
Fast Fourier Transform Percentage Error

4 Take Fast Fourier Transform(FFT) of sound clip
List of frequencies that correspond to the notes of the musical spectrum List of frequencies that correspond to known instruments ( Guitar, Violin, Trumpet, etc…) Record Sound Clip Take Fast Fourier Transform(FFT) of sound clip Compare to list of known frequency for the note that you our trying to tune If frequency is not tuned report “Too Low” or “Too High” and return to step 3 Repeat if more strings need to be tuned End if step 5 shows good and you are done with the instrument

5 Experimental set-up Quiet room Un-tuned guitar
Computer with Matlab program Microphone

6 The High E string of a guitar

7 clear all,clc; x=1; while x==1, x=isempty (input ('Press enter to start program or press zero to quit. ')); ghighE= ; gB= ; gG= ; gD= ; gA=440; glowE= ; guitar=[ghighE,gB,gG,gD,gA,glowE]; if x==1, p=input ('Which string are you adjusting? 1=e 2=B 3=G 4=D 5=A 6=E'); w=guitar (p) y=isempty (input ('Press enter to record input signal or 0 to start over. ')); while y==1, % record input signal Fs=44100; T=0:1:Fs/2-1; I=wavrecord (Fs); % to compare frequencies of a stored save file % let's hear the input signal display ('This is how the input signal sounds. '); sound (I,Fs); % fft of input signal J=fft (I)/size(I,1); K=0:1:Fs/2-1; if p==6 for i=400:size(J,1) J(i,1)=0; end else for i=1500:size(J,1) %Plotting subplot(2,1,1);plot(I); subplot(2,1,2);plot(K,2*real(J(1:Fs/2))); axis([ ]) elseif p==5 axis([ ]) for i=550:size(J,1) elseif p==4 axis([ ]) for i=700:size(J,1)

8 K=0:1:(Fs/2-1); (1. 0015. w) K (find (J==max (J))) (0. 9985
K=0:1:(Fs/2-1); (1.0015*w) K (find (J==max (J))) (0.9985*w) z=((K (find (J==max (J)))-w)/w)*100; if (1.0015*w)>K (find (J==max (J)))&& (0.9985*w)<K (find (J==max (J))), display ('Perfect Intonation!!!'); disp (['The frequency of the input signal is, ',num2str (K (find (J==max (J)))) 'Hz.']); fprintf ('Percent Error % d %% \n',z) elseif w>K (find (J==max (J))), display ('Input frequency should be increased'); elseif w<K (find (J==max (J))), display ('Input frequency should be decreased'); end y=isempty (input ('Make needed adjustments and press enter to record a new input signal or 0 to start over. ')); if y==1, continue; else x=1; elseif p==3 axis([ ]) for i=900:size(J,1) J(i,1)=0; end elseif p==2 axis([ ]) for i=1200:size(J,1) elseif p==1 axis([ ]) for i=1500:size(J,1) % xlabel('Frequency(Hz)'),ylabel('Amplitude(V)'); % title('input signal');

9 Conclusion The successful implementation of a guitar tuner inside of Matlab. Without the use of FFT this would not be possible. This is a more acurate tuner than those that can be purchased at a guitar shop.

10 Sources - US Patent Automatic musical instrument tuning system - Understanding Musical Notes and their Notation Department of Computer Engineering University of Peradeniya website Intonation Facts Author(s): Everett Timm Source: Music Educators Journal, Vol. 29, No. 3 (Jan., 1943), pp Published by: MENC: The National Association for Music Education Stable URL: Accessed: 23/03/ :44 Intonation in Theory and Practice of Greek and Turkish Music Author(s): Iannis Zannos Source: Yearbook for Traditional Music, Vol. 22 (1990), pp Published by: International Council for Traditional Music Stable URL: Accessed: 23/03/ :52 Mozart's Teaching of Intonation Author(s): John Hind Chesnut Source: Journal of the American Musicological Society, Vol. 30, No. 2 (Summer, 1977), pp Published by: University of California Press on behalf of the American Musicological Society Stable URL: Accessed: 23/03/ :50 Q&A Anonymous Strings; Apr 1999; 13, 7; ProQuest Direct Complete pg. 28 String Instrument Intonation in Upper and Lower Registers: The Effects of Accompaniment Author(s): Vincent J. Kantorski Source: Journal of Research in Music Education, Vol. 34, No. 3 (Autumn, 1986), pp Published by: MENC: The National Association for Music Education Stable URL: Accessed: 23/03/ :42


Download ppt "Guitar Tuner implemented in Matlab"

Similar presentations


Ads by Google