top of page

STAGE II: Series of Notes

To tune a series of notes, we used a windowing filter. Generally, to perform a DFT on a signal over time, you create a windowing function of length L, which has some non-zero value within the window and zero value outside of the window. Commonly used windows are square (1 inside window and 0 outside window) or Hamming windows. We chose to use a squre window for simplicity.

 

To then take the time varying DFT, the window must be shifted through your signal.  There are two general approaches to this shifting:

 

1. Apply the window to the first L samples (samples zero through L-1) of the signal and calculate the length-L DFT of these samples. Then shift the window by one sample, and repeat the process on samples 1 through L. The mathetmatical expression that accomplishes this process is shown below, where w[m] is the window fucntion.​

 

 

 

 

2. Apply the window to the first L samples (samples zero through L-1) of the signal and calculate the length-L DFT of these samples. Then shift the window by M samples, and repeat the process on samples M through M+L. The mathetmatical expression that accomplishes this process is shown below, where the window function is set to a square window and is thus implicit.​

 

 

 

 

 

We chose the second windowing technique. Shifting our window by M samples each interation, where M > 1, increased the speed of our algorithm without notiably decrease reproduced sound quality.  We experimentally settled on a value M = 22,050 Hz.  At our sampling rate of 44,100 Hz, this gave us two windows per second, which was sufficient for a piece of slow tempo music and did a good job of balancing the frequency/time tradeoff. More samples gave us higher frequency resolution and better note detection and correction; a longer window led to a smoothed and distored musical output.

 

Once we had segmented our musical samples into windows, we applied our Stage I tuning algorithm to each window to reproduce a tuned sequence of notes.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

This is a spectrogram of a series of notes from Stage II. This was generated using MATLAB’s built-in spectrogram function. Although this was not the same type of windowing we did in our project, it does show how a series of notes is broken up in time.

 

 

 

bottom of page