Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Musical instrument recognition (Read 4815 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Musical instrument recognition

Hi all,
I am writing a software in Matlab for recognizing musical instruments.  At the moment, all I have accomplished is displaying the note(A or C#...) and the possible instrument(based on the frequency range of each instrument.
My question is what more could I do?  Do different musical instruments have more overtones then others? could this be a good starting point?

Has anyone had any experience with signal processing?  I would some reliable ressources for information.  The internet can be a very inacurate if you don't know where to look.

Thanks
Jay

 

Musical instrument recognition

Reply #1
Perhaps you should get recordings of instruments and do FFT analysing on them.

edit: 1 clear tone should be good for seeing how overtones of each instrument.
(overtone structure changes for some instruments depending on the tone though (piano)).

Musical instrument recognition

Reply #2
My problems began when I tried to record my guitar.  When I ran the FFT, I got peaks of frequency below the fundamental frequency.  This messed up my code because I thought that the fundamental frequency was always the first peak and wrote my code accordingly.  Now this is not always the case.  Why is it that the guitar has peaks before the fundamental?

Jay

Musical instrument recognition

Reply #3
The enveloppe plays a big role in the sound of an instrument. The attack -> release -> sustain -> decay shape should be analyzed with something similar to a speech recognition software.
I've heard that if you remove the attack, the decay and the release of a trumpet, is sounds like a piano.

Musical instrument recognition

Reply #4
What you're trying to do may be very difficult, indeed.  As someone else pointed out, the harmonic content of an instrument varies throughout it's range.  If, for example, you have a recording of a clarinet playing near the bottom of it's range and you speed up playback of that recording, it will not sound like a clarinet playing in it's mid or upper range.  It will just sound strange.  Likewise, if you take the sound of a trumpet playing very softly and amplify it, it will not sound not like a trumpet playing fortissimo.  These are the very reasons midi's have always sounded mechanical to me.  Not even close to substituting for a real band or orchestra.

Musical instrument recognition

Reply #5
Quote
Why is it that the guitar has peaks before the fundamental?

I'm not entirely sure why, but it definitely has something to do with the way how and in what shape a guitar string vibrates.

I think it is because when a guitar string is plucked, the string forms a tilted triangle-like shape. So when the string vibrates it doesn't look like a sine wave, it looks like a triangle wave. And the "tip" of the triangle moves along the string generating a lower sine-like tone.

You'd be better off by calculating the strongest peak instead of the first peak, at least with guitar and other string instruments. This might fail with harpsichord because IIRC in the overtones are stronger and appear earlier than the fundamental tone. This could be because the harpsichord "pick" plucks the very end of the string. You can emulate the harpsichord sound with guitar by hitting the first or the last 1-2 mm of the string.

Musical instrument recognition

Reply #6
At least to human ears, one of the most important parts of a sound for identifying the source instrument are the 'onset transients.'  You can easily demonstrate this by getting a few different instrument samples and removing the attack; you'll find you have a hard time distinguishing them after.
  These will probably be hard to analyze reliably, due to their chaotic and noisy nature.

Musical instrument recognition

Reply #7
Quote
Now this is not always the case.  Why is it that the guitar has peaks before the fundamental?
[a href="index.php?act=findpost&pid=223318"][{POST_SNAPBACK}][/a]

Resonance of the instrument's body, maybe? Just a guess..
A riddle is a short sword attached to the next 2000 years.