Go Down

Topic: Using a spectrum analyzer to determine music tone (Read 2232 times) previous topic - next topic

echee

Hi I'm sort of new to the forum, but I'm having some major problems with my project. I am currently using the bliptronics 7 band spectrum analyzer shield with an arduino duemilanove.

I have been able to get to the point where an electret mic inputs sound into the shield and the shield prints out readings for the 7 frequencies.

What I am trying to do next is to somehow convert the Hz and kHz values that the shield spits out into the equivalent musical notes. Does anyone know how to do this? I know it's going to be a complex process.

Any suggestions? All help is greatly appreciated. Thanks :)

andyjjones

#1
Jul 29, 2011, 01:32 pm Last Edit: Jul 29, 2011, 01:40 pm by andyjjones Reason: 1
I'm not an audio/acoustics expert, but I think it depends on the instrument you're sampling.

Here's a fourier transform of a piano playing A3 (220Hz).  



The bliptronics website tells me the bands are at: 63Hz, 160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz and 16kHz.  

If you played A5 on the piano at 880Hz and then you played G?5/A?5 at 830Hz, the fundamental frequency from two notes would appear equally between the 3rd and 4th bands on your spectrum analyser, making it really tough to distinguish between the two.

I think when you have enough information like in the image above, it's easy to tell what note is being played.  But in the case where you have just 7 bands, I don't think the resolution is high enough for you to tell which note is being played.

Magician

Agree, with bliptronics you can't get resolution even on octave scale. Look in wikipedia for a table that connect notes to the frequencies:
http://en.wikipedia.org/wiki/Piano_key_frequencies
And here arduino project that gives you a frequency of the tone:
http://fftarduino.blogspot.com/2011_06_01_archive.html

echee

basically im using a buzzer to generate the tones as I think it would be easier to replicate the volume and length of tones that way.

Magician

What kind of buzzer and where it connected?

echee

at the moment using the buzzer attached to a 3pi robot. so just your genric buzzer. kind of like this one http://www.sparkfun.com/products/7950

so I program the robot to play a note then i'm using a duemilanove arduino and shield to listen and analyze the note played

Magician

What is it for, some kind of audio-modem?
Wouldn't it be easier to transmit information by robot what note it's playing?
Infra red or RF means of communications much more convenient way to transmit data.

PaulS

Quote
kind of like this one

Why not provide a link to one that is EXACTLY like the one you are using?

echee


What is it for, some kind of audio-modem?
Wouldn't it be easier to transmit information by robot what note it's playing?
Infra red or RF means of communications much more convenient way to transmit data.



basically trying to recreate the way in which we hear and playback audio. So, first listening to tune, and trying to replicate the tune by playing it out loud. Part of a research topic i'm looking into.

echee


Quote
kind of like this one

Why not provide a link to one that is EXACTLY like the one you are using?


well the exact buzzer I am using is on the pololu 3pi robot. So there is no link specific to the buzzer. I thought it'd confuse people if I listed this link http://www.pololu.com/catalog/product/975

Magician

I think, it still would be possible to determine a played tone correctly, only if one tone present at any time, due extra non-linear buzzer frequency response.
You can make a research on a web, regarding musical note recognition. After check on a link I poster in replay #2, but you will have to upgrade a code - in order get at least 10 Hz resolution and add duration measurements algorithm in it.

Eibert_Draisma

Hi Echee (I used to have a room mate from Taiwan named I-Chi),

Don't now if you are still working on this project. But if so, check this link:
http://www.neuratron.com/audioscore.htm

But its expensive...


Ciao, Eibert.


Go Up