Revision as of 14:27, 1 September 2008 by Li186 (Talk)

%Hetong Li
%09/01/08
%ECE301 hw1

clear;
clc;
%initialze basic variables
x=440*3/5;%basic frequency.
delta=0.0005;
dur=0.5;
t=0:delta:dur;
scale=1;

%assign frequencies for each tone.
fmidC=x;
fD=9*x/8;
fE=5*x/4;
fF=4*x/3;
fG=3*x/2;
fA=5*x/3;
fB=15*x/8;
fupC=2*x;

part = input('Please choose the part you want to play(a,b,c):','s');

if(strcmp(part,'a'))
    dur=0.5;
elseif(strcmp(part,'b'))
    dur=0.25;
elseif(strcmp(part,'c'))
    scale=2;
else
    fprintf('Sorry,there is no corresponding part');
end

t=0:delta:dur;
%assign signals of each tone.
midC=sin(2*pi*fmidC*t*scale);
D=sin(2*pi*fD*t*scale);
E=sin(2*pi*fE*t*scale);
F=sin(2*pi*fF*t*scale);
G=sin(2*pi*fG*t*scale);
A=sin(2*pi*fA*t*scale);
B=sin(2*pi*fB*t*scale);
upC=sin(2*pi*fupC*t*scale);

y=[midC,midC,G,G,A,A,G,G,F,F,E,E,D,D,midC];
sound(y,1/delta);

Alumni Liaison

Ph.D. on Applied Mathematics in Aug 2007. Involved on applications of image super-resolution to electron microscopy

Francisco Blanco-Silva