(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | %Zach Bright %ECE 301 | + | %Zach Bright |
+ | |||
+ | %ECE 301 | ||
clc; clear all; | clc; clear all; | ||
Line 17: | Line 19: | ||
% beats per second beat = bpm/60; | % beats per second beat = bpm/60; | ||
− | <br>  | + | <br> |
− | <br> %G-note Freq G=391.995; %B-flat freq Bf=466.164; %C freq C=523.251; %D-flat freq Df=554.365; | + | %Eighth note <br> |
+ | E=0:delta:(beat/8); | ||
+ | |||
+ | %Half note <br> | ||
+ | H=0:delta:(beat/2); | ||
+ | |||
+ | %Dotted Quarter note <br> | ||
+ | Dq=0:delta:(beat*(3/8)); | ||
+ | |||
+ | %Quarter note <br> | ||
+ | Q=0:delta:(beat/4); | ||
+ | |||
+ | <br> | ||
+ | %G-note Freq <br> | ||
+ | G=391.995; | ||
+ | |||
+ | %B-flat freq <br> | ||
+ | Bf=466.164; | ||
+ | |||
+ | %C freq <br> | ||
+ | C=523.251; | ||
+ | |||
+ | %D-flat freq <br> | ||
+ | Df=554.365; | ||
if var==3 | 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); | + | end <br> |
+ | %Establish all notes used in the song %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> %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]; | + | <br> |
+ | %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> %create the normal tempo sound file if var==1 | + | <br> |
+ | %create the normal tempo sound file <br> | ||
+ | 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'); | ||
Line 52: | Line 88: | ||
% a) The forward meesage from the Beatles is "Number 9" | % a) The forward meesage from the Beatles is "Number 9" | ||
− | % reverse signal [Beatles_normal, Fs]=wavread('Beatles.wav'); Beatles_reverse=flipud(Beatles_normal) | + | % reverse signal |
+ | [Beatles_normal, Fs]=wavread('Beatles.wav'); <br> | ||
+ | Beatles_reverse=flipud(Beatles_normal)<br>wavwrite(Beatles_reverse,Fs,'backwards_Beatles') <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 <br> | ||
+ | % it sounds like this, but had I not known this, I probably would % 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> | ||
− | + | <br> |
Latest revision as of 07: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