Line 1: Line 1:
 
%HW 1 ECE 301<br>
 
%HW 1 ECE 301<br>
%Jeff Gaines
+
%Jeff Gaines<br>
%REGULAR SPEED
+
%REGULAR SPEED<br>
%bpm = 112 = 1.867 bps
+
%bpm = 112 = 1.867 bps<br>
delta = 0.00005;
+
delta = 0.00005;<br>
half = [0:delta:0.933];
+
half = [0:delta:0.933];<br>
 +
dottedquarter = [0:delta:0.7];<br>
 +
quarter = [0:delta:0.4666];<br>
 +
eighth = [0:delta:0.2333];<br>
  
dottedquarter = [0:delta:0.7];
+
%Notes used<br>
 +
quarter_g = sin(2*pi*(2^(-1/6)*440)*quarter);<br>
 +
quarter_bf = sin(2*pi*(2^(1/12)*440)*quarter);<br>
 +
dottedquarter_c = sin(2*pi*(2^(1/4)*440)*dottedquarter);<br>
 +
eighth_df = sin(2*pi*(2^(1/3)*440)*eighth);<br>
 +
half_c = sin(2*pi*(2^(1/4)*440)*half);<br>
 +
half_g = sin(2*pi*(2^(-1/6)*440)*half);<br>
  
quarter = [0:delta:0.4666];
+
%Note sequence (I made the last note a half G instead of quarter G since it<br>
 +
%sounds more like the song)<br>
 +
melody = [quarter_g, quarter_bf, dottedquarter_c, quarter_g, quarter_bf, eighth_df, half_c, quarter_g, quarter_bf, dottedquarter_c, quarter_bf, half_g];<br>
 +
sound(melody, 1/delta)<br>
 +
wavwrite(melody, 1/delta, 32, 'regular.wav');<br>
 +
pause(8)<br>
  
eighth = [0:delta:0.2333];
+
%FAST SPEED<br>
 +
delta = 0.00005;<br>
 +
half = [0:delta:0.4665];<br>
 +
dottedquarter = [0:delta:0.35];<br>
 +
quarter = [0:delta:0.233];<br>
 +
eighth = [0:delta:0.116];<br>
  
 +
%Notes used<br>
 +
quarter_g = sin(2*pi*(2^(-1/6)*440)*quarter);<br>
 +
quarter_bf = sin(2*pi*(2^(1/12)*440)*quarter);<br>
 +
dottedquarter_c = sin(2*pi*(2^(1/4)*440)*dottedquarter);<br>
 +
eighth_df = sin(2*pi*(2^(1/3)*440)*eighth);<br>
 +
half_c = sin(2*pi*(2^(1/4)*440)*half);<br>
 +
half_g = sin(2*pi*(2^(-1/6)*440)*half);<br>
  
%Notes used
+
%Note sequence<br>
 +
fast_melody = [quarter_g, quarter_bf, dottedquarter_c, quarter_g, quarter_bf, eighth_df, half_c, quarter_g, quarter_bf, dottedquarter_c, quarter_bf, half_g];<br>
 +
sound(fast_melody, 1/delta)<br>
 +
wavwrite(fast_melody, 1/delta, 32, 'fast.wav');<br>
 +
pause(5)<br>
  
quarter_g = sin(2*pi*(2^(-1/6)*440)*quarter);
+
%HIGHER PITCH<br>
 +
delta = 0.00005;<br>
 +
half = [0:delta:0.933];<br>
 +
dottedquarter = [0:delta:0.7];<br>
 +
quarter = [0:delta:0.4666];<br>
 +
eighth = [0:delta:0.2333];<br>
  
quarter_bf = sin(2*pi*(2^(1/12)*440)*quarter);
+
%Notes used<br>
 +
quarter_g = sin(4*pi*(2^(-1/6)*440)*quarter);<br>
 +
quarter_bf = sin(4*pi*(2^(1/12)*440)*quarter);<br>
 +
dottedquarter_c = sin(4*pi*(2^(1/4)*440)*dottedquarter);<br>
 +
eighth_df = sin(4*pi*(2^(1/3)*440)*eighth);<br>
 +
half_c = sin(4*pi*(2^(1/4)*440)*half);<br>
 +
half_g = sin(4*pi*(2^(-1/6)*440)*half);<br>
  
dottedquarter_c = sin(2*pi*(2^(1/4)*440)*dottedquarter);
+
%Note sequence<br>
 +
high_melody = [quarter_g, quarter_bf, dottedquarter_c, quarter_g, quarter_bf, eighth_df, half_c, quarter_g, quarter_bf, dottedquarter_c, quarter_bf, half_g];<br>
 +
sound(high_melody, 1/delta)<br>
 +
wavwrite(high_melody, 1/delta, 32, 'higher.wav');<br>
 +
pause(8)<br>
  
eighth_df = sin(2*pi*(2^(1/3)*440)*eighth);
+
%PART 2<br>
 +
[beatles, fs, bits] = wavread('Beatles.wav');<br>
 +
sound(beatles, fs, bits)<br>
 +
pause(30)<br>
 +
%"number 9" over and over<br>
 +
reverse = flipud(beatles);<br>
 +
sound(reverse, fs, bits)<br>
 +
wavwrite(reverse, fs, 32, 'reverse.wav');<br>
 +
pause(30)<br>
 +
%sounds to me like "let me on the money", but I've read in the past people<br>
 +
%think it says "turn me on dead man"<br>
  
half_c = sin(2*pi*(2^(1/4)*440)*half);
+
[[Media:regular.wav]]<br>
 
+
[[Media:fast.wav]]<br>
half_g = sin(2*pi*(2^(-1/6)*440)*half);
+
[[Media:higher.wav]]<br>
 
+
[[Media:reverse.wav]]<br>
 
+
%Note sequence (I made the last note a half G instead of quarter G since it
+
 
+
%sounds more like the song)
+
 
+
melody = [quarter_g, quarter_bf, dottedquarter_c, quarter_g, quarter_bf, eighth_df, half_c, quarter_g, quarter_bf, dottedquarter_c, quarter_bf, half_g];
+
 
+
sound(melody, 1/delta)
+
 
+
wavwrite(melody, 1/delta, 32, 'regular.wav');
+
 
+
pause(8)
+
 
+
 
+
%FAST SPEED
+
 
+
delta = 0.00005;
+
 
+
half = [0:delta:0.4665];
+
 
+
dottedquarter = [0:delta:0.35];
+
 
+
quarter = [0:delta:0.233];
+
 
+
eighth = [0:delta:0.116];
+
 
+
 
+
%Notes used
+
 
+
quarter_g = sin(2*pi*(2^(-1/6)*440)*quarter);
+
 
+
quarter_bf = sin(2*pi*(2^(1/12)*440)*quarter);
+
 
+
dottedquarter_c = sin(2*pi*(2^(1/4)*440)*dottedquarter);
+
 
+
eighth_df = sin(2*pi*(2^(1/3)*440)*eighth);
+
 
+
half_c = sin(2*pi*(2^(1/4)*440)*half);
+
 
+
half_g = sin(2*pi*(2^(-1/6)*440)*half);
+
 
+
 
+
%Note sequence
+
 
+
fast_melody = [quarter_g, quarter_bf, dottedquarter_c, quarter_g, quarter_bf, eighth_df, half_c, quarter_g, quarter_bf, dottedquarter_c, quarter_bf, half_g];
+
 
+
sound(fast_melody, 1/delta)
+
 
+
wavwrite(fast_melody, 1/delta, 32, 'fast.wav');
+
 
+
pause(5)
+
 
+
 
+
%HIGHER PITCH
+
 
+
delta = 0.00005;
+
 
+
half = [0:delta:0.933];
+
 
+
dottedquarter = [0:delta:0.7];
+
 
+
quarter = [0:delta:0.4666];
+
 
+
eighth = [0:delta:0.2333];
+
 
+
 
+
%Notes used
+
 
+
quarter_g = sin(4*pi*(2^(-1/6)*440)*quarter);
+
 
+
quarter_bf = sin(4*pi*(2^(1/12)*440)*quarter);
+
 
+
dottedquarter_c = sin(4*pi*(2^(1/4)*440)*dottedquarter);
+
 
+
eighth_df = sin(4*pi*(2^(1/3)*440)*eighth);
+
 
+
half_c = sin(4*pi*(2^(1/4)*440)*half);
+
 
+
half_g = sin(4*pi*(2^(-1/6)*440)*half);
+
 
+
 
+
%Note sequence
+
 
+
high_melody = [quarter_g, quarter_bf, dottedquarter_c, quarter_g, quarter_bf, eighth_df, half_c, quarter_g, quarter_bf, dottedquarter_c, quarter_bf, half_g];
+
 
+
sound(high_melody, 1/delta)
+
 
+
wavwrite(high_melody, 1/delta, 32, 'higher.wav');
+
 
+
pause(8)
+
 
+
 
+
%PART 2
+
 
+
[beatles, fs, bits] = wavread('Beatles.wav');
+
 
+
sound(beatles, fs, bits)
+
 
+
pause(30)
+
 
+
%"number 9" over and over
+
 
+
reverse = flipud(beatles);
+
 
+
sound(reverse, fs, bits)
+
 
+
wavwrite(reverse, fs, 32, 'reverse.wav');
+
 
+
pause(30)
+
 
+
%sounds to me like "let me on the money", but I've read in the past people
+
 
+
%think it says "turn me on dead man"
+
 
+
[[Media:regular.wav]]
+
 
+
[[Media:fast.wav]]
+
 
+
[[Media:higher.wav]]
+
 
+
[[Media:reverse.wav]]
+

Revision as of 15:07, 11 January 2011

%HW 1 ECE 301
%Jeff Gaines
%REGULAR SPEED
%bpm = 112 = 1.867 bps
delta = 0.00005;
half = [0:delta:0.933];
dottedquarter = [0:delta:0.7];
quarter = [0:delta:0.4666];
eighth = [0:delta:0.2333];

%Notes used
quarter_g = sin(2*pi*(2^(-1/6)*440)*quarter);
quarter_bf = sin(2*pi*(2^(1/12)*440)*quarter);
dottedquarter_c = sin(2*pi*(2^(1/4)*440)*dottedquarter);
eighth_df = sin(2*pi*(2^(1/3)*440)*eighth);
half_c = sin(2*pi*(2^(1/4)*440)*half);
half_g = sin(2*pi*(2^(-1/6)*440)*half);

%Note sequence (I made the last note a half G instead of quarter G since it
%sounds more like the song)
melody = [quarter_g, quarter_bf, dottedquarter_c, quarter_g, quarter_bf, eighth_df, half_c, quarter_g, quarter_bf, dottedquarter_c, quarter_bf, half_g];
sound(melody, 1/delta)
wavwrite(melody, 1/delta, 32, 'regular.wav');
pause(8)

%FAST SPEED
delta = 0.00005;
half = [0:delta:0.4665];
dottedquarter = [0:delta:0.35];
quarter = [0:delta:0.233];
eighth = [0:delta:0.116];

%Notes used
quarter_g = sin(2*pi*(2^(-1/6)*440)*quarter);
quarter_bf = sin(2*pi*(2^(1/12)*440)*quarter);
dottedquarter_c = sin(2*pi*(2^(1/4)*440)*dottedquarter);
eighth_df = sin(2*pi*(2^(1/3)*440)*eighth);
half_c = sin(2*pi*(2^(1/4)*440)*half);
half_g = sin(2*pi*(2^(-1/6)*440)*half);

%Note sequence
fast_melody = [quarter_g, quarter_bf, dottedquarter_c, quarter_g, quarter_bf, eighth_df, half_c, quarter_g, quarter_bf, dottedquarter_c, quarter_bf, half_g];
sound(fast_melody, 1/delta)
wavwrite(fast_melody, 1/delta, 32, 'fast.wav');
pause(5)

%HIGHER PITCH
delta = 0.00005;
half = [0:delta:0.933];
dottedquarter = [0:delta:0.7];
quarter = [0:delta:0.4666];
eighth = [0:delta:0.2333];

%Notes used
quarter_g = sin(4*pi*(2^(-1/6)*440)*quarter);
quarter_bf = sin(4*pi*(2^(1/12)*440)*quarter);
dottedquarter_c = sin(4*pi*(2^(1/4)*440)*dottedquarter);
eighth_df = sin(4*pi*(2^(1/3)*440)*eighth);
half_c = sin(4*pi*(2^(1/4)*440)*half);
half_g = sin(4*pi*(2^(-1/6)*440)*half);

%Note sequence
high_melody = [quarter_g, quarter_bf, dottedquarter_c, quarter_g, quarter_bf, eighth_df, half_c, quarter_g, quarter_bf, dottedquarter_c, quarter_bf, half_g];
sound(high_melody, 1/delta)
wavwrite(high_melody, 1/delta, 32, 'higher.wav');
pause(8)

%PART 2
[beatles, fs, bits] = wavread('Beatles.wav');
sound(beatles, fs, bits)
pause(30)
%"number 9" over and over
reverse = flipud(beatles);
sound(reverse, fs, bits)
wavwrite(reverse, fs, 32, 'reverse.wav');
pause(30)
%sounds to me like "let me on the money", but I've read in the past people
%think it says "turn me on dead man"

Media:regular.wav
Media:fast.wav
Media:higher.wav
Media:reverse.wav

Alumni Liaison

Correspondence Chess Grandmaster and Purdue Alumni

Prof. Dan Fleetwood