(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
% Sachin Santhakumar<br>% ECE 301<br>% HW 01 Problem 01<br>% Playing Music<br>% 01/19/2011
+
[[Media:SmokeWaterSanthakumar.wav]]
  
clear;<br>clc;
+
[[Media:SmokeWater2xSpeedSanthakumar.wav]]
  
% beats per second<br>bps = 112/60;<br>% seconds per beat<br>beat_time = bps^-1;
+
[[Media:SmokeWaterTransformedSanthakumar.wav]]
  
% Length of time for each entry in the sound array<br>delta = 0.00005;
+
% Sachin Santhakumar<br>% ECE 301<br>% HW 01 Problem 01<br>% Playing Music<br>% 01/19/2011
  
% Note lengths<br>quarter = 0:delta:beat_time;<br>half = 0:delta:beat_time*2;<br>dotquart = 0:delta:beat_time*(3/2);<br>eighth = 0:delta:beat_time*(1/2);
+
clear;<br>clc;  
  
% Note frequencies<br>freqG = 391.995;<br>freqBf = 466.164;<br>freqC = 523.251;<br>freqDf = 554.365;
+
% beats per second<br>bps = 112/60;<br>% seconds per beat<br>beat_time = bps^-1;  
  
% Construction of the signal of all the required notes<br>GQ = sin(2*pi*freqG*quarter);<br>BfQ = sin(2*pi*freqBf*quarter);<br>CDq = sin(2*pi*freqC*dotquart);<br>DfE = sin(2*pi*freqDf*eighth);<br>CH = sin(2*pi*freqC*half);<br>CDq = sin(2*pi*freqC*dotquart);<br>Erest = zeros((eighth/delta),1);<br>Hrest = zeros((half/delta),1);
+
% Length of time for each entry in the sound array<br>delta = 0.00005;  
  
% Signal for the song<br>X = [GQ,BfQ,CDq,GQ,BfQ,DfE,CH,GQ,BfQ,CDq,BfQ,GQ,Erest,Hrest];
+
% Note lengths<br>quarter = 0:delta:beat_time;<br>half = 0:delta:beat_time*2;<br>dotquart = 0:delta:beat_time*(3/2);<br>eighth = 0:delta:beat_time*(1/2);  
  
% Plays wav file<br>wavplay(X,1/delta);<br>wavwrite(X,1/delta,32,'SmokeWaterSanthakumar');
+
% Note frequencies<br>freqG = 391.995;<br>freqBf = 466.164;<br>freqC = 523.251;<br>freqDf = 554.365;  
  
% Plays wav file twice as fast<br>wavplay(X,(2/delta));<br>wavwrite(X,2/delta,32,'SmokeWater2xSpeedSanthakumar');
+
% Construction of the signal of all the required notes<br>GQ = sin(2*pi*freqG*quarter);<br>BfQ = sin(2*pi*freqBf*quarter);<br>CDq = sin(2*pi*freqC*dotquart);<br>DfE = sin(2*pi*freqDf*eighth);<br>CH = sin(2*pi*freqC*half);<br>CDq = sin(2*pi*freqC*dotquart);<br>Erest = zeros((eighth/delta),1);<br>Hrest = zeros((half/delta),1);  
  
% Transformation of y(t) = x(2t);<br>GQ = sin(4*pi*freqG*quarter);<br>BfQ = sin(4*pi*freqBf*quarter);<br>CDq = sin(4*pi*freqC*dotquart);<br>DfE = sin(4*pi*freqDf*eighth);<br>CH = sin(4*pi*freqC*half);<br>CDq = sin(4*pi*freqC*dotquart);<br>Erest = zeros((2*eighth/delta),1);<br>Hrest = zeros((2*half/delta),1);
+
% Signal for the song<br>X = [GQ,BfQ,CDq,GQ,BfQ,DfE,CH,GQ,BfQ,CDq,BfQ,GQ,Erest,Hrest];  
  
Y = [GQ,BfQ,CDq,GQ,BfQ,DfE,CH,GQ,BfQ,CDq,BfQ,GQ,Erest,Hrest];
+
% Plays wav file<br>wavplay(X,1/delta);<br>wavwrite(X,1/delta,32,'SmokeWaterSanthakumar');  
  
% Plays modified wav file<br>wavplay(Y,1/delta);<br>wavwrite(X,1/delta,32,'SmokeWaterTransformedSanthakumar');
+
% Plays wav file twice as fast<br>wavplay(X,(2/delta));<br>wavwrite(X,2/delta,32,'SmokeWater2xSpeedSanthakumar');  
  
% Sachin Santhakumar<br>% ECE 301<br>% HW 01 Problem 02<br>% Hidden Backward Message<br>% 01/19/2011
+
% Transformation of y(t) = x(2t);<br>GQ = sin(4*pi*freqG*quarter);<br>BfQ = sin(4*pi*freqBf*quarter);<br>CDq = sin(4*pi*freqC*dotquart);<br>DfE = sin(4*pi*freqDf*eighth);<br>CH = sin(4*pi*freqC*half);<br>CDq = sin(4*pi*freqC*dotquart);<br>Erest = zeros((2*eighth/delta),1);<br>Hrest = zeros((2*half/delta),1);
  
clear;<br>clc;
+
Y = [GQ,BfQ,CDq,GQ,BfQ,DfE,CH,GQ,BfQ,CDq,BfQ,GQ,Erest,Hrest];  
  
% Reads in wav file<br>[Y, f] = wavread ('Beatles.wav');
+
% Plays modified wav file<br>wavplay(Y,1/delta);<br>wavwrite(Y,1/delta,32,'SmokeWaterTransformedSanthakumar');  
  
Yrev = flipud (Y);<br>% Plays backwards wav file<br>wavplay(Yrev,f);
+
% Sachin Santhakumar<br>% ECE 301<br>% HW 01 Problem 02<br>% Hidden Backward Message<br>% 01/19/2011
 +
 
 +
clear;<br>clc;
 +
 
 +
% Reads in wav file<br>[Y, f] = wavread ('Beatles.wav');
 +
 
 +
Yrev = flipud (Y);<br>% Plays backwards wav file<br>wavplay(Yrev,f);  
  
 
% Forwards the sound clip seems to say "Number Nine"<br>% Backwards the sound clip seems to say "Turn Me On Dead Man"<br>
 
% Forwards the sound clip seems to say "Number Nine"<br>% Backwards the sound clip seems to say "Turn Me On Dead Man"<br>

Latest revision as of 07:58, 19 January 2011

Media:SmokeWaterSanthakumar.wav

Media:SmokeWater2xSpeedSanthakumar.wav

Media:SmokeWaterTransformedSanthakumar.wav

% Sachin Santhakumar
% ECE 301
% HW 01 Problem 01
% Playing Music
% 01/19/2011

clear;
clc;

% beats per second
bps = 112/60;
% seconds per beat
beat_time = bps^-1;

% Length of time for each entry in the sound array
delta = 0.00005;

% Note lengths
quarter = 0:delta:beat_time;
half = 0:delta:beat_time*2;
dotquart = 0:delta:beat_time*(3/2);
eighth = 0:delta:beat_time*(1/2);

% Note frequencies
freqG = 391.995;
freqBf = 466.164;
freqC = 523.251;
freqDf = 554.365;

% Construction of the signal of all the required notes
GQ = sin(2*pi*freqG*quarter);
BfQ = sin(2*pi*freqBf*quarter);
CDq = sin(2*pi*freqC*dotquart);
DfE = sin(2*pi*freqDf*eighth);
CH = sin(2*pi*freqC*half);
CDq = sin(2*pi*freqC*dotquart);
Erest = zeros((eighth/delta),1);
Hrest = zeros((half/delta),1);

% Signal for the song
X = [GQ,BfQ,CDq,GQ,BfQ,DfE,CH,GQ,BfQ,CDq,BfQ,GQ,Erest,Hrest];

% Plays wav file
wavplay(X,1/delta);
wavwrite(X,1/delta,32,'SmokeWaterSanthakumar');

% Plays wav file twice as fast
wavplay(X,(2/delta));
wavwrite(X,2/delta,32,'SmokeWater2xSpeedSanthakumar');

% Transformation of y(t) = x(2t);
GQ = sin(4*pi*freqG*quarter);
BfQ = sin(4*pi*freqBf*quarter);
CDq = sin(4*pi*freqC*dotquart);
DfE = sin(4*pi*freqDf*eighth);
CH = sin(4*pi*freqC*half);
CDq = sin(4*pi*freqC*dotquart);
Erest = zeros((2*eighth/delta),1);
Hrest = zeros((2*half/delta),1);

Y = [GQ,BfQ,CDq,GQ,BfQ,DfE,CH,GQ,BfQ,CDq,BfQ,GQ,Erest,Hrest];

% Plays modified wav file
wavplay(Y,1/delta);
wavwrite(Y,1/delta,32,'SmokeWaterTransformedSanthakumar');

% Sachin Santhakumar
% ECE 301
% HW 01 Problem 02
% Hidden Backward Message
% 01/19/2011

clear;
clc;

% Reads in wav file
[Y, f] = wavread ('Beatles.wav');

Yrev = flipud (Y);
% Plays backwards wav file
wavplay(Yrev,f);

% Forwards the sound clip seems to say "Number Nine"
% Backwards the sound clip seems to say "Turn Me On Dead Man"

Alumni Liaison

Correspondence Chess Grandmaster and Purdue Alumni

Prof. Dan Fleetwood