top of page

Listen. Analyse. Reconstruct.

 

 

We were inspired by the idea of an instrument box, where we want to prompt the user to input an frequency and to select a type of instrument. Then the instrument would use the stored data of different instruments playing different notes and would process the data to reconstruct the note at the frequency input by the user. 

 

Below is a breakdown of our plans to create such an instrument box in three steps.

 

 

Listen

 

 

  • We first want to be able to read in .wav files that contain instrument samples and exports data on the fundamental frequency and magnitudes of the harmonics of each separate note. The format of the data is such that each pure note is one to two seconds displaced from the next note in the sequence. There is transience at the beginning and at the end of the note. We had to take care not to measure these parts of the signal, because they significantly alter the frequency response of the signal.

 

Analyse

 

 

  • The next part of our project is to map a user-specified frequency to the harmonic series of an instrument at that frequency. It takes both the data (for a specific instrument) and an arbitrary frequency as input and outputs a vector of the magnitudes of the harmonic series that correspond to the specified instrument. A difficulty in designing this script is that different instruments have different timbres in different registers. We made this function adjust for this by finding magnitude data from the previous step that most closely matched the specified frequency using both rectangular (finds an exact magnitude vector that is closest to the provided frequency) and linear (finds a magnitude vector using the slope between the two nearest vectors) approaches.

 

Reconstruct 

 

 

  • The last step we took was to create a GUI for the purpose of interacting with the other two scripts. The GUI allows an instrument to be selected and a frequency to be specified, then it plays said frequency with the timbre (or approximations thereof) of the selected instrument and displays a frequency domain representation of the note. In addition to having several instruments available (clarinet, violin, flute), we also included a button to select a pure sine wave for comparison purposes. Using the built-in Matlab GUI interface, we had no trouble constructing a functional tool that allows for testing of the other components.

 

bottom of page