tomcl / ADDIE

GNU General Public License v3.0
1 stars 3 forks source link

Higher Precision Frequency Response #9

Open apantelopoulos opened 1 year ago

apantelopoulos commented 1 year ago

Frequency Response currently works by calculating the magnitude and phase at 20 points per decade (equally spaced in the log axis) starting from $\omega=1$ up to $\omega=10^7$. This covers all the common scenarios and offers relatively good precision.

However, the following two improvements would significantly improve the frequency response offered by ADDIE:

Explanations:

  1. Phase remains constant in the regions far from the corner frequencies, and changes abruptly near them. This is a characteristic that can be exploited for the purposes of AC Analysis, in order to apply an adaptive step size, instead of a constant one (20 points per decade). Specifically, the algorithm will start again from 1 rad/s with the existing step size (20 points per decade), and then when a change of more than $1^\circ$ is detected between the two previous frequency points, the step size will become 2-10 times smaller (depending on the precision needs). Of course, in order to be able to detect the end of the region of interest, the specified difference between two points that the algorithm looks for will have to be reduced an equal amount of times (2-10). Then, when the difference between the last two points is larger than the updated difference, the step size will be set back to 20 points per decade.
  2. Large corner frequencies ($\omega>10^7$) would not be depicted using the current algorithm. Also, if a circuit has only one corner frequency at $\omega=10^6$, seeing the constant magnitude and phase for small frequencies $\omega<10^3$ does not provide any useful information.