Revision as of 07:05, 13 January 2011 by Rgieseck (Talk | contribs)

clc;
clear all;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PART 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

bpm = 112;
bps = bpm / 60;
spb = 1/bps;
delta = 0.00005;
t = 0:delta:3;

E = 0:delta:spb/2;
Q = 0:delta:spb;
H = 0:delta:spb*2;
DQ = 0:delta:3*spb/2;

G = 391.995;
Bf = 466.164;
C = 523.251;
Df = 554.365;

smoke_on_water = [sin(2*pi*G*Q),sin(2*pi*Bf*Q),sin(2*pi*C*DQ),...
sin(2*pi*G*Q),sin(2*pi*Bf*Q),sin(2*pi*Df*E),sin(2*pi*C*H),...
sin(2*pi*G*Q),sin(2*pi*Bf*Q),sin(2*pi*C*DQ),sin(2*pi*Bf*Q),...
sin(2*pi*G*Q)];

sound(smoke_on_water,1/delta);
sound(smoke_on_water,2/delta);
sound(smoke_on_water,1/(2*delta));

wavwrite(smoke_on_water,1/delta,'ECEHW1_1_a');
wavwrite(smoke_on_water,2/delta,'ECEHW1_1_b');
wavwrite(smoke_on_water,1/(2*delta),'ECEHW1_1_c');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PART 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

[beatles, Fs] = wavread('Beatles.wav');
sound(beatles,Fs);

beatles_rev = flipud(beatles);
sound(beatles_rev,Fs);
wavwrite(beatles_rev,Fs,'ECEHW1_2_b');


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Media:ECEHW1_1_a.wav
Media:ECEHW1_1_b.wav
Media:ECEHW1_1_c.wav

Alumni Liaison

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

Kuei-Nuan Lin