Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Music Information Retrieval Assignment: Creating and Analyzing Sinusoids and Spectrograms, Exercises of Music Information Retrieval

An assignment for the music information retrieval course, where students are required to write a matlab function to generate a sinusoid with logarithmically changing frequency, calculate its spectrogram using different window sizes, hop sizes, and window functions, and compare the results. The assignment includes instructions for using matlab functions and provides suggestions for variations and additional tasks.

Typology: Exercises

2011/2012

Uploaded on 01/25/2012

paulina
paulina 🇺🇸

4.4

(13)

241 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
MPATE-GE 2623 Music Information Retrieval - Assignment # 1
Instructor: Juan Pablo Bello
Please check the course’s website for detailed submission instructions.
Write a Matlab function that creates a 1-second long sinusoid using the equation x(t) =
asin(2πf t), where a= 0.95, the sampling frequency fs= 44.1kHz, and the frequency of
the sinusoid changes logarithmically over time between f= 500Hz and f= 5kHz. Use the
“logspace” function for this.
Using a rectangular window of size N= 128, and a hop size h=N/2, calculate and plot
the spectrogram of this signal such that the x-axis represents time, the y-axis represents
frequency and the z-axis (figure’s colorcode) represents the spectral magnitude in dB. Use
Matlab’s “spectrogram” and “imagesc” functions for this (read their help files carefully
before using them). What do you see? What are the frequency and time resolutions of this
representation? Include graphs and comments in your report as necessary.
Try the following variations:
Make N= 256,512 and 1024.
Make h=N/4, N/16 and N/32.
Use a hamming and a blackman window instead.
Add zero padding by setting the NFFT parameter in “spectogram” to 2,4 and 8 times
the window length.
What happens when you introduce each of these variations? Why? Include graphs and
comments in your report as necessary.
Extra point: Implement a Matlab function for the computation of the spectrogram using
matrix multiplication (as discussed in class) rather than the “fft” function. Use the “buffer”
function to break the signal into N-long overlapping blocks. Make sure this function operates
exactly as the “spectrogram” function. Plot the magnitude of both spectrograms in decibels,
compare results using the frequency-varying sinusoid and comment on the differences between
both implementations. Include graphs in your report as necessary.
1

Partial preview of the text

Download Music Information Retrieval Assignment: Creating and Analyzing Sinusoids and Spectrograms and more Exercises Music Information Retrieval in PDF only on Docsity!

MPATE-GE 2623 Music Information Retrieval - Assignment # 1 Instructor: Juan Pablo Bello

Please check the course’s website for detailed submission instructions.

Write a Matlab function that creates a 1-second long sinusoid using the equation x(t) = a ∗ sin(2πf t), where a = 0.95, the sampling frequency fs = 44. 1 kHz, and the frequency of the sinusoid changes logarithmically over time between f = 500Hz and f = 5kHz. Use the “logspace” function for this.

Using a rectangular window of size N = 128, and a hop size h = N/2, calculate and plot the spectrogram of this signal such that the x-axis represents time, the y-axis represents frequency and the z-axis (figure’s colorcode) represents the spectral magnitude in dB. Use Matlab’s “spectrogram” and “imagesc” functions for this (read their help files carefully before using them). What do you see? What are the frequency and time resolutions of this representation? Include graphs and comments in your report as necessary.

Try the following variations:

  • Make N = 256, 512 and 1024.
  • Make h = N/ 4 , N/16 and N/32.
  • Use a hamming and a blackman window instead.
  • Add zero padding by setting the NFFT parameter in “spectogram” to 2, 4 and 8 times the window length.

What happens when you introduce each of these variations? Why? Include graphs and comments in your report as necessary.

Extra point: Implement a Matlab function for the computation of the spectrogram using matrix multiplication (as discussed in class) rather than the “fft” function. Use the “buffer” function to break the signal into N -long overlapping blocks. Make sure this function operates exactly as the “spectrogram” function. Plot the magnitude of both spectrograms in decibels, compare results using the frequency-varying sinusoid and comment on the differences between both implementations. Include graphs in your report as necessary.