@QuanHu I’ll answer your question about modeling a diode clipper here.
You can either use:
- Ordinary Differential Equations. I’ve sent you this link to David Yeh’s dissertation before I think. This is the most accurate. But it most likely uses more processing power.
- A lookup table. Depending on how much gain you’re circuit has you need a larger table.
- A hyperbolic tangent function or hyperbolic tangent approximation. David Yeh’s dissertation also explains this.
I chose for a hyperbolic tangent approximation and tried to align the shape and frequency response with the lookup table implementation as much as possible. The output gain is also based on the lookup table. I halved that gain because it sounded better. I don’t know exactly how to convert amplitude to voltage and vice versa. Levels depend highly on how much pre-amp gain you apply in the first place.