So I've built up a peak detector as part of a larger circuit, and have run into much lower performance than I expected. I'm using the basic design found in Dave's video on the topic, the middle image in this picture:
My opamps are both OPA1612s, my diode is a DA2S10400L, my capacitance is 50uF, the system is running a split supply of plus and minus 5V. The circuit finds the correct peak in the signal, but I'm using it at audio level frequencies, and when the frequency goes low enough, it simply does not hold the peak for as long as I would expect - below a couple hundred Hertz, it actually gets to zero between pulses, and that just doesn't seem right.
So I've taken a look at the reverse current on the diode (up to 500nA) and the bias current on the opamp (up to 250nA), but that up to .75 microamps I don't think should be able to drain the capacitor (measured charge of 2.5V at the peak) as quickly as it does - my ballpark math says it should take several seconds to fully discharge. I also know it's not my probe impedance (which should be in the same magnitude as the opamp bias current) because the circuit runs into a comparator and the comparator triggers at about the same spot when probing as when left alone.
Also interesting, while I've checked the diode on its own and it rectifies properly, when attached to the circuit, the "peak" charge on the capacitor goes slightly negative when the frequency of the input is low enough (400mV with a 2.5V peak), and from the best I can tell.... it just shouldn't be going negative even if it discharges. I also don't think the slew rate on the opamp is deficient because the risetime for the charge on the caps match the rise of the input signal.
Now I can easily switch in an opamp with a pA bias current and find a diode with much less leakage, but will that actually solve the problem? Do I need a lot more capacitance to just minimize it? Has anyone seen this strange negative voltage behavior in their peak detector? I feel like I've got several or several dozen microamps of leakage that I don't know where its going off to.