[sdiy] Simple circuit challenge: |a-b|

houshu at muj.biglobe.ne.jp houshu at muj.biglobe.ne.jp
Thu Mar 28 03:43:42 CET 2024

Hello Rutger and List,

Here is my solution.

|a-b| = Max(a,b) - min(a,b).

If output offset is acceptable, we can omit D5, D6, and R7.
Impedance of inputs should be low.  When one of inputs is open, output 
is a little distorted.

Kawasaki, Japan.

------ Original Message ------
差出人: "Rutger Vlek via Synth-diy" <synth-diy at synth-diy.org>
To: "SDIY List" <Synth-diy at synth-diy.org>
送信済み: 金曜日, 2024/3/22  04:50
件名: [sdiy] Simple circuit challenge: |a-b|

Dear list,

while hobbying on an experimental design, I'm looking for a simple 
analog circuit to give me the absolute value of the difference between 
two signals (mathematically written as |a-b|).

I already have a working circuit, but it's rather big for my needs. It 
uses an inverting opamp to invert signal A, followed by a bog-standard 
full wave precision rectifier circuit where -A and B are summed together 
and being rectified. The total is 3 opamps, 2 diodes and 9 resistors. As 
I need to repeat the circuit many times in the final application, I'm 
wondering: is there anything simpler that can do this?

- working across full audio range
- distortion as consequence of diode drops is no problem (might even be 

Many thanks for any suggestions!


  This is the Synth-diy mailing list
  Submit email to: Synth-diy at synth-diy.org
  View archive at: https://synth-diy.org/pipermail/synth-diy/ 
  Check your settings at: 
  Selling or trading? Use marketplace at synth-diy.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://synth-diy.org/pipermail/synth-diy/attachments/20240328/4631d7f1/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Abs(A-B)202403a.png
Type: image/png
Size: 56930 bytes
Desc: not available
URL: <http://synth-diy.org/pipermail/synth-diy/attachments/20240328/4631d7f1/attachment.png>

More information about the Synth-diy mailing list