Guitar tuner implemented in matlab

Solo disponible en BuenasTareas
  • Páginas : 2 (392 palabras )
  • Descarga(s) : 4
  • Publicado : 3 de junio de 2010
Leer documento completo
Vista previa del texto
clear all,clc;
x=1;
while x==1,
x=isempty (input ('Press enter to start program or press zero to quit. '));
ghighE=1318.1505;
gB=987.7669;
gG=783.9911;
gD=587.3297;
gA=440;glowE=329.6277;
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 inputsignal 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 ofa stored save file
% let's hear the input signal
display ('This is how the input signal sounds. ');
sound (I,Fs);
% fft of input signalJ=fft (I)/size(I,1);
K=0:1:Fs/2-1;

for i=400:size(J,1)
J(i,1)=0;
end
else
for i=1500:size(J,1)J(i,1)=0;
end
end
%Plotting
subplot(2,1,1);plot(I);
subplot(2,1,2);plot(K,2*real(J(1:Fs/2)));if p==6
axis([ 200 500 -0.01 0.01])
for i=400:size(J,1)
J(i,1)=0;
end
elseif p==5
axis([ 400 550 -0.01 0.01])for i=550:size(J,1)
J(i,1)=0;
end
elseif p==4
axis([ 450 700 -0.01 0.01])
for i=700:size(J,1)J(i,1)=0;
end
elseif p==3
axis([ 650 850 -0.01 0.01])
for i=900:size(J,1)
J(i,1)=0;
end
elseif p==2axis([ 800 1100 -0.01 0.01])
for i=1200:size(J,1)
J(i,1)=0;
end
elseif p==1
axis([ 1200 1400 -0.01 0.01])
for...
tracking img