Revision as of 20:09, 4 September 2008 by Choi88 (Talk)


% ECE 301
% Jungu Choi
% Mimi Boutin

delta = 0.00005;
t = 0:delta:0.25;
UpperB = 2*9/8*2*pi*440; %Upper B
UpperA = 2*2*pi*440; %Upper A
UpperG = 2*9/10*2*pi*440; %Upper G
UpperF = 2*4/5*2*pi*440; %Upper F
UpperE = 2*3/4*2*pi*440; %Upper E
UpperD = 2*27/40*2*pi*440; %Upper D
UpperC = 2*3/5*2*pi*440; %Upper C
B = 9/8*2*pi*440; %B
A = 2*pi*440;%A
G = 9/10*2*pi*440;%G
F = 4/5*2*pi*440;%F
E = 3/4*2*pi*440;%E
D = 27/40*2*pi*440;%D
C = 3/5*2*pi*440;%C

%Part a)
factor = 2/2; %normal speed

t = 0:delta:0.25*2*factor;
y = sin(G*t);

t = 0:delta:0.25*factor;
y1 = sin(A*t);

t = 0:delta:0.25*factor;
y2 = sin(B*t);

t = 0:delta:0.25*3/2*factor;
y3 = sin(UpperC*t);

t = 0:delta:0.25/2*factor;
y4 = sin(UpperD*t);

t = 0:delta:0.25*factor;
y5 = sin(UpperE*t);

t = 0:delta:0.25*factor;
y6 = sin(UpperE*t);

t = 0:delta:0.25*factor;
y7 = sin(UpperF*t);

t = 0:delta:0.25*factor;
y8 = sin(UpperF*t);

t = 0:delta:0.25*factor;
y9 = sin(UpperC*t);

t = 0:delta:0.25*factor;
y10 = sin(UpperD*t);

t = 0:delta:0.25*4*factor;
y11 = sin(UpperE*t);

t = 0:delta:0.25*2*factor;
y12 = sin(UpperE*t);

t = 0:delta:0.25*3/2*factor;
y13 = sin(UpperE*t);

t = 0:delta:0.25/2*factor;
y14 = sin(UpperD*t);

t = 0:delta:0.25*3/2*factor;
y15 = sin(UpperC*t);

t = 0:delta:0.25/2*factor;
y16 = sin(UpperD*t);

t = 0:delta:0.25*factor;
y17 = sin(UpperE*t);

t = 0:delta:0.25*factor;
y18 = sin(UpperE*t);

t = 0:delta:0.25*factor;
y19 = sin(UpperD*t);

t = 0:delta:0.25/2*factor;
y20 = sin(A*t);

t = 0:delta:0.25/2*factor;
y21 = sin(B*t);

t = 0:delta:0.25*factor;
y22 = sin(UpperC*t);

t = 0:delta:0.25/2*factor;
y23 = sin(B*t);

t = 0:delta:0.25/2*factor;
y24 = sin(A*t);

t = 0:delta:0.25*4*factor;
y25 = sin(UpperD*t);

y = [y y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16 y17 y18 y19 y20 y21 y22 y23 y24 y25];
sound(y, 1/delta)

wavwrite(y,20000,16,'hailpurdue_a')

%Part b)
factor = 1/2; %two times faster

t = 0:delta:0.25*2*factor;
y = sin(G*t);

t = 0:delta:0.25*factor;
y1 = sin(A*t);

t = 0:delta:0.25*factor;
y2 = sin(B*t);

t = 0:delta:0.25*3/2*factor;
y3 = sin(UpperC*t);

t = 0:delta:0.25/2*factor;
y4 = sin(UpperD*t);

t = 0:delta:0.25*factor;
y5 = sin(UpperE*t);

t = 0:delta:0.25*factor;
y6 = sin(UpperE*t);

t = 0:delta:0.25*factor;
y7 = sin(UpperF*t);

t = 0:delta:0.25*factor;
y8 = sin(UpperF*t);

t = 0:delta:0.25*factor;
y9 = sin(UpperC*t);

t = 0:delta:0.25*factor;
y10 = sin(UpperD*t);

t = 0:delta:0.25*4*factor;
y11 = sin(UpperE*t);

t = 0:delta:0.25*2*factor;
y12 = sin(UpperE*t);

t = 0:delta:0.25*3/2*factor;
y13 = sin(UpperE*t);

t = 0:delta:0.25/2*factor;
y14 = sin(UpperD*t);

t = 0:delta:0.25*3/2*factor;
y15 = sin(UpperC*t);

t = 0:delta:0.25/2*factor;
y16 = sin(UpperD*t);

t = 0:delta:0.25*factor;
y17 = sin(UpperE*t);

t = 0:delta:0.25*factor;
y18 = sin(UpperE*t);

t = 0:delta:0.25*factor;
y19 = sin(UpperD*t);

t = 0:delta:0.25/2*factor;
y20 = sin(A*t);

t = 0:delta:0.25/2*factor;
y21 = sin(B*t);

t = 0:delta:0.25*factor;
y22 = sin(UpperC*t);

t = 0:delta:0.25/2*factor;
y23 = sin(B*t);

t = 0:delta:0.25/2*factor;
y24 = sin(A*t);

t = 0:delta:0.25*4*factor;
y25 = sin(UpperD*t);

y = [y y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16 y17 y18 y19 y20 y21 y22 y23 y24 y25];
sound(y, 1/delta)

wavwrite(y,20000,16,'hailpurdue_b')

%Part c)
factor = 2/2; %two times faster
xfactor = 2;

t = 0:delta:0.25*2*factor;
y = sin(G*t*xfactor);

t = 0:delta:0.25*factor;
y1 = sin(A*t*xfactor);

t = 0:delta:0.25*factor;
y1 = sin(A*t*xfactor);

t = 0:delta:0.25*factor;
y2 = sin(B*t*xfactor);

t = 0:delta:0.25*3/2*factor;
y3 = sin(UpperC*t*xfactor);

t = 0:delta:0.25/2*factor;
y4 = sin(UpperD*t*xfactor);

t = 0:delta:0.25*factor;
y5 = sin(UpperE*t*xfactor);

t = 0:delta:0.25*factor;
y6 = sin(UpperE*t*xfactor);

t = 0:delta:0.25*factor;
y7 = sin(UpperF*t*xfactor);

t = 0:delta:0.25*factor;
y8 = sin(UpperF*t*xfactor);

t = 0:delta:0.25*factor;
y9 = sin(UpperC*t*xfactor);

t = 0:delta:0.25*factor;
y10 = sin(UpperD*t*xfactor);

t = 0:delta:0.25*4*factor;
y11 = sin(UpperE*t*xfactor);

t = 0:delta:0.25*2*factor;
y12 = sin(UpperE*t*xfactor);

t = 0:delta:0.25*3/2*factor;
y13 = sin(UpperE*t*xfactor);

t = 0:delta:0.25/2*factor;
y14 = sin(UpperD*t*xfactor);

t = 0:delta:0.25*3/2*factor;
y15 = sin(UpperC*t*xfactor);

t = 0:delta:0.25/2*factor;
y16 = sin(UpperD*t*xfactor);

t = 0:delta:0.25*factor;
y17 = sin(UpperE*t*xfactor);

t = 0:delta:0.25*factor;
y18 = sin(UpperE*t*xfactor);

t = 0:delta:0.25*factor;
y19 = sin(UpperD*t*xfactor);

t = 0:delta:0.25/2*factor;
y20 = sin(A*t*xfactor);

t = 0:delta:0.25/2*factor;
y21 = sin(B*t*xfactor);

t = 0:delta:0.25*factor;
y22 = sin(UpperC*t*xfactor);

t = 0:delta:0.25/2*factor;
y23 = sin(B*t*xfactor);

t = 0:delta:0.25/2*factor;
y24 = sin(A*t*xfactor);

t = 0:delta:0.25*4*factor;
y25 = sin(UpperD*t*xfactor);

y = [y y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16 y17 y18 y19 y20 y21 y22 y23 y24 y25];
sound(y, 1/delta)

wavwrite(y,20000,16,'hailpurdue_c')

Alumni Liaison

Ph.D. 2007, working on developing cool imaging technologies for digital cameras, camera phones, and video surveillance cameras.

Buyue Zhang