Revision as of 12:53, 5 September 2008 by Apanja (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

%ANANYA PANJA %ECE 301 %Hail Purdue Chorus A=220; B=247; Db=278; D=294; E=330; F=349; Gb=370; G=392; delta=.0005; stop=.4;

Notes=[A,B,Db,D,E,Gb,Gb,G,G,G,D,E,F,Gb]; t=0:delta:stop;

for i=length(Notes)

   Hail=sin(2*pi*t*Notes(i));
   sound(Hail,1/delta);

end

pause(3); %To play the song twice as fast

for T=1:length(Notes)

   t=0:delta:.5*length(Notes(T));%.5 is the scaling factor
   Hail_1=sin(2*pi*t*Notes(T));
   sound(Hail_1,1/delta);

end

pause(3); %To play the song at double frequency

for T=1:length(Notes)

   t=0:delta:length(Notes(T));
   Hail_2=sin(2*2*pi*t*Notes(T))%2 is the scaling here
   sound(Hail_2,1/delta);

end

Alumni Liaison

Basic linear algebra uncovers and clarifies very important geometry and algebra.

Dr. Paul Garrett