As I was writing this, it became very long. So, to give you a preview, I’m going to ask three questions.
Many years ago (10+?), I developed a circuit to synchronize an animatronic’s mouth movement with an audio track. Being active in the Halloween industry at the time, I was aware of a popular circuit used for this purpose.
However, it only had two positions - mouth open & mouth closed.
Starting with that circuit and researching envelope followers, I developed my own that could move the mouth full range. I used one channel of a stereo signal and with an op amp shifted the ±1.2V audio to the full range of the LT1013 (~0-4.4V). This was fed to an ADC and the servo function used the value to move the mouth. I added an audio amplifier on the PCB and called it an AAEF - Amplifier & Audio Envelope Follower. An article describing it is on AAC in the Completed Projects sub-forum. This schematic doesn't match exactly. but was re-created to compare simulations.
It’s worked well for all this time. But, I am upgrading my signature animatronic - Peter Penguin. Adafruit's servo shield includes protyping space. And their SD/MP3 board has a 3W amplifier, with both speakeer and line out. I plan on moving the AAEF to the prototyping area, freeing up space and cabling inside the animateronic. One thing that bothered me, with the original solution, was that I had to delay the audio track, to the amplifier, by 0.3 seconds. The audio signal processing and envelope follower introduced that delay, so the mouth lagged the sound. Adding the delay to one track was not difficult to do, but I didn’t know why it was necessary.
Take a look at the waveforms in the graphs below. There are three plots; the input waveform, the op amp input and the output. The 0.3s delay in the source was added with Audacity to compensate for the circuit delay.

I posted the question regarding the source of the delay on another forum, thinking it was induced by the RC of the envelope follower, but my rough calculations didn’t jive with this theory Eventually, it was brought to my attention that the RC on the input to the op amp was the source of the delay and calculations confirmed this to be true.
The same people on the forum pointed out that the circuit would not work. This puzzled me because for my application, it’s been working very well for ten years. The main issue they had was that I was applying the negative part of the audio signal to the input of a single supply op amp. In other words, I was -1.2V below the ground rail of the op amp. I think it’s the LT1013 that let me do this because it has 400Ω in series with its inputs, but thats a guess I cannot confirm. All I can say was it worked fine despite the claims it would fail. Many assured me that I’d need to add a precision rectifier circuit. Others said the distortion would be unacceptable. I think both are wrong.
But single supply was a hard constraint. The entire system runs on 5V and adding a negative supply for just one chip didn’t make sense to me. And the distortion was inconsequential. If I needed 0.01V or even 0.004V accuracy, then I’d consider something else. But I’m looking for is at most accuracy to 0.5V.
However, the input range did concern me. I’d long thought that the diode in the output was unnecessary. And I wasn’t convinced that the huge resistor on the input also was unnecessary. So I experimented with LTSpice. I moved the Schottky diode to ground from the input and replaced the 1MΩ resistor with a 20Ω (the codec's datasheet says the load should be 10Ω-30Ω), so that the negative audio doesn't look like a direct short to the codec during the negative cycles. Later, simulation results convinced me to try and add the diode back in series with the op amp output. It improved the operation significantly. Most simple envelope followers I had seen have this diode, but I was learning. I also re-calculated the feedback resistors as the op amp input was lowered by the Schottky diode in series by 0.2V. I ended up with the modified circuit below.
And here is the LTSpice simulation results.
Note the output is very close to the original circuit. I would say that it’s acceptable. The initial envelope drop is less pronounced, but still falls within a 0.5V to 1V. It basically looks so good, that instead of controlling the servo based on discrete voltage levels, that I'm considering creating a different mapping function and driving the mouth servo based on the results of the function. Instead of using a discrete table of steps.. Also note that the input to the op amp stays positive. An earlier version of AAEF v2 actually went below ground by 0.2V - a diode drop.
You can see what I am referring to with regards to the band around the envelope. Look at 1.8s in the above plot. The signal oscillates from 0.322V to 0.644V. I experimented with various values for the R and C on the output. The specified values are acceptable. But I wish I knew how to calculate optimal values. Optimal would closely follow the envelope of the original signal while minimizing the magnitude of this band. During my simulations, I got values that minimized the band while distorting the envelope shape. Or more closely matched the envelope (specifically the rise and fall), but whose “band” width was unacceptable. Or the band width was acceptable but the rise and fall times of the envelope was grossly distorted. My question arises because I didn't know ho to calculate optimal values and resorted to running a simulation with the existing resistor value and ±90% and the existing capacitor value and ±90%... This gave me a 3x3 grid and I recorded the slope of the rise and fall for the large amplitudes, as well as the "width of the band" at 1.8s. From there, I picked the values you see in my schematic. For better comparison, I also modified AAEF v1 with the final values I selected.
Any help or comments will graciously be accepted.
Thanks, dj
- Is 0.2V below ground going to be accepted by the single supply op amp? I think so... (but last minute modifications obviated this as a concern)
- At many points in the output waveform, the output cuts a narrow band, with a swing of ~0.2V. Adjusting the resistor/capacitor on the output changes the width of this band. How can I calculate the expected width and how do I optimize the values?
- I just printed out a datasheet for an LMC6081IM... At first glance, it looks like its an improvement over the LT1013. Of course, I have to download the Spice model... How do I find other op amps that may perform better than the LT1013?
Many years ago (10+?), I developed a circuit to synchronize an animatronic’s mouth movement with an audio track. Being active in the Halloween industry at the time, I was aware of a popular circuit used for this purpose.
However, it only had two positions - mouth open & mouth closed.
Starting with that circuit and researching envelope followers, I developed my own that could move the mouth full range. I used one channel of a stereo signal and with an op amp shifted the ±1.2V audio to the full range of the LT1013 (~0-4.4V). This was fed to an ADC and the servo function used the value to move the mouth. I added an audio amplifier on the PCB and called it an AAEF - Amplifier & Audio Envelope Follower. An article describing it is on AAC in the Completed Projects sub-forum. This schematic doesn't match exactly. but was re-created to compare simulations.
It’s worked well for all this time. But, I am upgrading my signature animatronic - Peter Penguin. Adafruit's servo shield includes protyping space. And their SD/MP3 board has a 3W amplifier, with both speakeer and line out. I plan on moving the AAEF to the prototyping area, freeing up space and cabling inside the animateronic. One thing that bothered me, with the original solution, was that I had to delay the audio track, to the amplifier, by 0.3 seconds. The audio signal processing and envelope follower introduced that delay, so the mouth lagged the sound. Adding the delay to one track was not difficult to do, but I didn’t know why it was necessary.
Take a look at the waveforms in the graphs below. There are three plots; the input waveform, the op amp input and the output. The 0.3s delay in the source was added with Audacity to compensate for the circuit delay.

I posted the question regarding the source of the delay on another forum, thinking it was induced by the RC of the envelope follower, but my rough calculations didn’t jive with this theory Eventually, it was brought to my attention that the RC on the input to the op amp was the source of the delay and calculations confirmed this to be true.
The same people on the forum pointed out that the circuit would not work. This puzzled me because for my application, it’s been working very well for ten years. The main issue they had was that I was applying the negative part of the audio signal to the input of a single supply op amp. In other words, I was -1.2V below the ground rail of the op amp. I think it’s the LT1013 that let me do this because it has 400Ω in series with its inputs, but thats a guess I cannot confirm. All I can say was it worked fine despite the claims it would fail. Many assured me that I’d need to add a precision rectifier circuit. Others said the distortion would be unacceptable. I think both are wrong.
But single supply was a hard constraint. The entire system runs on 5V and adding a negative supply for just one chip didn’t make sense to me. And the distortion was inconsequential. If I needed 0.01V or even 0.004V accuracy, then I’d consider something else. But I’m looking for is at most accuracy to 0.5V.
However, the input range did concern me. I’d long thought that the diode in the output was unnecessary. And I wasn’t convinced that the huge resistor on the input also was unnecessary. So I experimented with LTSpice. I moved the Schottky diode to ground from the input and replaced the 1MΩ resistor with a 20Ω (the codec's datasheet says the load should be 10Ω-30Ω), so that the negative audio doesn't look like a direct short to the codec during the negative cycles. Later, simulation results convinced me to try and add the diode back in series with the op amp output. It improved the operation significantly. Most simple envelope followers I had seen have this diode, but I was learning. I also re-calculated the feedback resistors as the op amp input was lowered by the Schottky diode in series by 0.2V. I ended up with the modified circuit below.
And here is the LTSpice simulation results.
Note the output is very close to the original circuit. I would say that it’s acceptable. The initial envelope drop is less pronounced, but still falls within a 0.5V to 1V. It basically looks so good, that instead of controlling the servo based on discrete voltage levels, that I'm considering creating a different mapping function and driving the mouth servo based on the results of the function. Instead of using a discrete table of steps.. Also note that the input to the op amp stays positive. An earlier version of AAEF v2 actually went below ground by 0.2V - a diode drop.
You can see what I am referring to with regards to the band around the envelope. Look at 1.8s in the above plot. The signal oscillates from 0.322V to 0.644V. I experimented with various values for the R and C on the output. The specified values are acceptable. But I wish I knew how to calculate optimal values. Optimal would closely follow the envelope of the original signal while minimizing the magnitude of this band. During my simulations, I got values that minimized the band while distorting the envelope shape. Or more closely matched the envelope (specifically the rise and fall), but whose “band” width was unacceptable. Or the band width was acceptable but the rise and fall times of the envelope was grossly distorted. My question arises because I didn't know ho to calculate optimal values and resorted to running a simulation with the existing resistor value and ±90% and the existing capacitor value and ±90%... This gave me a 3x3 grid and I recorded the slope of the rise and fall for the large amplitudes, as well as the "width of the band" at 1.8s. From there, I picked the values you see in my schematic. For better comparison, I also modified AAEF v1 with the final values I selected.
Any help or comments will graciously be accepted.
Thanks, dj