Revision as of 08:05, 17 January 2011 by Ekhall (Talk | contribs)

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

clear all %Setup for part A and B

   BPS = 112 / 60;
   Fs = 8192;
   carrior = [0:1/Fs:BPS];
   eight = floor( (BPS/8)/(1/Fs) );
   quarter = eight * 2;
   half = eight * 4;
   dot_quarter = quarter + eight;
   fA = sin((440*2*pi)*carrior);
   fG = sin((440*2*pi*2^(-2/12)*carrior));
   fBb = sin((440*2*pi*2^(1/12)*carrior));
   fC = sin((440*2*pi*2^(3/12)*carrior)); 
   fDb = sin((440*2*pi*2^(4/12)*carrior)); 

% Part A

   song = [ fG(1:quarter) fBb(1:quarter)  fC(1:dot_quarter) ...
       fG(1:quarter) fBb(1:quarter) ...
       fDb(1:eight) fC(1:half) fG(1:quarter) fBb(1:quarter) ...
       fC(1:dot_quarter) fBb(1:quarter) fG(1:quarter) ];
   song = song';
   sound(song, Fs)
   wavwrite(song, Fs, 32, 'regular.wav');
   pause(10)

% Part B (2 times the freq)

   sound(song, Fs * 2)
   wavwrite(song, Fs * 2, 32, 'faster.wav');
   pause(10)

% Part C

   fA = sin((440*4*pi)*carrior);
   fG = sin((440*4*pi*2^(-2/12)*carrior));
   fBb = sin((440*4*pi*2^(1/12)*carrior));
   fC = sin((440*4*pi*2^(3/12)*carrior)); 
   fDb = sin((440*4*pi*2^(4/12)*carrior)); 
   song = [ fG(1:quarter) fBb(1:quarter)  fC(1:dot_quarter) ...
   fG(1:quarter) fBb(1:quarter) ...
   fDb(1:eight) fC(1:half) fG(1:quarter) fBb(1:quarter) ...
   fC(1:dot_quarter) fBb(1:quarter) fG(1:quarter) ];
   song = song';
   sound(song, Fs)
   wavwrite(song, Fs, 32, '2timesFreq.wav');
   pause(10)

%%Part 2

   clear all
   [beatles, Fs] = wavread('Beatles.wav');
   song = flipud(beatles);
   sound(song, Fs)
   wavwrite(song, Fs, 'Beatles_Backwards.wav')
   %Normal: Saying "Number 9" over and over
   %Backwards: "Turn me on *mumble*"
   %The song backwards seems to say something but we try to make sence of
   %   random sounds.

Media:Hw1_ECE301S11_Ethan_Hall_Regular.wav

Media:Hw1_ECE301S11_Ethan_Hall_Faster.wav

Media:Hw1_ECE301S11_Ethan_Hall_2timesFreq.wav‎

Media:Hw1_ECE301S11_Ethan_Hall_Beatles_Backwards.wav

Alumni Liaison

Have a piece of advice for Purdue students? Share it through Rhea!

Alumni Liaison