What is Phase Margin formula ? Here I have waveform, with instructions I am getting Phase margin 55degree Is there any formula that I put in ngspice and get directly Phase margin.
s
Stefan Schippers
08/10/2023, 7:44 AM
I don't know if there is a direct instruction, however you can extract the phase margin with a
.meas
instruction, that is, the value of the phase when modulus of gain is equal to 1. see the ngspice manual for the
.meas
instruction.
l
Luis Henrique Rodovalho
08/10/2023, 7:52 AM
Copy code
.control
let av = db(vref1)
let ph = cphase(v(ref1))*180/3.14
meas ac gbw when av=0
meas ac pm find ph at=gbw
.endc
Linen is a search-engine friendly community platform. We offer integrations with existing Slack/Discord communities and make those conversations Google-searchable.