Line 27: Line 27:
 
The sound of a minor three interval sounds like this.
 
The sound of a minor three interval sounds like this.
  
Note_A:
+
Note_A:This is a cosine function with a frequency = 440Hz.
 +
 
 +
Namely Note_A = cos(440*2*pi*t) = cos(440*2*pi*n/Sample_Rate);
  
 
[[Media:Audio_Signal_Generating_and_Processing_Project_FILES_Note_A.wav]]
 
[[Media:Audio_Signal_Generating_and_Processing_Project_FILES_Note_A.wav]]
  
Note_C:
+
Note_C:This is a cosine function with a frequency = 523.251131Hz.
 +
 
 +
Namely Note_A = cos(523.251131*2*pi*t) = cos(523.251131*2*pi*n/Sample_Rate);
  
 
[[Media:Audio_Signal_Generating_and_Processing_Project_FILES_Note_C.wav]]
 
[[Media:Audio_Signal_Generating_and_Processing_Project_FILES_Note_C.wav]]
  
Distorted m3 interval.
+
Distorted m3 interval: this is the sum up of the Note_A and Note_C directly.
 +
 
 +
Which sounded distorted.
  
 
[[Media:Audio_Signal_Generating_and_Processing_Project_FILES_failed_m3_interval.wav]]
 
[[Media:Audio_Signal_Generating_and_Processing_Project_FILES_failed_m3_interval.wav]]
:Instructor's comments: Can you please clarify what the three above signals are? You may erase my comment once it is addressed. -pm
+
 
 +
 
  
 
After some research reading online materials about mixing audios, several algorithms are tried, but a clear mix sound is still not founded. An article online mentioned that some how MATLAB doesn't allow a sound vector's amplitude to go above. As long as an coefficient less then one is multiplied to each terms, the sum of the waveform does construct a nice sound of mixed audio.
 
After some research reading online materials about mixing audios, several algorithms are tried, but a clear mix sound is still not founded. An article online mentioned that some how MATLAB doesn't allow a sound vector's amplitude to go above. As long as an coefficient less then one is multiplied to each terms, the sum of the waveform does construct a nice sound of mixed audio.

Revision as of 13:27, 29 September 2011


Audio Signal Generating and Processing Project

- Abstract -

This project is intent to analysis different musical instrument's sound, and try to create artificial musical instrument sounds to play a piece.

First, by looking at the Fourier domain, one can and measure the amplitude of each harmonics. The intention is trying to produce similar amplitude harmonic cosine functions, and mix all the waveform together to construct a simulated instrument voice.

- Procedure -

First a couple of sound files are inspected. Particularly this single note piano sound was used. Take the FFT in MATLAB, the frequency domain of the graph looks like this.


Fft piano.png

Then one can record all the amplitude of different harmonics. Also notice that the sound amplitude is decreasing as time goes by. A decreasing exponential envelope is require for the signal to sound more like a real instrumental voice. the amplitude of the waveform of the soundtrack is 4 at very beginning, decreased to 0.5 after 1s and goes to 0.5 after 3 seconds. So an envelope function $ e^{(-2.07944154*t)} = e^{(-2.07944154/samplerate*n)} $

Next thing need to be done, is design a pattern that plays multiple notes at the same time. The first guess is just sum up all the harmonics and get the result. But actually this doesn't work. The sound of a minor three interval sounds like this.

Note_A:This is a cosine function with a frequency = 440Hz.

Namely Note_A = cos(440*2*pi*t) = cos(440*2*pi*n/Sample_Rate);

Media:Audio_Signal_Generating_and_Processing_Project_FILES_Note_A.wav

Note_C:This is a cosine function with a frequency = 523.251131Hz.

Namely Note_A = cos(523.251131*2*pi*t) = cos(523.251131*2*pi*n/Sample_Rate);

Media:Audio_Signal_Generating_and_Processing_Project_FILES_Note_C.wav

Distorted m3 interval: this is the sum up of the Note_A and Note_C directly.

Which sounded distorted.

Media:Audio_Signal_Generating_and_Processing_Project_FILES_failed_m3_interval.wav


After some research reading online materials about mixing audios, several algorithms are tried, but a clear mix sound is still not founded. An article online mentioned that some how MATLAB doesn't allow a sound vector's amplitude to go above. As long as an coefficient less then one is multiplied to each terms, the sum of the waveform does construct a nice sound of mixed audio.

Here is a mixed C chord, consisting C,G,c,e1 four notes.

Media:Audio_Signal_Generating_and_Processing_Project_FILES_C_chord.wav‎

As a testing, I wrote an script that plays the first two lines of Parable's piece <Canon>.

Media:Audio_Signal_Generating_and_Processing_Project_FILES_canon_pure_frequency_with_chord.wav


Next step is to construct the piano sound, and compare the artificial voice to real pianos, then make matlab to play pieces of music.


All Matlab files can be download here. Media:Audio_Signal_Generating_and_Processing_Project_FILES_MATLAB_FILES.zip‎


Back to 2011 Fall ECE 438 Boutin

Alumni Liaison

Questions/answers with a recent ECE grad

Ryne Rayburn