Line 1: Line 1:
[[Category:2011 Spring ECE 301 Boutin]]
+
<br>
  
=HW1 [[ECE301]] Spring2011 [[user:mboutin|Prof_Boutin]]=
+
= HW1 [[ECE301]] Spring2011 [[User:Mboutin|Prof_Boutin]] =
 +
 
 +
Hello everybody and welcome to the webpage of your first homework assignment for ECE301!
 +
 
 +
<ol>
 +
<li>
 +
<h2>Playing music using Matlab</h2>
 +
 
 +
 
 +
Pythagoras discovered that the frequency x of the note C is related to the frequencies of the other notes of the C major scale within the same octave as follows:
 +
 
 +
 
 +
<table border="1" cellpadding="10" size="4">
 +
<tr><td>C</td><td>2x</td></tr>
 +
<tr><td>B</td><td>15x/8</td></tr>
 +
<tr><td>A</td><td>5x/3</td></tr>
 +
<tr><td>G</td><td>3x/2</td></tr>
 +
<tr><td>F</td><td>4x/3</td></tr>
 +
<tr><td>E</td><td>5x/4</td></tr>
 +
<tr><td>D</td><td>9x/8</td></tr>
 +
<tr><td>C</td><td>x</td></tr>
 +
</table>
 +
 
 +
 
 +
Recall from class that a sine wave with a 440 Hz frequency is an A. Write a Matlab routine that plays the three following tunes consecutively.
 +
 
 +
<ol type="a">
 +
<li>
 +
The main melody of the song "Smoke On The Water" by Deep Purple. You have to play the melody at its original tempo (112 beats per minute). The melody transcription is [[Media:Smoke_on_the_water.pdf|here]]. The first note is G4. The notes and their corresponding timings are written above and below the staff. In case you don't know this song, you can find it on Youtube. (You can make use of the Matlab functions <b><i>wavread</i></b> or <b><i>sound</i></b>.)
 +
</li>
 +
 
 +
<li>
 +
The tune of a) played 2 times faster.
 +
</li>
 +
 
 +
<li>
 +
Take the signal x(t) corresponding to the tune of a) and rescale it according to the transformation y(t)=x(2t)
 +
</li>
 +
</ol>
 +
 
 +
Create a page called "hw1.1 yourname" on the course wiki in Rhea. On this page, post your Matlab code and a sound file containing your result for a. b. c. above. Then comment your results.
 +
 
 +
If you cannot get this problem to work, then just post what you get along with your Matlab code on Rhea. We will then use your results to illustrate what can go wrong when one tries to play music with Matlab and how to fix it.
 +
</li>
 +
 
 +
<li>
 +
<h2>Hidden Backward Message</h2>
 +
 
 +
The first 25 seconds of the song [[Media:revolution_9.wav|"Revolution 9"]] by The Beatles is said to have a subliminal message that is repeated several times.
 +
<ol type="a">
 +
<li>
 +
What is the forward repeated phrase. Create a Rhea page called "hw1.2_yourname" and write your answer there.
 +
</li>
 +
<li>
 +
Write a Matlab routine to extract the subliminal message by playing the extract backwards. On the Rhea page "hw1.2_yourname", post your code along with a sound file containing the output of your routine (i.e. the reversed version of the song). Then answer the question: Does the reverse song contain a message? If so, what is it?  (You can make use of the Matlab functions <b><i>wavread</i></b>, <b><i>wavwrite</i></b>, and <b><i>flipud</i></b>.)
 +
</li>
 +
</li>
  
== Playing music using MATLAB ==
 
  
  
In this problem you are asked to play (generate) the main melody of the song "Smoke On The Water" by Deep Purple using Matlab.
 
You have to play the song at its original tempo (112 beats per minute) first, and then at double that tempo.
 
The melody transcription is [[Media:Smoke_on_the_water.pdf|here]]. The notes and their corresponding timings are written above and below the staff. In case you don't know this song, you can find it on Youtube.<br><br>
 
After that, you are asked to read off the melody at double the speed, i.e. if <math>x(t)</math> is your melody, then you will be playing <math>x(2t)</math>.
 
Compare what you hear in the latter play to what you hear when you double the tempo of the melody. Explain.
 
  
  
Line 16: Line 66:
  
 
----
 
----
[[ 2011 Spring ECE 301 Boutin|Back to 2011 Spring ECE 301 Boutin]]
+
 
 +
[[2011 Spring ECE 301 Boutin|Back to 2011 Spring ECE 301 Boutin]]
 +
 
 +
<br>
 +
 
 +
[[Category:2011_Spring_ECE_301_Boutin]]

Revision as of 15:26, 7 January 2011


HW1 ECE301 Spring2011 Prof_Boutin

Hello everybody and welcome to the webpage of your first homework assignment for ECE301!

  1. Playing music using Matlab


    Pythagoras discovered that the frequency x of the note C is related to the frequencies of the other notes of the C major scale within the same octave as follows:


    C2x
    B15x/8
    A5x/3
    G3x/2
    F4x/3
    E5x/4
    D9x/8
    Cx


    Recall from class that a sine wave with a 440 Hz frequency is an A. Write a Matlab routine that plays the three following tunes consecutively.

    1. The main melody of the song "Smoke On The Water" by Deep Purple. You have to play the melody at its original tempo (112 beats per minute). The melody transcription is here. The first note is G4. The notes and their corresponding timings are written above and below the staff. In case you don't know this song, you can find it on Youtube. (You can make use of the Matlab functions wavread or sound.)
    2. The tune of a) played 2 times faster.
    3. Take the signal x(t) corresponding to the tune of a) and rescale it according to the transformation y(t)=x(2t)

    Create a page called "hw1.1 yourname" on the course wiki in Rhea. On this page, post your Matlab code and a sound file containing your result for a. b. c. above. Then comment your results.

    If you cannot get this problem to work, then just post what you get along with your Matlab code on Rhea. We will then use your results to illustrate what can go wrong when one tries to play music with Matlab and how to fix it.

  2. Hidden Backward Message

    The first 25 seconds of the song "Revolution 9" by The Beatles is said to have a subliminal message that is repeated several times.

    1. What is the forward repeated phrase. Create a Rhea page called "hw1.2_yourname" and write your answer there.
    2. Write a Matlab routine to extract the subliminal message by playing the extract backwards. On the Rhea page "hw1.2_yourname", post your code along with a sound file containing the output of your routine (i.e. the reversed version of the song). Then answer the question: Does the reverse song contain a message? If so, what is it? (You can make use of the Matlab functions wavread, wavwrite, and flipud.)




    3. Back to 2011 Spring ECE 301 Boutin


Alumni Liaison

Basic linear algebra uncovers and clarifies very important geometry and algebra.

Dr. Paul Garrett