Article Antoine Falaize and Thomas Hélie. Passive guaranteed simulation of analog audio circuits: A port-hamiltonian approach. Applied Science, Applied Acoustics, special issue Audio Signal Processing, 2016. pdf bibtex

Comparison of numerical methods
In the paper, we propose a discret-gradient based numerical scheme to preserve the passivity property of port-Hamilotnian systems at time discretization. A detailed comparison of this method with classical ODE time-stepper with simulation code is available here.
Diode clipper


BJT audio amplifer

Circuit schematic

Output voltage: Simulation of the diode clipper for a linearly increasing sinusoidal input signal with LTSpice and PyPHS.

Output voltage (frequency domain): PyPHS simulation of the diode clipper for a sinusoidal input signal linearly increasing the frequency between 20Hz and 20kHZ.

Output voltage (frequency domain): LTSpice simulation of the diode clipper for a sinusoidal input signal linearly increasing the frequency between 20Hz and 20kHZ.
CryBaby wah pedal
Original short guitar sample
CryBaby output
The wah parameter (potentiometer coefficient) is continuously varying according to a sinusoid signal with DC offset 0.5, amplitude 1 and frequency 1Hz.