Almost complete music visualizer - Problem

Thread Starter

stuffses

Joined Nov 23, 2012
10
I've got a partly working music visualizer, (6 band spectrum analyser) but there is a problem. I've investigated it thoroughly, but I don't know what to do about it.

Here's a schematic:
*The positive and negative inputs on the LM358 chips are backwards on the schematic

First, audio is sent to each notch bandpass filter (LM358). I got the circuit from here.
Next, the signal from each filter is sent to an LED driver, which powers 10 LEDs each.


The problem is, the three highest frequency filter-driver systems are always lit. The 8K is lit nearly all the way, while the 3K is at about half, and the 800 only just lit.

I've plugged my headphones into the output of each bandpass filter, and the highest three have some noise coming out of them (whether there is a signal going to the input or not). If I put music to the inputs of each filter, I can hear the right frequencies from the right filter (on the 8K, only highs, and the 100, only lows).

The three lowest frequency filters made no noticeable noise at all, and did not light the LEDs unless they had an audio signal coming in.

Although the LED drivers for the three highest are lit, the noise I hear from the filter outputs is much quieter than the sound that would normally light the drivers, therefore I suspect the sound lighting them is out of range of my hearing.

I isolated each bandpass filter from the circuit and listened to their outputs. I noticed that the highest frequency one made a high frequency noise, the second highest made a lower noise, and the third highest made the lowest noise of the three. It seems that having them all on the same circuit combines the noise.

On a probably related note, if I put my headphones in parallel with the audio input, I hear lots of noise from the bandpass filter along with the audio signal. It seems the noise is travelling back through the inputs of the filter (or looping back in some other way).


I've checked the two power supplies, (+5VDC and -5VDC) and they both create a fairly clean signal.

The audio signal come directly from a desktop sound card.

Here is an image of the breadboarded circuit, and here are the LED bars. Only the two highest and lowest (8K, 3K, 100, 30 from left to right) are hooked up in this image. Each LED bar is also upside down (a low signal would light the top few). The paint is chipped, but each LED will be covered by a diffuser, so it doesn't matter much.

I have an oscilloscope if someone needs some measurements.
 

Ron H

Joined Apr 14, 2005
7,063
Do you have power supply decoupling caps on each IC? They will probably oscillate if you don't. You need 100nF from each power pin to ground, as close to the IC as possible, and with leads as short as possible.
You really should have a voltage follower between the audio input and all those filters. They need a near-zero source impedance. I doubt that the source of your audio is close to zero ohms output impedance.
 

Thread Starter

stuffses

Joined Nov 23, 2012
10
Do you have power supply decoupling caps on each IC? They will probably oscillate if you don't. You need 100nF from each power pin to ground, as close to the IC as possible, and with leads as short as possible.
You really should have a voltage follower between the audio input and all those filters. They need a near-zero source impedance. I doubt that the source of your audio is close to zero ohms output impedance.
Adding large decoupling caps to the power supplies only seamed to change the noise (it sounded more "scratchy" with the decouplers) and the local decouplers made no difference at all. Since it's a dual power supply, is there anything I should be doing differently?

I did find that if I isolated the 8K filter into it's own circuit it would create a very loud high pitched sound from it's out pin, and putting a 100nF cap between ground and -5V completely fixed that (No audible noise! But nearly all of the LEDs stayed on for some reason). The high pitched sound goes away when the 100hz filter is put back. This just gets really confusing. I'm sure my wiring is correct.

And I will have a voltage follower, but I don't think that will help with the noise, as the noise happens weather there is an audio signal or not.
 

Ron H

Joined Apr 14, 2005
7,063
Are you aware that your 8kHz filter has 20dB of gain? Since you can only get about 7V p-p output, this means that any input over about 700mV p-p at 8kHz will saturate your op amp. Maybe this isn't a problem. (?)
I haven't looked at your other filters, but the resistors in your 8k are WAY too small. Raise their values by a factor of 100, and change the caps to 1nF.
Use decent op amps, like TL071 (72, 74).
 

#12

Joined Nov 30, 2010
18,224
That schematic is impossible for me to read. How did you do it, Ron? Invert colors?
and ps, I don't know how to invert colors in Firefox. Maybe if I moved it to the desktop?
 

Thread Starter

stuffses

Joined Nov 23, 2012
10
I could never find any information of what values of caps I should use in my resistor calculations, (the TI PDF just said to pick one) so I just used 0.1uF caps for all of them.

What should my target resistance be? I'll recalculate and get new components for anything too far off.

And I'll go order some new op amps! What kind of difference is there between a "decent" op amp and a 358?
 

#12

Joined Nov 30, 2010
18,224
I can see one problem (from Ron's post, #4), the sum of all your inputs has an impedance of less than 150 ohms. Scaling the impedance of the filters up is better than trying to find a driver amp with that kind of power.
 

Ron H

Joined Apr 14, 2005
7,063
I could never find any information of what values of caps I should use in my resistor calculations, (the TI PDF just said to pick one) so I just used 0.1uF caps for all of them.

What should my target resistance be? I'll recalculate and get new components for anything too far off.

And I'll go order some new op amps! What kind of difference is there between a "decent" op amp and a 358?
LM358's gain-bandwidth product (GBW) is too low for your 8kHz high-Q bandpass filter. It might be OK for the others, since you are not going to listen to it. It also has crossover distortion and lousy slew rate, neither of which would probably cause you any grief for this application.
I don't like your color choices either, but I don't have any problem reading your schematic.
I would try to keep the resistor to ground in the in each filter somewhere around 1kΩ. I would probably use 100nF on chs 1 and 2, 10nF on 3 and 4, and 1nF on 5 and 6. Channel 3 could be OK with 100nF.
I ran some simulations on your 8kHz filter, with LM358, TL071, and a "tweakable" op amp that I could make similar to those two, or better, or worse (I was mostly changing GBW).The LM358 peak frequency was 7.3kHz, TL071 was at 7.9kHz, and the ideal op amp was, of course, at 8kHz.

If you don't mind having the peak at 7.3kHz instead of 8kHz, then you should be fine with the LM358, so long as you make the resistor value changes.

Remember that TL07X comes in singles, duals, and quads (as does the LM358).

BTW, if all filters have the same Q, then all will have 20dB of gain.
 

Thread Starter

stuffses

Joined Nov 23, 2012
10
Thanks a lot for the help. I think I can get it working now.

Out of curiosity, what did you use to simulate the circuit?

And the colour choices were the defaults of gschem, (a Linux schematic designer) but I do have the alternate coloured one posted.
 
Top