(Matlab Code)
Line 38: Line 38:
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
A  = sin(2*2*pi*(0:delta:.5)*220.000);
+
A  = sin(2*pi*(0:delta:.5)*220.000);
Bb = sin(2*2*pi*(0:delta:.5)*233.082);
+
Bb = sin(2*pi*(0:delta:.5)*233.082);
B  = sin(2*2*pi*(0:delta:.5)*246.942);
+
B  = sin(2*pi*(0:delta:.5)*246.942);
C  = sin(2*2*pi*(0:delta:.5)*261.626);
+
C  = sin(2*pi*(0:delta:.5)*261.626);
Db = sin(2*2*pi*(0:delta:.5)*277.183);
+
Db = sin(2*pi*(0:delta:.5)*277.183);
D  = sin(2*2*pi*(0:delta:.5)*293.665);
+
D  = sin(2*pi*(0:delta:.5)*293.665);
Eb = sin(2*2*pi*(0:delta:.5)*311.127);
+
Eb = sin(2*pi*(0:delta:.5)*311.127);
E  = sin(2*2*pi*(0:delta:.5)*329.628);
+
E  = sin(2*pi*(0:delta:.5)*329.628);
F  = sin(2*2*pi*(0:delta:.5)*349.228);
+
F  = sin(2*pi*(0:delta:.5)*349.228);
Gb = sin(2*2*pi*(0:delta:.5)*369.994);
+
Gb = sin(2*pi*(0:delta:.5)*369.994);
G  = sin(2*2*pi*(0:delta:.5)*391.995);
+
G  = sin(2*pi*(0:delta:.5)*391.995);
  
 
notes=[A,B,Db,D,E,Gb,Gb,G,G,G,D,E,F,Gb];
 
notes=[A,B,Db,D,E,Gb,Gb,G,G,G,D,E,F,Gb];
Line 60: Line 60:
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
A  = sin(2*pi*(0:delta:1)*220.000);
+
A  = sin(2*2*pi*(0:delta:1)*220.000);
Bb = sin(2*pi*(0:delta:1)*233.082);
+
Bb = sin(2*2*pi*(0:delta:1)*233.082);
B  = sin(2*pi*(0:delta:1)*246.942);
+
B  = sin(2*2*pi*(0:delta:1)*246.942);
C  = sin(2*pi*(0:delta:1)*261.626);
+
C  = sin(2*2*pi*(0:delta:1)*261.626);
Db = sin(2*pi*(0:delta:1)*277.183);
+
Db = sin(2*2*pi*(0:delta:1)*277.183);
D  = sin(2*pi*(0:delta:1)*293.665);
+
D  = sin(2*2*pi*(0:delta:1)*293.665);
Eb = sin(2*pi*(0:delta:1)*311.127);
+
Eb = sin(2*2*pi*(0:delta:1)*311.127);
E  = sin(2*pi*(0:delta:1)*329.628);
+
E  = sin(2*2*pi*(0:delta:1)*329.628);
F  = sin(2*pi*(0:delta:1)*349.228);
+
F  = sin(2*2*pi*(0:delta:1)*349.228);
Gb = sin(2*pi*(0:delta:1)*369.994);
+
Gb = sin(2*2*pi*(0:delta:1)*369.994);
G  = sin(2*pi*(0:delta:1)*391.995);
+
G  = sin(2*2*pi*(0:delta:1)*391.995);
  
 
notes=[A,B,Db,D,E,Gb,Gb,G,G,G,D,E,F,Gb];
 
notes=[A,B,Db,D,E,Gb,Gb,G,G,G,D,E,F,Gb];

Revision as of 15:38, 5 September 2008

Sound Files

Media:serekson_hailpurdue1_ECE301Fall2008mboutin.wav Media:serekson_hailpurdue2_ECE301Fall2008mboutin.wav

Matlab Code

%Spencer Erekson
%ECE 301 Homework 1 Problem 1
%September 4, 2008

delta=1/20000;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Normal Speed
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

A  = sin(2*pi*(0:delta:1)*220.000);
Bb = sin(2*pi*(0:delta:1)*233.082);
B  = sin(2*pi*(0:delta:1)*246.942);
C  = sin(2*pi*(0:delta:1)*261.626);
Db = sin(2*pi*(0:delta:1)*277.183);
D  = sin(2*pi*(0:delta:1)*293.665);
Eb = sin(2*pi*(0:delta:1)*311.127);
E  = sin(2*pi*(0:delta:1)*329.628);
F  = sin(2*pi*(0:delta:1)*349.228);
Gb = sin(2*pi*(0:delta:1)*369.994);
G  = sin(2*pi*(0:delta:1)*391.995);

%an array of the notes 
notes=[A,B,Db,D,E,Gb,Gb,G,G,G,D,E,F,Gb];

sound(notes,1/delta);

wavwrite(notes,1/delta,32,'serekson_hailpurdue1.wav');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Twice Speed
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

A  = sin(2*pi*(0:delta:.5)*220.000);
Bb = sin(2*pi*(0:delta:.5)*233.082);
B  = sin(2*pi*(0:delta:.5)*246.942);
C  = sin(2*pi*(0:delta:.5)*261.626);
Db = sin(2*pi*(0:delta:.5)*277.183);
D  = sin(2*pi*(0:delta:.5)*293.665);
Eb = sin(2*pi*(0:delta:.5)*311.127);
E  = sin(2*pi*(0:delta:.5)*329.628);
F  = sin(2*pi*(0:delta:.5)*349.228);
Gb = sin(2*pi*(0:delta:.5)*369.994);
G  = sin(2*pi*(0:delta:.5)*391.995);

notes=[A,B,Db,D,E,Gb,Gb,G,G,G,D,E,F,Gb];

sound(notes,1/delta);

wavwrite(notes,1/delta,32,'serekson_hailpurdue2.wav');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Twice Frequency
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

A  = sin(2*2*pi*(0:delta:1)*220.000);
Bb = sin(2*2*pi*(0:delta:1)*233.082);
B  = sin(2*2*pi*(0:delta:1)*246.942);
C  = sin(2*2*pi*(0:delta:1)*261.626);
Db = sin(2*2*pi*(0:delta:1)*277.183);
D  = sin(2*2*pi*(0:delta:1)*293.665);
Eb = sin(2*2*pi*(0:delta:1)*311.127);
E  = sin(2*2*pi*(0:delta:1)*329.628);
F  = sin(2*2*pi*(0:delta:1)*349.228);
Gb = sin(2*2*pi*(0:delta:1)*369.994);
G  = sin(2*2*pi*(0:delta:1)*391.995);

notes=[A,B,Db,D,E,Gb,Gb,G,G,G,D,E,F,Gb];

sound(notes,1/delta);

wavwrite(notes,1/delta,32,'serekson_hailpurdue3.wav');

Alumni Liaison

Recent Math PhD now doing a post-doctorate at UC Riverside.

Kuei-Nuan Lin