I am currently working in the simulation of a physics project. One of the detectors inputs a voltage V1:
and tries to extract the amplitude. I read that a simple Envelope detector can do the job. The problem is that in my system sometimes D takes really big values and then the detector fails and returns a wrong value. I have very little idea on how to use a circuit in which this doesn't happen, although I guess that a high pass filter before the source could solve the problem.
How do I stop by system from failing to detect and return the wrong value?