%Daniel Sabo %ECE 301 %HW 1
%Part 1
delta = .00005; bps = 112/60;
whole = 0:delta:bps; half = 0:delta:bps/2; quarter = 0:delta:bps/4; eigth = 0:delta:bps/8; dotted_q = 0:delta:bps*.375;
G = 391.995; Bf = 466.164; C = 523.251; Df = 554.365;
note_G = sin(2*pi*G*quarter); note_Bf = sin(2*pi*Bf*quarter); note_C_dotted = sin(2*pi*C*dotted_q); note_C_half = sin(2*pi*C*half); note_Df = sin(2*pi*Df*eigth);
normal = [note_G,note_Bf,note_C_dotted,note_G,...
note_Bf,note_Df,note_C_half,note_G,... note_Bf,note_C_dotted,note_Bf,note_G];
bps = bps/2;
whole = 0:delta:bps; half = 0:delta:bps/2; quarter = 0:delta:bps/4; eigth = 0:delta:bps/8; dotted_q = 0:delta:bps*.375;
note_G = sin(2*pi*G*quarter); note_Bf = sin(2*pi*Bf*quarter); note_C_dotted = sin(2*pi*C*dotted_q); note_C_half = sin(2*pi*C*half); note_Df = sin(2*pi*Df*eigth);
faster = [note_G,note_Bf,note_C_dotted,note_G,...
note_Bf,note_Df,note_C_half,note_G,... note_Bf,note_C_dotted,note_Bf,note_G];
whole = 0:delta:bps; half = 0:delta:bps/2; quarter = 0:delta:bps/4; eigth = 0:delta:bps/8; dotted_q = 0:delta:bps*.375;
G = 2*G; Bf = 2*Bf; C = 2*C; Df = 2*Df;
note_G = sin(2*pi*G*quarter); note_Bf = sin(2*pi*Bf*quarter); note_C_dotted = sin(2*pi*C*dotted_q); note_C_half = sin(2*pi*C*half); note_Df = sin(2*pi*Df*eigth);
higher = [note_G,note_Bf,note_C_dotted,note_G,...
note_Bf,note_Df,note_C_half,note_G,... note_Bf,note_C_dotted,note_Bf,note_G];
wavwrite(normal, 1/delta,'Normal'); wavwrite(faster, 1/delta,'Twice_Speed'); wavwrite(higher, 1/delta,'Higher_Pitch');
%Part 2 [beatles, fs, bits] = wavread('Beatles.wav'); sound(beatles, fs, bits); reverse = flipud(beatles); sound(reverse,fs); wavwrite(reverse,fs,'Beatles_Reverse');