(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
%Jayanth Athreya
+
=[[Homework_1_ECE301Fall2008mboutin|HW1]], [[ECE301]], Prof. [[user:mboutin|Boutin]]=
%Home Work 1.1  Hail Purdue Song
+
In this homework assignment, we were asked to write a Matlab code to play the "Hail Purdue" song with different speeds and pitch.
%Not very sure. Thought it sounds something like it!!
+
----
steps = 0.00025;  % Initialising the steps.I think it is very lengthy
+
%Jayanth Athreya
t=0:steps:0.5;    % Setting the interval
+
%Home Work 1.1  Hail Purdue Song
 +
%Not very sure. Thought it sounds something like it
 +
  steps = 0.00025;  % Initialising the steps.I think it is very lengthy
 +
  t=0:steps:0.5;    % Setting the interval
 
  soundA = sin(2*pi*330*t);  %First sound
 
  soundA = sin(2*pi*330*t);  %First sound
 
  t=0:steps:0.6;            %Break between the previous and the next sound   
 
  t=0:steps:0.6;            %Break between the previous and the next sound   
Line 16: Line 19:
 
  HailP = [soundA soundB soundC soundD soundE soundF];  %Programming statement
 
  HailP = [soundA soundB soundC soundD soundE soundF];  %Programming statement
 
  sound(HailP,1/steps);                                %sound command
 
  sound(HailP,1/steps);                                %sound command
 +
 +
 +
sound(HailP,1/steps*2);  %To get the song to play at two times the actual speed.

Latest revision as of 09:05, 27 August 2010

HW1, ECE301, Prof. Boutin

In this homework assignment, we were asked to write a Matlab code to play the "Hail Purdue" song with different speeds and pitch.


%Jayanth Athreya
%Home Work 1.1  Hail Purdue Song
%Not very sure. Thought it sounds something like it
 steps = 0.00025;   % Initialising the steps.I think it is very lengthy
 t=0:steps:0.5;     % Setting the interval
soundA = sin(2*pi*330*t);  %First sound
t=0:steps:0.6;             %Break between the previous and the next sound  
soundB = sin(2*pi*338*t);  %Second sound
soundC = sin(2*pi*390*t);  %Third sound
soundD = sin(2*pi*420*t);  %fourth sound
soundE = sin(2*pi*490*t);  %fifth sound
t=0:steps:0.53;            %break 
soundE = sin(2*pi*490*t);  %Repitition of the fifth sound
t=0:steps:0.5;             %break
soundF = sin(2*pi*500*t);  %Ending sound
HailP = [soundA soundB soundC soundD soundE soundF];  %Programming statement
sound(HailP,1/steps);                                 %sound command


sound(HailP,1/steps*2);   %To get the song to play at two times the actual speed.

Alumni Liaison

Correspondence Chess Grandmaster and Purdue Alumni

Prof. Dan Fleetwood