0
\$\begingroup\$

The two images below are the simple circuit I developed. It consists of a pre-amplifier, a filter, an RC circuit that acts like an exponential average circuit, a peak detector and perhaps I still need to do another amplifier in order to use the entire range of the ADC I intended to connect.

enter image description here

enter image description here

Here are the signals at some of the nodes:

enter image description here

Everything works ok till it reaches that RC circuit. I have a time constant of 30ms and the signal just comes horizontally with no significant variation. What's happening? If I zoom in it's the equal to the input wave but just much smaller.

The peak detector just does what it does, the input of the peak is a straight line so the output will also be one.

The RC circuit I used was inspired by this:

enter image description here

I initially wanted to do a true RMS circuit but I just couldn't find a way to do the square circuit with a 5 volts supply so I just did an "averaging" circuit, good enough for my application I hope.

If I were to connect this circuit to an ADC, how exactly would I build an amplifier that goes to the input range (0V to 3.3V) of the ADC? I could use an op-amp in non-inverting configuration but then what?

\$\endgroup\$
2
  • 1
    \$\begingroup\$ It's not clear from your description what sort of result you were expecting from the RC circuit. It's a low-pass filter with a -3dB point at about 4.5Hz, so it looks to me as though you're getting roughly the result you should be getting... \$\endgroup\$
    – brhans
    Dec 1, 2022 at 3:18
  • \$\begingroup\$ I am trying to get the envelope shape out of the filter like the other user said \$\endgroup\$
    – Scipio
    Dec 1, 2022 at 3:55

2 Answers 2

1
\$\begingroup\$

As mentioned in the comments, your RC low pass filter (R14 and C11) has a cutoff frequency of about 4.5 Hz. Since your signal is composed of mostly higher frequencies, it is pretty much all filtered away.

The average of an audio signal is zero. RMS takes the square root of the mean square. That is, you square all the values before summing and taking the square root. Squaring makes all the values for the mean positive.

You need to move your averaging circuit (the low pass filter) to after the point where you take the peak (which is more or less the absolute value and always positive.)

schematic

simulate this circuit – Schematic created using CircuitLab

The result will be sort of somewhat like RMS, but not really. If you just want a value proportional to the volume of the music, then this will get you something that'll work. If you want something that will match RMS values or other values measured with proper instruments, then this will not be sufficient - it will never really match anything as measured by proper instruments.

\$\endgroup\$
2
\$\begingroup\$

The long-term average value of any audio signal is 0 V.

The low-pass filter sections are DC-coupled, but the highpass sections are not. Thus, the zero-signal DC value of the signal going into the lowpass sections is all that is left after the lowpass filter strips off all of the audio.

The solution is to move he peak detector to be before an output lowpass filter.

Separate from that, your peak detector is half-wave. If you use another opamp as a full-wave precision rectifier, you will get a more accurate envelope shape out of the filter.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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