I'd like to graph S21 phase in degrees after doing a linear analysis, but I'd like to subtract out a linear best fit to show deviation from linear phase.

For bonus points, I'd like the best fit to be performed on a subset of the frequency span. So if my total analysis is from 40MHz to 80MHz, the fit should be done from 52MHz to 68MHz.

This is similar to adjusting the electrical delay reference on the HP8753ES while displaying phase.

I imagine there's an equation involved, but I can't figure it out. And nothing obvious is popping out at me. I'm surprised this isn't a FAQ.

TIA

For bonus points, I'd like the best fit to be performed on a subset of the frequency span. So if my total analysis is from 40MHz to 80MHz, the fit should be done from 52MHz to 68MHz.

This is similar to adjusting the electrical delay reference on the HP8753ES while displaying phase.

I imagine there's an equation involved, but I can't figure it out. And nothing obvious is popping out at me. I'm surprised this isn't a FAQ.

TIA

Youy will find tuning the length is easy. But optimization of the line length may be combined with other optimization goals and the frequency limits within the optimization goals window may be used to your hearts content.

It is fun to watch what happens as the negative line length is tuned to rotate out the excess phase.

Clear skies and high Q