# Gain and Phase Margin

Given an Amplifier with gain $$A(s)$$ and adding feedback $$B(s)$$ we find feedback gain $$A\_{f}=\frac{A(s)}{1+A(s)\*B(s)}$$ .

Consider the loop gain $$A(s)*B(s)$$ for $$B(s)=1$$ and $$A(s)=\frac{10^4}{(1+\frac{s}{10^6})*(1+\frac{s}{10^8})^2}$$ and its Bode plot:

![](/files/-Lui0KzP_mNH2YWwE3Oo)

We are really interested in points defined by $$\psi=-180^{\circ}$$ and $$|A(s)\*B(s)|=0dB$$ and define a measure of their closeness as the phase and gain margins.&#x20;

Notice that by varying $$B(s)$$ as a scalar we shift the gain plot up and down and thus adjust the gain and phase plots. For example if we want to decrease the phase margin to 45° we need to shift the gain plot down by 5dB. Therefore we set $$B(s)=\frac{1}{10^{0.5}}=0.316$$.&#x20;

The interpretation is...

|                   |                              |
| ----------------- | ---------------------------- |
| High Gain Margin  | Higher chance of instability |
| Low Gain Margin   | Lower chance of instability  |
| High Phase Margin | Higher chance of instability |
| Low Phase Margin  | Lower chance of instability  |

What I don't know -> do the signs of gain and phase margins matter? Also, what is this 20log(1/B) thing at the end of 301 slideset 20?


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.tylerqwong.me/electronics/amplifier-feedback-gain-and-phase-margin.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
