Looking to make a frequency detector.

Thread Starter

athrowawaythought1

Joined Jan 24, 2016
3
I'm trying to make a frequency selector that selects between 5-10 different frequencies. There will be a mic, an amplifier, a set of bandpass filters, and sets of LEDs that correspond to each filter. The goal is to play a relatively pure tone into the mic, and have a certain set of LEDs light up which will be telling of the frequency of the tone. I want each filter to have a range of around 100Hz.

If I play a tone of 250Hz, the set of LEDs that correspond to the 200-300Hz range should light up.

Can this be done by having bandpass filters leading up to LEDs, or is there more to it than that? How can I make sure that the filters only select frequencies inside a 100Hz range? I think this will have something to do with quality factor and bandwidth but I only have a vague idea.
 

GopherT

Joined Nov 23, 2012
8,009
I'm trying to make a frequency selector that selects between 5-10 different frequencies. There will be a mic, an amplifier, a set of bandpass filters, and sets of LEDs that correspond to each filter. The goal is to play a relatively pure tone into the mic, and have a certain set of LEDs light up which will be telling of the frequency of the tone. I want each filter to have a range of around 100Hz.

If I play a tone of 250Hz, the set of LEDs that correspond to the 200-300Hz range should light up.

Can this be done by having bandpass filters leading up to LEDs, or is there more to it than that? How can I make sure that the filters only select frequencies inside a 100Hz range? I think this will have something to do with quality factor and bandwidth but I only have a vague idea.

You are talking about a "band pass" filter. All band pass filters have a range of frequencies. The narrower that notch of frequencies that are allowed to pass, the more difficult to build.

Also, the notch of frequencies passing is like a Gaussian distribution. That means the with of the peak loos the same if you always measure at 50% of the peak intensity. However, if you always want to look at 1V level as a trigger point threshhold (to turn LEDs on vs leave them off) your sensor output will depend on the intensity of the incoming signal.

This is a difficult project if those specific frequency bins are important.

If you want one more related to music and the more typical range of musical notes, there are pre-made ICs that do this but the circuit design (IC output) is not straightforward to a new circuit designer.

By the way, the output is commonly called a graphic equalizer. Although it does not equalize anything, it measures the levels of various frequency ranges and sends those levels to a visual display (so you can see the frequency response of upstream filter or amplification changes) - Much like the multi-channel graphic equalizer on component stereos of the 1980s.

One chip is MSGEQ07. Here it is on a breakout board so some of the smaller bits are already included for you. There is still more needed, you cannot just add it to your LEDs. Google datasheet for this EQualizer chip to see frequency bins used.

http://www.ebay.com/itm/like/301210...7290-0%26rvr_id%3D971465255657&chn=ps&lpid=82
 

Thread Starter

athrowawaythought1

Joined Jan 24, 2016
3
You are talking about a "band pass" filter. All band pass filters have a range of frequencies. The narrower that notch of frequencies that are allowed to pass, the more difficult to build.

Also, the notch of frequencies passing is like a Gaussian distribution. That means the with of the peak loos the same if you always measure at 50% of the peak intensity. However, if you always want to look at 1V level as a trigger point threshhold (to turn LEDs on vs leave them off) your sensor output will depend on the intensity of the incoming signal.

This is a difficult project if those specific frequency bins are important.

If you want one more related to music and the more typical range of musical notes, there are pre-made ICs that do this but the circuit design (IC output) is not straightforward to a new circuit designer.

By the way, the output is commonly called a graphic equalizer. Although it does not equalize anything, it measures the levels of various frequency ranges and sends those levels to a visual display (so you can see the frequency response of upstream filter or amplification changes) - Much like the multi-channel graphic equalizer on component stereos of the 1980s.

One chip is MSGEQ07. Here it is on a breakout board so some of the smaller bits are already included for you. There is still more needed, you cannot just add it to your LEDs. Google datasheet for this EQualizer chip to see frequency bins used.

http://www.ebay.com/itm/like/301210655107?ul_noapp=true&ul_ref=http%3A%2F%2Frover.ebay.com%2Frover%2F1%2F711-117182-37290-0%2F2%3Fmtid%3D1588%26kwid%3D1%26crlp%3D53601919689_324272%26itemid%3D301210655107%26targetid%3D154774677609%26rpc%3D0.21%26rpc_upld_id%3D62434%26device%3Dt%26mpre%3Dhttp%253A%252F%252Fwww.ebay.com%252Fulk%252Fitm%252Flike%252F301210655107%253Flpid%253D82%2526chn%253Dps%26adtype%3Dpla%26googleloc%3D1025056%26poi%3D9005849%26campaignid%3D239125209%26adgroupid%3D14978428809%26rlsatarget%3Dpla-154774677609%26gclid%3DCNi9u5PjwsoCFQovHwod280O_A%26srcrot%3D711-117182-37290-0%26rvr_id%3D971465255657&chn=ps&lpid=82

Thank you for the reply.

I didn't realize it would be so difficult to do what I wanted. This is my first major electronics project and I'm really only doing it for the learning experience. As such, I'm not worried about meeting the specifications of my original post exactly as I wrote it. I kind of just guessed a range of 100Hz and don't mind if I have to increase that range in order to make the project more approachable. Also, I don't want to use any IC that is specifically made for frequency detection because won't that just do all the work for me?

What frequency range is easily achievable with band pass filters? I'd prefer 100, but i suppose anything less than 1000 would be fine as well.
 

dannyf

Joined Sep 13, 2015
2,197
Can this be done by having bandpass filters leading up to LEDs,
That would be one way of doing it - opamps are great for this;

It can also be done with counters; or simpler yet, with a mcu - but it requires programming.
 

GopherT

Joined Nov 23, 2012
8,009
Thank you for the reply.

I didn't realize it would be so difficult to do what I wanted. This is my first major electronics project and I'm really only doing it for the learning experience. As such, I'm not worried about meeting the specifications of my original post exactly as I wrote it. I kind of just guessed a range of 100Hz and don't mind if I have to increase that range in order to make the project more approachable. Also, I don't want to use any IC that is specifically made for frequency detection because won't that just do all the work for me?

What frequency range is easily achievable with band pass filters? I'd prefer 100, but i suppose anything less than 1000 would be fine as well.
Filtering works best in multiples, not additive. What ever your first gap is, the next gap should be just as many time bigger than the first step.

100, 300, 900, 2700, 5600 would be good bins. This is also how your ear hears tones. A middle C is twice the frequency of a C from the next lower octave.

Then you need to google band pass filter calculator to figure out how to design a series of them. You are talking about 15 caps and 15 resistors for each passive Twin-T filter. A passive filter may not be narrow enough of a band gap for you so that adds complexity. You will need more component for an active (op amp) filter. Doing it will transistors will be a nightmare.

Then you will need some type of IC to do a voltage compare (whether or not to light the IC) - lkely a comparator or Op amp. IF the input voltage from the filters is too small after filtering, you may need to amplify it (another IC, likely an op amp).

Then you will need some type of sample-and-hold amplifier, or peak-detector, or envelope filter to make sure you can see the lit LEDs otherwise they will be flashing at audio frequencies and not be very visible. This will take another op amp with diode and capacitor. If you go the sample-and-hold or peak detector routes instead of the envelope filter, you will need a reset function built with a astable multivibrator (another op amp or dedicated timer IC) to drain the sample-and-hold amplifier on a regular basis.

Finally, you will need some type of power amplifier or pass transistor to supply power to the LEDs of each color if they are more 15 mA of power.

This will take some time and effort. Not exactly something you want to build ( with 5 or 7 channels of frequency bins) on a breadboard.
 

hp1729

Joined Nov 23, 2015
2,304
You are talking about a "band pass" filter. All band pass filters have a range of frequencies. The narrower that notch of frequencies that are allowed to pass, the more difficult to build.

Also, the notch of frequencies passing is like a Gaussian distribution. That means the with of the peak loos the same if you always measure at 50% of the peak intensity. However, if you always want to look at 1V level as a trigger point threshhold (to turn LEDs on vs leave them off) your sensor output will depend on the intensity of the incoming signal.

This is a difficult project if those specific frequency bins are important.

If you want one more related to music and the more typical range of musical notes, there are pre-made ICs that do this but the circuit design (IC output) is not straightforward to a new circuit designer.

By the way, the output is commonly called a graphic equalizer. Although it does not equalize anything, it measures the levels of various frequency ranges and sends those levels to a visual display (so you can see the frequency response of upstream filter or amplification changes) - Much like the multi-channel graphic equalizer on component stereos of the 1980s.

One chip is MSGEQ07. Here it is on a breakout board so some of the smaller bits are already included for you. There is still more needed, you cannot just add it to your LEDs. Google datasheet for this EQualizer chip to see frequency bins used.

http://www.ebay.com/itm/like/301210...82-37290-0&rvr_id=971465255657&chn=ps&lpid=82
Perhaps something like an LM567. There must be newer stuff out there. Intended to be a frequency detector by design.
 

Thread Starter

athrowawaythought1

Joined Jan 24, 2016
3
Filtering works best in multiples, not additive. What ever your first gap is, the next gap should be just as many time bigger than the first step.

100, 300, 900, 2700, 5600 would be good bins. This is also how your ear hears tones. A middle C is twice the frequency of a C from the next lower octave.

Then you need to google band pass filter calculator to figure out how to design a series of them. You are talking about 15 caps and 15 resistors for each passive Twin-T filter. A passive filter may not be narrow enough of a band gap for you so that adds complexity. You will need more component for an active (op amp) filter. Doing it will transistors will be a nightmare.

Then you will need some type of IC to do a voltage compare (whether or not to light the IC) - lkely a comparator or Op amp. IF the input voltage from the filters is too small after filtering, you may need to amplify it (another IC, likely an op amp).

Then you will need some type of sample-and-hold amplifier, or peak-detector, or envelope filter to make sure you can see the lit LEDs otherwise they will be flashing at audio frequencies and not be very visible. This will take another op amp with diode and capacitor. If you go the sample-and-hold or peak detector routes instead of the envelope filter, you will need a reset function built with a astable multivibrator (another op amp or dedicated timer IC) to drain the sample-and-hold amplifier on a regular basis.

Finally, you will need some type of power amplifier or pass transistor to supply power to the LEDs of each color if they are more 15 mA of power.

This will take some time and effort. Not exactly something you want to build ( with 5 or 7 channels of frequency bins) on a breadboard.


That....is a bummer. I thought this would be the perfect project for me. Something that I can quickly design with a beginner's understanding on filters and amplifiers. But I guess I underestimated the difficulty of it. Can you recommend something along the same vain that would be doable on a breadboard?
 

ian field

Joined Oct 27, 2012
6,536
I'm trying to make a frequency selector that selects between 5-10 different frequencies. There will be a mic, an amplifier, a set of bandpass filters, and sets of LEDs that correspond to each filter. The goal is to play a relatively pure tone into the mic, and have a certain set of LEDs light up which will be telling of the frequency of the tone. I want each filter to have a range of around 100Hz.

If I play a tone of 250Hz, the set of LEDs that correspond to the 200-300Hz range should light up.

Can this be done by having bandpass filters leading up to LEDs, or is there more to it than that? How can I make sure that the filters only select frequencies inside a 100Hz range? I think this will have something to do with quality factor and bandwidth but I only have a vague idea.
You can use an op-amp in a gyrator circuit for each bandpass filter. It electronically simulates inductors that would otherwise be too cumbersome for audio work.

A lot of commercial graphic equaliser use this method, some guitar pedals get away with single transistor gyrators for frequency band boosting. You may be able to get example service manuals with a bit of searching.
 
Top