- Analog modeling of a diode clipper (1): Circuits
- Analog modeling of a diode clipper (2): Discretization
- Analog modeling of a diode clipper (3a): Simulation
- Analog modeling of a diode clipper (3b): Simulation
- Analog modeling of a diode clipper (4): State-space
Let’s dive directly inside the second diode clipper and follow exactly the same pattern.
Second diode clipper
So first let’s remember the equation:
Forward Euler
The forward Euler approximation is then:
Backward Euler
Backward Euler approximation is now:
(The equations are definitely easier to derive…)
Trapezoidal rule
And finally trapezoidal rule gives:
Starting estimates
For the estimates, we use exactly the same methods as the previous clipper, so I won’t recall them.
Graphs
Let’s start with the comparison of the three different methods:

The first obvious change is that the forward Euler can give pretty good results. This makes me think I may have made a mistake in the previous circuit, but as I had to derive the equation before doing the approximation, this may be the reason.
For the original estimates, just like last time, the results are identical:

OK, let’s compare the result of the first iteration with different original estimates:
All estimates give a similar result, but the affine estimates give a better estimate than linear which gives a far better result than the default/copying estimate.
Conclusion
Just for fun, let’s display the difference between the two clippers:

Obviously, the second clipper is more symmetric than the first one and thus will create less harmonics (which is confirmed by a spectrogram), and this is also easier to optimize (the second clipper uses at least one less iteration than the first one).
All things considered, the Newton Raphson algorithm is always efficient, with around 3 or less iterations for these circuits. Trying bisection or something else may not be that interesting, except if you are heavily using SIMD instructions. In this case, the optimization may be faster because you have a similar number of iterations.
Original estimates done with the last optimized value always works great although affine estimates are usually faster. The tricky part is deriving the equation. And more often than not, you make mistakes when implementing them!
Next step: DK method…