(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
%Zach Bright
+
%Zach Bright 
%ECE 301
+
  
clc;
+
%ECE 301
clear all;
+
  
 +
clc; clear all;
  
% PART 1
+
<br>&nbsp;% PART 1  
  
 +
<br> delta = 0.00005;
  
delta = 0.00005;
+
for var = 1:3&nbsp;%beats per minute bpm = 112;  
  
for var = 1:3
+
if var ==2
%beats per minute
+
bpm = 112;
+
  
if var ==2
 
 
     bpm=112/2;
 
     bpm=112/2;
end   
 
  
% beats per second
+
end
beat = bpm/60;
+
  
 +
% beats per second beat = bpm/60;
  
%Eighth note
+
<br>&nbsp;
E=0:delta:(beat/8);
+
 
%Half note
+
%Eighth note <br>
H=0:delta:(beat/2);
+
E=0:delta:(beat/8);&nbsp;
%Dotted Quarter note
+
 
Dq=0:delta:(beat*(3/8));
+
%Half note <br>
%Quarter note
+
H=0:delta:(beat/2);&nbsp;
 +
 
 +
%Dotted Quarter note <br>
 +
Dq=0:delta:(beat*(3/8));&nbsp;
 +
 
 +
%Quarter note <br>
 
Q=0:delta:(beat/4);
 
Q=0:delta:(beat/4);
 +
 +
<br>&nbsp;
 +
%G-note Freq <br>
 +
G=391.995;&nbsp;
  
 +
%B-flat freq <br>
 +
Bf=466.164;&nbsp;
  
%G-note Freq
+
%C freq <br>
G=391.995;
+
C=523.251;&nbsp;
%B-flat freq
+
Bf=466.164;
+
%C freq
+
C=523.251;
+
%D-flat freq
+
Df=554.365;
+
  
if var==3
+
%D-flat freq <br>
    G=2*G;
+
Df=554.365;  
    Bf=2*Bf;
+
    C=2*C;
+
    Df=2*Df;
+
end
+
%Establish all notes used in the song
+
%in the form of (Note Letter)_(Length Letter)_note=...
+
G_Q_note=sin(2*pi*G*Q);
+
Bf_Q_note=sin(2*pi*Bf*Q);
+
C_Dq_note=sin(2*pi*C*Dq);
+
C_H_note=sin(2*pi*C*H);
+
Df_E_note=sin(2*pi*Df*E);
+
  
 +
if var==3
  
%Song at normal speed
+
G=2*G;
smoke=[G_Q_note, Bf_Q_note, C_Dq_note, G_Q_note,Bf_Q_note, Df_E_note, C_H_note, G_Q_note, Bf_Q_note, C_Dq_note, Bf_Q_note, G_Q_note];
+
Bf=2*Bf;
 +
C=2*C;
 +
Df=2*Df;
  
 +
end&nbsp; <br>
 +
%Establish all notes used in the song&nbsp;%in the form of (Note Letter)_(Length Letter)_note=... <br>
 +
G_Q_note=sin(2*pi*G*Q); <br>
 +
Bf_Q_note=sin(2*pi*Bf*Q); <br>
 +
C_Dq_note=sin(2*pi*C*Dq); <br>
 +
C_H_note=sin(2*pi*C*H); <br>
 +
Df_E_note=sin(2*pi*Df*E); <br>
 +
 +
<br>&nbsp;
 +
%Song at normal speed <br>
 +
smoke=[G_Q_note, Bf_Q_note, C_Dq_note, G_Q_note,Bf_Q_note, Df_E_note, C_H_note, G_Q_note, Bf_Q_note, C_Dq_note, Bf_Q_note, G_Q_note];
 +
 +
<br>&nbsp;
 +
%create the normal tempo sound file <br>
 +
if var==1
  
%create the normal tempo sound file
 
if var==1
 
 
     wavwrite(smoke,1/delta,'smoke_normal.wav');
 
     wavwrite(smoke,1/delta,'smoke_normal.wav');
%create the fast tempo sound file
+
 
elseif var==2
+
%create the fast tempo sound file  
 +
elseif var==2  
 +
 
 
     wavwrite(smoke,1/delta,'smoke_fast.wav');  
 
     wavwrite(smoke,1/delta,'smoke_fast.wav');  
%create the high pitch sound file
+
 
else
+
%create the high pitch sound file else  
 +
 
 
     wavwrite(smoke,1/delta,'smoke_high_pitch.wav');
 
     wavwrite(smoke,1/delta,'smoke_high_pitch.wav');
end
 
  
end
+
end  
   
+
% PART 2
+
  
% a) The forward meesage from the Beatles is "Number 9"
+
end
 +
 
 +
% PART 2
 +
 
 +
% a) The forward meesage from the Beatles is "Number 9"  
  
 
% reverse signal
 
% reverse signal
[Beatles_normal, Fs]=wavread('Beatles.wav');
+
[Beatles_normal, Fs]=wavread('Beatles.wav'); <br>
Beatles_reverse=flipud(Beatles_normal);
+
Beatles_reverse=flipud(Beatles_normal)<br>wavwrite(Beatles_reverse,Fs,'backwards_Beatles') <br>
wavwrite(Beatles_reverse,Fs,'backwards_Beatles')
+
 
 +
% b) In the past I have heard that peolpe think it is saying&nbsp; <br>
 +
% "Turn me on dead man." And because of this previous knowledge&nbsp; <br>
 +
% it sounds like this, but had I not known this, I probably would&nbsp;% not be able to make anything out.
 +
 
 +
[[Media:smoke_normal_zbright.wav|smoke_normal]]<br>
 +
[[Media:smoke_fast_zbright.wav|smoke_fast]]<br>
 +
[[Media:smoke_high_pitch_zbright.wav|smoke_HighPitch]]<br>
 +
[[Media:backwards_Beatles_zbright.wav|BeatlesReverse]]<br>
 +
 
 +
<br>
  
% b) In the past I have heard that peolpe  think it is saying
+
<br>
%    "Turn me on dead man." And because of this previous knowledge
+
%    it sounds like this, but had I not known this, I probably would
+
%    not be able to make anything out.
+

Latest revision as of 08:47, 19 January 2011

%Zach Bright 

%ECE 301

clc; clear all;


 % PART 1


delta = 0.00005;

for var = 1:3 %beats per minute bpm = 112;

if var ==2

   bpm=112/2;

end

% beats per second beat = bpm/60;


 

%Eighth note
E=0:delta:(beat/8); 

%Half note
H=0:delta:(beat/2); 

%Dotted Quarter note
Dq=0:delta:(beat*(3/8)); 

%Quarter note
Q=0:delta:(beat/4);


  %G-note Freq
G=391.995; 

%B-flat freq
Bf=466.164; 

%C freq
C=523.251; 

%D-flat freq
Df=554.365;

if var==3

G=2*G;
Bf=2*Bf;
C=2*C;
Df=2*Df;

end 
%Establish all notes used in the song %in the form of (Note Letter)_(Length Letter)_note=...
G_Q_note=sin(2*pi*G*Q);
Bf_Q_note=sin(2*pi*Bf*Q);
C_Dq_note=sin(2*pi*C*Dq);
C_H_note=sin(2*pi*C*H);
Df_E_note=sin(2*pi*Df*E);


  %Song at normal speed
smoke=[G_Q_note, Bf_Q_note, C_Dq_note, G_Q_note,Bf_Q_note, Df_E_note, C_H_note, G_Q_note, Bf_Q_note, C_Dq_note, Bf_Q_note, G_Q_note];


  %create the normal tempo sound file
if var==1

   wavwrite(smoke,1/delta,'smoke_normal.wav');

%create the fast tempo sound file elseif var==2

   wavwrite(smoke,1/delta,'smoke_fast.wav'); 

%create the high pitch sound file else

   wavwrite(smoke,1/delta,'smoke_high_pitch.wav');

end

end

% PART 2

% a) The forward meesage from the Beatles is "Number 9"

% reverse signal [Beatles_normal, Fs]=wavread('Beatles.wav');
Beatles_reverse=flipud(Beatles_normal)
wavwrite(Beatles_reverse,Fs,'backwards_Beatles')

% b) In the past I have heard that peolpe think it is saying 
% "Turn me on dead man." And because of this previous knowledge 
% it sounds like this, but had I not known this, I probably would % not be able to make anything out.

smoke_normal
smoke_fast
smoke_HighPitch
BeatlesReverse



Alumni Liaison

Ph.D. 2007, working on developing cool imaging technologies for digital cameras, camera phones, and video surveillance cameras.

Buyue Zhang