# Op amp introduces phase shift at high audio frequencies

Context: I am trying to design a solid-state microphone preamp using dedicated audio op amps (ex: API 2520).

Goals:

• flat ≈60-66dB of gain from 20Hz to 20Khz
• Limit changes in phase shift as much as possible as the frequency varies (ideally within +/- 5 degrees).

Setup: I am currently experimenting with classic non-inverting closed loop op amp designs: Output feeds back to the negative input of the op amp using a voltage divider to adjust gain (with a capacitor in parallel of the first resistor to reduce parasitic oscillations).

See https://www.electronics-tutorials.ws/opamp/opamp_3.html for diagram with notations.

Ex: values for the gain-setting voltage divider: Rf: 10KΩ, R2: 10Ω or Rf: 100KΩ, R2: 100Ω.

I have a good oscilloscope which can produce frequency / gain-phase response diagrams by scanning a frequency range and measuring the gain and phase shift at a set number of points in the frequency range (ex: 100 points).

Problem: There is little phase shift (+/5 degrees) at "low" gains (<40-50dB) - this is good. However, when the gain is set to a "high" value (ex: 60dB or more), the deviation to linear phase increases to unacceptable values between 10kHz and 20kHz (ex: 20+ degrees @ 20kHz).

The issue increases as the gain increases (ex: 66dB) and is also present when the capacitor in parallel with the first resistor (Rf) of the feedback voltage divider is removed entirely.

This bad as it will introduce distortion for signals where high frequencies are important (ex: cymbals, pianos, woods, etc...)

I am operating under the assumption that the op amps are good since the API 2520 is a professional audio classic and I was able to reproduce the issue with different op amps (2 original API 2520, and 4 "good copies").

Questions:

• Am I missing something in my design or this part of typical op amp limitations / imperfections? (Apparently John hardy gets to +/-2 degrees of phase deviation by using servos: http://www.johnhardyco.com/M-1details.html, I don't mean to do as good as a real professional and more elaborate product but I would like to explore simple ways to mitigate this phenomenon).
• If this is classic problem? If yes, what are the typical approaches to address this issue?

Thanks!

--

Edit: based on popular demand, I am adding 6 pictures of the scope at Gain=0, 40 and 60dB for frequency ranges 20Hz-20MHz and 20Hz-20KHz. • It would be helpful if you could post an example of the phase and magnitude plots that your oscilloscope is giving you. What's the -3dB point of your amplifier? You're bound to see some phase shift as you approach the dominant pole of the circuit, so if that's too low, you'll have to consider reducing gain per stage, reducing the compensation cap, or choosing a different amplifier. Jul 1 at 0:35
• Note that the 2° phase deviation is from an ideal linear phase curve, not absolute. This indicates he is using something like a Bessel low-pass filter which provides a flat group delay response which is what you are after.
– qrk
Jul 1 at 1:32
• The closed loop phase lag will have reached -45 degrees at the closed loop -3dB frequency. To increase the closed loop -3dB frequency either reduce the closed loop gain or use an amplifier with a higher GBW. Jul 1 at 8:10
• ...... another way of increasing the closed loop bandwidth (increasing the frequency at which the closed loop lag reaches -45 degrees) is to use an uncompensated amplifier. You can use a lower value compensation capacitor as long as you maintain stability by using a higher closed loop gain. The lower value compensation capacitor will increase the bandwidth of the amplifier and reduce the closed loop phase lag at each frequency. Jul 1 at 9:44
• Note that 20 degrees delay at 20kHz corresponds to moving the microphone away from the source by ... 0.833mm. A phase shift is not a nonlinearity and CANNOT introduce total harmonic distortion. To be a classic problem, this would first have to be a problem. (Note however that an opamp running out of gain at HF CAN introduce distortion due to reduction in NFB, if there is too much distortion in open loop. I think you are worrying about the wrong thing here) Jul 1 at 12:01

I haven't found a real data sheet on this part, and judging from the gain BW product (using mHz for MHz), I suspect this is an audiophool part. Without going in to too much detail, higher gains will mean that you will get more phase shift at 20kHz as can be seen from the simulation of some random opamp that has a GBW of 80MHz (close to the GBW of the 2520). The simulation is for three different gain settings, apx 20, 40, & 60dB. You'll notice the phase at 20kHz is closer to zero when the gain is less. Question, will you hear the group delay difference of 100ns for your 60dB gain preamp? Probably not.

If you really want this much gain and have minimal phase shift, you need to cascade two gain stages, perhaps 30dB + 30 dB. Try using something like the NE5534 (10MHz GBW) opamp (around USD 1.30 each) and see if this will meet your requirements.

As for harmonic distortion, you will get more because you are sacrificing less gain (difference between open loop gain and closed loop gain), not because of the phase shift. Gain, Phase, group delay plot from LTspice for three different gain settings. Plots are separated to make it easier to read. Schematic from LTspice.

For the simple non-inverting gain stage: simulate this circuit – Schematic created using CircuitLab

Ideally the voltage gain is: $$A_{v0} = (1+R_2/R_1)$$

If the op-amp has a unity gain frequency of $$\\omega_0\$$, then under the assumption that the op amp gain is falling off under a single dominant pole, then the voltage gain becomes:

$$A_v = \frac{A_{v0}}{1+j\frac{\omega A_{v0}}{\omega_0}}$$

so there is a pole introduced at $$\\frac{\omega_0}{A_{v0}}\$$

The datasheet I found for your op amp shows a GBW of 50MHz, so that would mean that your 60dB gain stage has a pole at 50kHz, which gives you a phase shift of $$\\tan^{-1}(20/50) = 21.8^\circ \$$, roughly what you have measured.

As others have said, you can solve this by cascading two lower gain stages, or you could try to compensate by placing a capacitor across R1, but this may have other undesired consequences.

I have added some scope screenshots.

@qrk's answer is right: the 50MHz GBW of the op amp explains everything. I was expecting that the phase and gain would be impacted simultaneously at higher frequencies (not to have the phase impacted, then the gain impacted as frequency increases).

Note: I had been trying with 2 cascaded op amps @30dB each, I got ≈ 15deg @20KHz - looks like it is as good as it's going to get without invoking witchcraft :D

I also like @user_1818839 comment about moving the mic, indeed the change in phase between low and high frequency would not be the same since they do not have the same wavelength -- I had not considered that.

Now on to getting rid of parasitic oscillations and the output offset - I might post other questions for these topics.

Thanks again!

• To get 15deg at 20kHz from two op amps with 30dB each suggests that these op amps had a GBW of only 5MHz. If you used two 50MHz GBW op amps for the two 30dB stages then you should have a phase shift of around 2 deg. Jul 2 at 5:56
• Agreed, I am not sure why that is since one op amp at 40dB gives about 4 deg @20kHz (as seen on the scope screenshot). I will have to keep debugging this. Jul 2 at 6:38