(New page: % ECE301 HW1 % YeeChin, Chiam % Playing Music % Part a % Tempo bpm=112; % Pitch fA=2*pi*440; fBb=(2^(1/12))*fA; fC=(2^(3/12))*fA; fG=(2^(-2/12))*fA; fDb=(2^(4/12))*fA; % Length crotche...) |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
− | % ECE301 HW1 | + | % ECE301 HW1 % YeeChin, Chiam |
− | % YeeChin, Chiam | + | |
− | % Playing Music | + | % Playing Music % Part a |
− | % Part a | + | |
− | % Tempo | + | % Tempo bpm=112; |
− | bpm=112; | + | |
− | % Pitch | + | % Pitch fA=2*pi*440; fBb=(2^(1/12))*fA; fC=(2^(3/12))*fA; fG=(2^(-2/12))*fA; fDb=(2^(4/12))*fA; |
− | fA=2*pi*440; | + | |
− | fBb=(2^(1/12))*fA; | + | |
− | fC=(2^(3/12))*fA; | + | |
− | fG=(2^(-2/12))*fA; | + | |
− | fDb=(2^(4/12))*fA; | + | |
− | % Length | + | % Length crotchet=0:0.00005:(60/bpm); d_crotchet=0:0.00005:(4*60/(3*bpm)); quaver=0:0.00005:(60/(2*bpm)); minim=0:0.00005:(2*60/bpm); |
− | crotchet=0:0.00005:(60/bpm); | + | |
− | d_crotchet=0:0.00005:(4*60/(3*bpm)); | + | |
− | quaver=0:0.00005:(60/(2*bpm)); | + | |
− | minim=0:0.00005:(2*60/bpm); | + | |
− | music=[sin(fG*crotchet),sin(fBb*crotchet),sin(fC*d_crotchet),sin(fG*crotchet),sin(fBb*crotchet),sin(fDb*quaver),sin(fC*minim),sin(fG*crotchet),sin(fBb*crotchet),sin(fC*d_crotchet),sin(fBb*crotchet),sin(fG*crotchet),sin(0:0.00005:(2.5*60/bpm))]; | + | music=[sin(fG*crotchet),sin(fBb*crotchet),sin(fC*d_crotchet),sin(fG*crotchet),sin(fBb*crotchet),sin(fDb*quaver),sin(fC*minim),sin(fG*crotchet),sin(fBb*crotchet),sin(fC*d_crotchet),sin(fBb*crotchet),sin(fG*crotchet),sin(0:0.00005:(2.5*60/bpm))]; sound(music,1/0.00005) wavwrite(music,1/0.00005,'a.wav') |
− | sound(music,1/0.00005) | + | |
− | wavwrite(music,1/0.00005,'a.wav') | + | |
− | [[Media:A.wav]] | + | [[Media:A.wav]] |
− | % Part b | + | % Part b |
− | % Tempo | + | % Tempo bpm=2*112; |
− | bpm=2*112; | + | |
− | % Length | + | % Length crotchet=0:0.00005:(60/bpm); d_crotchet=0:0.00005:(4*60/(3*bpm)); quaver=0:0.00005:(60/(2*bpm)); minim=0:0.00005:(2*60/bpm); |
− | crotchet=0:0.00005:(60/bpm); | + | |
− | d_crotchet=0:0.00005:(4*60/(3*bpm)); | + | |
− | quaver=0:0.00005:(60/(2*bpm)); | + | |
− | minim=0:0.00005:(2*60/bpm); | + | |
− | music=[sin(fG*crotchet),sin(fBb*crotchet),sin(fC*d_crotchet),sin(fG*crotchet),sin(fBb*crotchet),sin(fDb*quaver),sin(fC*minim),sin(fG*crotchet),sin(fBb*crotchet),sin(fC*d_crotchet),sin(fBb*crotchet),sin(fG*crotchet),sin(0:0.00005:(2.5*60/bpm))]; | + | music=[sin(fG*crotchet),sin(fBb*crotchet),sin(fC*d_crotchet),sin(fG*crotchet),sin(fBb*crotchet),sin(fDb*quaver),sin(fC*minim),sin(fG*crotchet),sin(fBb*crotchet),sin(fC*d_crotchet),sin(fBb*crotchet),sin(fG*crotchet),sin(0:0.00005:(2.5*60/bpm))]; sound(music,1/0.00005) wavwrite(music,1/0.00005,'b.wav') |
− | sound(music,1/0.00005) | + | |
− | wavwrite(music,1/0.00005,'b.wav') | + | |
− | [[Media:B.wav]] | + | [[Media:B.wav]] |
− | % Part c | + | % Part c |
− | % Tempo | + | % Tempo bpm=112; |
− | bpm=112; | + | |
− | % Length | + | % Length crotchet=0:0.00005:(60/bpm); d_crotchet=0:0.00005:(4*60/(3*bpm)); quaver=0:0.00005:(60/(2*bpm)); minim=0:0.00005:(2*60/bpm); |
− | crotchet=0:0.00005:(60/bpm); | + | |
− | d_crotchet=0:0.00005:(4*60/(3*bpm)); | + | |
− | quaver=0:0.00005:(60/(2*bpm)); | + | |
− | minim=0:0.00005:(2*60/bpm); | + | |
− | music=[sin(2*fG*crotchet),sin(2*fBb*crotchet),sin(2*fC*d_crotchet),sin(2*fG*crotchet),sin(2*fBb*crotchet),sin(2*fDb*quaver),sin(2*fC*minim),sin(2*fG*crotchet),sin(2*fBb*crotchet),sin(2*fC*d_crotchet),sin(2*fBb*crotchet),sin(2*fG*crotchet),sin(2*0:0.00005:(2.5*60/bpm))]; | + | music=[sin(2*fG*crotchet),sin(2*fBb*crotchet),sin(2*fC*d_crotchet),sin(2*fG*crotchet),sin(2*fBb*crotchet),sin(2*fDb*quaver),sin(2*fC*minim),sin(2*fG*crotchet),sin(2*fBb*crotchet),sin(2*fC*d_crotchet),sin(2*fBb*crotchet),sin(2*fG*crotchet),sin(2*0:0.00005:(2.5*60/bpm))]; sound(music,1/0.00005) wavwrite(music,1/0.00005,'c.wav') |
− | sound(music,1/0.00005) | + | |
− | wavwrite(music,1/0.00005,'c.wav') | + | |
− | [[Media:C.wav]] | + | [[Media:C.wav]] |
− | % Hidden Backward Message | + | % Hidden Backward Message beatles=wavread('Beatles.wav'); rbeatles=flipud(beatles); sound(rbeatles,44100); wavwrite(rbeatles,44100,'reverse_beatles'); |
− | beatles=wavread('Beatles.wav'); | + | |
− | rbeatles=flipud(beatles); | + | |
− | sound(rbeatles,44100); | + | |
− | wavwrite(rbeatles,44100,'reverse_beatles'); | + | |
− | [[Media:Rbeatles.wav]] | + | [[Media:Rbeatles.wav]] |
− | Forward: | + | Forward: speech sounds like "number nine", background music is flipped on 00:16 |
− | speech sounds like "number nine", background music is flipped on 00:16 | + | |
− | Backward: | + | Backward: speech sounds like "let me on the man", |
− | speech sounds like "let me on the man" | + | |
− | Conclusion: | + | Conclusion: Different background musics are put together, with one in forward and one in backward form, while there are no really clear messages from the speaker. |
Latest revision as of 11:17, 17 January 2011
% ECE301 HW1 % YeeChin, Chiam
% Playing Music % Part a
% Tempo bpm=112;
% Pitch fA=2*pi*440; fBb=(2^(1/12))*fA; fC=(2^(3/12))*fA; fG=(2^(-2/12))*fA; fDb=(2^(4/12))*fA;
% Length crotchet=0:0.00005:(60/bpm); d_crotchet=0:0.00005:(4*60/(3*bpm)); quaver=0:0.00005:(60/(2*bpm)); minim=0:0.00005:(2*60/bpm);
music=[sin(fG*crotchet),sin(fBb*crotchet),sin(fC*d_crotchet),sin(fG*crotchet),sin(fBb*crotchet),sin(fDb*quaver),sin(fC*minim),sin(fG*crotchet),sin(fBb*crotchet),sin(fC*d_crotchet),sin(fBb*crotchet),sin(fG*crotchet),sin(0:0.00005:(2.5*60/bpm))]; sound(music,1/0.00005) wavwrite(music,1/0.00005,'a.wav')
% Part b
% Tempo bpm=2*112;
% Length crotchet=0:0.00005:(60/bpm); d_crotchet=0:0.00005:(4*60/(3*bpm)); quaver=0:0.00005:(60/(2*bpm)); minim=0:0.00005:(2*60/bpm);
music=[sin(fG*crotchet),sin(fBb*crotchet),sin(fC*d_crotchet),sin(fG*crotchet),sin(fBb*crotchet),sin(fDb*quaver),sin(fC*minim),sin(fG*crotchet),sin(fBb*crotchet),sin(fC*d_crotchet),sin(fBb*crotchet),sin(fG*crotchet),sin(0:0.00005:(2.5*60/bpm))]; sound(music,1/0.00005) wavwrite(music,1/0.00005,'b.wav')
% Part c
% Tempo bpm=112;
% Length crotchet=0:0.00005:(60/bpm); d_crotchet=0:0.00005:(4*60/(3*bpm)); quaver=0:0.00005:(60/(2*bpm)); minim=0:0.00005:(2*60/bpm);
music=[sin(2*fG*crotchet),sin(2*fBb*crotchet),sin(2*fC*d_crotchet),sin(2*fG*crotchet),sin(2*fBb*crotchet),sin(2*fDb*quaver),sin(2*fC*minim),sin(2*fG*crotchet),sin(2*fBb*crotchet),sin(2*fC*d_crotchet),sin(2*fBb*crotchet),sin(2*fG*crotchet),sin(2*0:0.00005:(2.5*60/bpm))]; sound(music,1/0.00005) wavwrite(music,1/0.00005,'c.wav')
% Hidden Backward Message beatles=wavread('Beatles.wav'); rbeatles=flipud(beatles); sound(rbeatles,44100); wavwrite(rbeatles,44100,'reverse_beatles');
Forward: speech sounds like "number nine", background music is flipped on 00:16
Backward: speech sounds like "let me on the man",
Conclusion: Different background musics are put together, with one in forward and one in backward form, while there are no really clear messages from the speaker.