This project was based heavily off of a Java applet made by Morten Brydensholt, Wolfgang Christian, and Mario Belloni and distributed in a collection called Physlet Physics published by Prentice-Hall, Inc. A Pearson Company. So the credit for the original idea belongs to them, however, the applet shown here is all my own code. The original applet allowed the user to combine various harmonics to create a wave form and Physlet Physics gave combinations of harmonics meant to simulate an instrument playing. My physics professor suggested that I try to improve upon the sound quality and attempt to create more realistic instrument notes.
My idea was that if I could record an instrument playing a note and find out want harmonics made up that note then the applet could be expanded into a synthesizer. The primary step was implementing the ability to estimate an integral over the data points of a sound file to use Fourier Series to discover the harmonics. This, however, turned out to be a naive approach since I was only anaylizing the first cycle of the sound file and while this found a decent approximation of the first cycle, the resultant sound was a pure note.
From there the goal became discovering how the various harmonics were dieing out over time when playing middle-c on a piano. This is where the project fizzled out. I attempted to analyze harmonics at various points in the sound file, see at what rates the harmonics were changing, and then recreate the waves between the analyzed points using that data. The success, however, was minimal.
Note: For the moment, the ability to load sound files for analysis only works with an example sound file packaged with the applet.- Add harmonics together to get a resultant wave form.
- Change the frequency.
- Play the sound of the wave form.
- See what harmonics are in the first cycle of an 8-bit .wav file.
- Change the any of the numbers H1 - H10 (in either the sine or cosine column) to set the relative amounts of each harmonic. (Remember to click the 'Apply' button)
- Click 'Play Sound' to hear what your wave form sounds like. Note that it doesn't play any .wav file that you load.
- Click 'Load' to display the data for the file "Piano_MiddleC_8bit.wav" and then click 'Calc' to find what harmonics are in the first cycle of the .wav file data. The frequency shoud be set to 256Hz to work with this file since the algorithm involved doesn't automatically find the frequency of the file data.
- Once the file is loaded you can switch between viewing the file data and a graph of the Fourier Series analysis of the file data by selecting one of the radio buttons named 'Draw Wave' and 'Draw Fourier.'