Line 1: Line 1:
<br>  
+
<h1 align="center">Homework 1</h1>
 
+
<h1 align="center">Due Wednesday January 12, 2011</h1>
= HW1 [[ECE301]] Spring2011 [[User:Mboutin|Prof_Boutin]]  =
+
 
+
Hello everybody and welcome to the webpage of your first homework assignment for ECE301!
+
  
 
<ol>
 
<ol>
Line 10: Line 7:
  
  
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:  
+
The frequency of any note is related to the frequency of the note middle A (A4) by the following formula:<br><math>f=2^{\frac{n}{12}}\cdot f_A</math>,<br>
 
+
where <math>n</math> is the number of haft steps from A4 and <math>f_A</math> is the frequency of A4. Note that if the note is higher than A4 then <math>n</math> is a postive integer, and if it is lower than A4 <math>n</math> is a negative integer.
  
 +
<!--
 
<table border="1" cellpadding="10" size="4">
 
<table border="1" cellpadding="10" size="4">
 
<tr><td>C</td><td>2x</td></tr>
 
<tr><td>C</td><td>2x</td></tr>
Line 23: Line 21:
 
<tr><td>C</td><td>x</td></tr>
 
<tr><td>C</td><td>x</td></tr>
 
</table>
 
</table>
 +
-->
  
 
+
Recall from class that a sine wave with a 440 Hz frequency is the note A4. Write a Matlab routine that plays the three following tunes consecutively.
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">
 
<ol type="a">
Line 37: Line 35:
  
 
<li>
 
<li>
Take the signal x(t) corresponding to the tune of a) and rescale it according to the transformation y(t)=x(2t)
+
Take the signal <math>x(t)</math> corresponding to the tune of a) and rescale it according to the transformation <math>y(t)=x(2t)</math>
 
</li>
 
</li>
 
</ol>
 
</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.
+
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 results for parts a), b), and c) above. Explain 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.
 
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.

Revision as of 17:09, 7 January 2011

Homework 1

Due Wednesday January 12, 2011

  1. Playing music using Matlab


    The frequency of any note is related to the frequency of the note middle A (A4) by the following formula:
    $ f=2^{\frac{n}{12}}\cdot f_A $,
    where $ n $ is the number of haft steps from A4 and $ f_A $ is the frequency of A4. Note that if the note is higher than A4 then $ n $ is a postive integer, and if it is lower than A4 $ n $ is a negative integer.


    Recall from class that a sine wave with a 440 Hz frequency is the note A4. 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 results for parts a), b), and c) above. Explain 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

Ph.D. on Applied Mathematics in Aug 2007. Involved on applications of image super-resolution to electron microscopy

Francisco Blanco-Silva