Take the 2-minute tour ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

If I were to pass an audio signal through a Low-Pass filter with a cutoff frequency of 200 Hz (bass), and then send that signal to a comparator, then use this signal to drive an LED, would the LED be able to change its brightness based on the frequency? For example, a high frequency would drive the LED brighter than a lower frequency.

edit: The audio signal would be some sort of music from a computer.

share|improve this question
add comment

5 Answers 5

Caveat: The answer proposed below is not the simplest way to achieve your results, but perhaps more precise and less finicky to get stable results out of, than other methods not involving a microcontroller. This solution is significantly a learner's approach that I have suggested to students before.


A method of obtaining fairly tight audio spectrum separation for your purpose is to use the MSGEQ7 seven-band graphic equalizer IC.

The MSGEQ7 outputs a voltage proportional to the deviation from pole frequency in each of its 7 bands, with the first pole being at 63 Hz, probably ideal for bass the visualization requirement. A simple buffer configuration op-amp on the output will address the 1 MOhm output impedance requirement of this IC.

(Optional) The output can be fed to a op-amp or transistor based transconductance amplifier (or transconductance amplifier IC specifically designed for LED driving e.g. TI OPA660) if you want precise current control on your LED - LED intensity relates to the current through it, not so much the voltage across it.

In order to have the MSGEQ7 monitor only its first band, at power-on a 100 nS pulse on RESET followed by a single 20 microsecond pulse to the STROBE pin will set the device to its first (63 Hz) band and leave it there. A monostable multivibrator using the 555 timer can be used to provide each of the two required pulses.

The required 145 to 180 KHz clock signal can be generated off a 555 timer as well. The MSGEQ7 part is very forgiving of pulse duration and clock frequency variation, so you have flexibility in resistor / capacitor selection for the two monostables and the astable oscillator.

A single NE558 quad timer IC provides the 3 required 555 timers in a single package, leaving one 555 unused.


Additional enhancements:

The design above can be easily expanded to provide indication for any of the 7 audio bands supported by the MSGEQ7 IC, or even all of them by using a demultiplexer on the output.

share|improve this answer
add comment

If you want the LED brightness to vary with the audio frequency then a comparator will not work since that will simply turn the LED on and off based on the comparator reference voltage. You need a circuit that will vary the LED intensity in a continuous manner based on an input voltage. This could be done by converting the audio signal into a varying DC signal using a rectifier and an RC filter with the time constant of the filter dependent on how fast a response you want. The DC signal could drive the base of a transistor with the LED in the collector. Thus the larger the audio signal, the brighter the LED. Now to make the LED brightness a function of frequency will probably require more sophisticated filtering than just a low pass filter which can only provide some measure of separating high frequencies from low. Can you provide more information as to what you are trying to do as that will probably determine how complex the filter needs to be?

share|improve this answer
    
A bass visualizer –  cats Nov 14 '12 at 22:28
add comment

If the audio signal were a simple tone, that should do it, but if its not a tone, probably not as well, depending on how your different frequencies all sum together.

CORRECTION:

Oops, misread. Thought you were passing the highs, not the lows. Still not too sure. I think it would probably depend on where your comparator was set. If the frequencies are too low, you'd be below flicker fusion frequency, and you'd see a flickering LED. If the comparator is set to 0 Volts, then all your signals are 50% duty cycle, and you wouldn't be driving in a PWM way. If your comparator is higher, then the duty cycle may be too small to see a diff in the LED. The amplitude of the signal may also be problematic, if it varied too much. A quiet tone may never excite your comparator, a loud low freq might be brighter than a quiet high freq.

share|improve this answer
    
The audio source would be a music source. The filter wouldn't be able to grab just the bass frequencies and light the LED accordingly? –  cats Nov 14 '12 at 22:01
add comment

Your comparator would simply turn the LED on and off at the frequency of the tone, for example on on the positive half-cycles and off on the negative ones. Since the duty cycle of the LED doesn't change, its brightness cannot be expected to change.

The nice thing about the output of the comparator is that it is a square wave whose amplitude does not vary with the signal's amplitude. Only its frequency tracks that of the input.

So this square wave could be put through a high pass filter, and then the result rectified via a peak detector to produce a DC voltage that is greater for higher frequencies, independently of the amplitude of the original signal.

share|improve this answer
add comment

What you want is a "Color Organ" (google them). There are a ton done with passives (resistor-capactior bandpass filters, and transistors or opamps for the leds).

There discrete solutions as well.
The MSGEQ7 listed above does analog filter and peak detection.
FFT libraries for arduinos or msp430 launchpads or pics allow you to do the same in software.
There are chips like TI's/NatSemi's LM4970 (most ""hobbyiest"" ""friendly"" package) or other's in the Boomer family (really small smd), AMS's AS3665 and AS3668, and ISSI's IS31FL3193,IS31FL3196, and IS31FL3199. These will do all of processing, all you have to do is use i2c to turn them on.

But do what do you mean change brightness based on frequency? Do you mean like stonger/louder bass, the brighter the led, or do you mean the pitch of the music? The slower (<30hz) it is, the longer the led will be solid on and then off. As you get into higher frequencies you will see it blink faster, until it seems solid on, though it might be a bit dimmer at 100hz than at 200hz. The amplitude/volume of the audio will determine how bright the led really is though for the most part.

share|improve this answer
    
Nice answer overall, and quite complete! Though, you can't expect the questioner to clarify your doubts because the user didn't show up since then. Also, you could replace (google them) with a link and a short description of the Color Organ, to make your answer a bit more complete. And please, don't just pass by but stay here with us :) –  clabacchio Dec 23 '12 at 7:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.