- 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
Update: It seems I have misunderstood the DK method, so instead I’m using a variation of the Nodal Analysis, so this can be understood as a state-space MNA method.
When analyzing a circuit form scratch, we need to replace all capacitors by an equivalent circuit and solve the equation with this modified circuit. Then, the equivalent currents need to be updated with the proper formula.
What does the formula mean?
So this is the update formula:
Let’s write it differently:
If we consider as being a difference, then this is a derivative with a trapezoidal approximation. In conjunction to the original equation, this means that we have a system of several equations that are staggered. Actually has not the same time constraints than , it lags it by half a sample.
On the one hand, there are several reasons why this is good. Staggered systems are easier to write, and also if the conditions are respected, they are more accurate. For instance, for wave equations, using central difference instead of the staggered system leads to HF instabilities.
The issues on the other hand are that we do a linear update. If this is fine for the SD1 circuit, it is not the same for the two clippers here, as the amount of current in the condensator is a function of the diode function (not the case of the SD1 circuit, as only the input voltage impacts it). But, still, it’s a good approximation.
Usage on the clippers
OK, let’s see how to apply this on the first clipper:
The time dependency is kept inside , and we don’t need the rest like for the trapezoidal rule:
Quite obvious it is simpler! But actually the update rule is a little bit more complicated:
Actually,a s we computed all the intermediate values, this comes at a cost of a few additions and multiplications, so it’s good.
Let’s try the second clipper:
And in this case, the update formula is simple, as the tension on the condensator is the output voltage:
Once again, the dependency is hidden inside which means simpler and also faster optimization.
Using the equivalent currents transformation is actually really easy to implement and it allows to simplify the function to optimize. It doesn’t change the function itself compared to the trapezoidal rule, because they are actually (in my opinion, I have done the actual math) two sides of the same coin.
I’ve applied this to the SD1 filter. The simplification in the equation also leads to an improvement in the computation time, but for low sampling rates the filter does not converge. But the higher the sampling rate, the better the improvement over the traditional trapezoidal rule.