Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Best way to determine the frequency of a musical note?

Status
Not open for further replies.

whizkid

New Member
Hi, what would be the best way to determine the frequency of a note played by an instrument. I'm thinking about using the fast fourier transform. What do you think of this? For the circuit I'm going to build, what processors would you recommend that could handle these algorithms with little delay? Thanks
 
Some have used a PIC microcontroller. I don't think it's fast enough to do the math too quickly, but the tone doesn't change too quickly so continuous updates are unnecessary.

I believe the max sampling rate of the PIC's ADC might be too slow, too. At least I've heard that. You gotta have 40kHz to sample 20kHz or things go nuts.
 
jrz126 said:
can you use a lm3915 bar graph display IC? you connect an audio source to it, and it will light up a series of led's depending on the intensity of the music. Then you take one of the outputs that lights up an LED, and connect that to the clock of your counter.
instead of lighting up an led when the audio source is loud enough, it will increment your counter, causing different leds to be lit up. Then you can arrange the leds in a niffty pattern. It works really good if you have it connected to a LPF, so the pattern will change only on the low frequencies.
It's alittle complitcated, but it's also very cool.
I did this in my car https://www.cardomain.com/memberpage/435572/2
 
I plan on only using tones up to about 4kHz, so I'll be sampling at a max of 8 kHz...
Someone recommended me a DSP. What do you think of this idea?
 
there are some very nice programs out there that can tell you the frequency of a tone.i shall look for one of them. :)
 
15Hz to 8MHz, accuracy ± 1Hz
http://www.madlab.org/kits/frqmeter.html

I have seen others but can't find links at the minute.

There are two basic methods of determining a frequency ...
1/ measure the time of one cycle (its period),
. . . . the frequency will be 1/time
2/ measure the number of cycles in a finite time window (usually 0.1, 1, 10 or 100 seconds),
. . . . the frequency will be 1/(time/count) = count/time

Method 1 is good for low frequencies as the count value is high giving good resolution but loses resolution rapidly at higher frequencies.

Method 2 is the normal test gear method as it allows tens of MegaHertz to be measured but requires 100 seconds to measure a low audio frequency to anything like 0.001 Hz resolution

Other methods exist such as frequency to voltage converters (used in some synthesisers), it depends on your required accuracy and application.
 
whizkid said:
Hi, what would be the best way to determine the frequency of a note played by an instrument. I'm thinking about using the fast fourier transform. What do you think of this? For the circuit I'm going to build, what processors would you recommend that could handle these algorithms with little delay? Thanks

How little of delay do you need? How accurate do you need to be? FFT sounds like overkill. The fact that it is a musical note places constraints on the frequency band you can expect to process. This can greatly simplify the design. The FFT is a more general approach and requires what might be considered complicated computing hardware.
 
The thing is I need to be able to handle a robust signal ( ie. any instrument) and be able to handle noise. These frequency counter methods are great for a really clean sinusoidal signal, but I don't think they would work for an instrument like a violin or a guitar ( when you have to deal with harmonics).
 
whizkid said:
The thing is I need to be able to handle a robust signal ( ie. any instrument) and be able to handle noise. These frequency counter methods are great for a really clean sinusoidal signal, but I don't think they would work for an instrument like a violin or a guitar ( when you have to deal with harmonics).

Again, what exactly are you trying to do?.
 
whizkid said:
The thing is I need to be able to handle a robust signal ( ie. any instrument) and be able to handle noise. These frequency counter methods are great for a really clean sinusoidal signal, but I don't think they would work for an instrument like a violin or a guitar ( when you have to deal with harmonics).

maybe the general prupose FFT is what you need then. You could possibly program the algorithm into a uC or uP. You don't necessarily need a DSP to do this job. You will need a clean front end analog design to capture and digitize the waveform prior to FFT processing.
 
I don't think most microcontrollers can handle the FFT. I know someone who tried the same project with a microchip, and it usually took over 30 seconds to obtain a frequency. That's why I am considering a DSP.
 
whizkid said:
What microprocessors do you think could handle doing the FFT in a reasonable time (under a second)?

Check on the PICList, there's a project for FFT using a high end PIC, it creates a real time audio frequency display on a VGA monitor - all in software!.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top