Contents

On this page, we explain the details and implementation of the PisaProject function. This method of functional projection to perform stability analysis is the foundation of the pisa toolbox.

The concept is simple: to determine the stability of a system, project its frequency response on a basis of stable and unstable functions. when a significant part if projected onto the unstable basis functions, we have detected an instability.

Here, we consider the abstract notion of frequency response of a system. In the stability analysis of a circuit, this frequency response is either the impedance or admittance presented by the circuit to a small-signal excitation source. More information about the simulation set-up required to determine such frequency response can be found on the page on closed loop stability analysis.

If you want to see the functional projection technique applied to several examples, go to the examples page.

## Theory

We are given a frequency response matrix of a system with outputs and inputs on a discrete set of frequencies . We assume that , which means that we can write as the sum of a function in the Hardy space (the stable part) and its orthogonal complement (the unstable part):

Computing the stable and unstable parts of a given frequency response is done by projecting onto the basis of and respectively:

In our algorithm, we map the frequency axis to the unit circle such that the complex right half-plane is mapped to the inside of the circle. After this mapping, with forms a basis for and with forms a basis for . The projection is therefore performed by computing the Fourier coefficients of our function on the unit circle.

On the unit circle, computing the projection boils down to computing the Fourier coefficients.

The simulated frequency response is only known for frequencies below . Above that frequency, we assume that the frequency response is zero. This sudden jump to zero at will have a strong unwanted inﬂuence on the obtained stable and unstable part. To suppress this inﬂuence, the frequency response is multiplied by a low-pass filter with its stop-band starting at .

### Algorithm steps

We can summarise the projection algorithm in the following steps:

- Perform a frequency normalisation on
- Transform to the unit circle
- Multiply by a filtering function
- Compute the Fourier coefficients of
- Compute the stable and unstable parts by constructing the functions made of positive and negative Fourier coefficients respectively:

- Transform and back to the complex plane
- Perform a frequency denormalisation of and

### Frequency normalisation

Internally, the data frequency response data is mapped to the frequency interval for ease-of-computation. We provide two different ways to perform this mapping:

In a **Bandpass normalisation**, we start with data on a frequency interval and map and . The data outside of the interval is assumed to be zero, so using a bandpass normalisation will cause the system to be non-hermitian .

When a **Lowpass normalisation** is used, we map and . In the lowpass case, the system is assumed to be Hermitian, so the data for the negative frequencies is taken to be the complex conjugate from the data at the positive frequencies. Lowpass normalisation is best used when you know the frequency response for . Otherwise, the method will perform an interpolation between and to estimate the value at zero. This interpolation can introduce a large error in some cases, you should use a bandpass normalisation then.

### Mapping to the unit circle

After the frequency normalisation, we are ready to transform the data to the unit circle. To this end, we use Mobius transform.

where is chosen such that the following mapping happens in the transform:

The complex right half-plane is mapped to the inside of the unit circle. We can visualise the transform like this:

### Filtering to suppress edge effects

After frequency normalisation and mapping to the unit circle, we know the frequency response on the interval . Outside this interval, we don’t have any data, so we assume it is zero there. This sudden ending of the data will show up in the unstable part, so its influence needs to be suppressed. We do this by multiplying the data by a filtering function :

We then compute the projection of instead of . This filtering will suppress unstable poles close to the interval boundary. It is therefore recommended to simulate the frequency response of the system on a very wide band to minimise the influence of the filtering on the projection result.

The filter we use is a FIR filter:

Because it only consists of positive Fourier coefficients, is stable. Its influence will therefore mainly be visible in the stable part of the projection. The only influence the filter has on the unstable poles it that their residues are modified.

The coefficients of the filtering function are precomputed such that the out-of-band suppresion is maximised, for a fixed in-band ripple and transition region. Also, the filtering function is designed to have no zeros inside of the unit disc. That way, they cannot accidentally coincide with an unstable pole. To enforce smoothness in the derivative of the data at the edge of the interval, Two transmission zeros are placed at .

The default filter we use in PisaProject has order , a transistion region of 10% of the data interval and has an in-band ripple of 0.02:

### Computing the Fourier coefficients

We provide two different options to compute the Fourier coefficients of the filtered impedance function. The first computes the classic Fourier integral:

using standard numeric integration techniques. The second option uses the Fast Fourier Transform (FFT) to perform the computation.

The number of Fourier coefficients should be large enough to capture the dynamics in the frequency response function. When a sharp resonance is present in the data, a high amount of Fourier coefficients is needed to capture this resonance.

As a small example, consider the unstable resonance shown below:

On the left, we used too little Fourier coefficients, which shows oscillations in the stable part around the unstable resonance. When we increase the amount of Fourier coefficients (shown on the right), these resonances disappear.

Choosing the correct amount of Fourier coefficients is not so difficult: more is always better. Performing a trade-off between computation time and accuracy is a little bit more difficult and depends on the data.

### Interpolation

Both techniques integration techniques (quadrature and FFT) require to interpolate the function values on the unit circle. We either use a simple linear interpolation method, or a rational interpolation method.

Linear interpolation is the easiest to use and to understand. It should be used when the data is noisy because it does not impose continuous derivatives. When the data contains strong resonances, linear interpolation will perform poorly. This is why we also offer a rational interpolation method. The rational interpolation ensures a continuous first derivative, so it can only be used on noise-free data.

In the rational interpolation scheme, we use a rational interpolation function with two zeros and one pole:

where , , and are determined using the constraints:

The ﬁnal constraint ensures that the interpolated function has a continuous ﬁrst derivative at the interpolation points.

### Estimating the interpolation error

The interpolation introduces both stable and unstable artefacts into the projection method. To estimate the size of these artefacts, we compute an estimate of the interpolation error. The level of this interpolation error can be estimated by interpolating the frequency response using only the data at the even data points. The difference between the original and the interpolated data for the odd data points will give an indication of the interpolation error encountered in the stability analysis.

### Interpreting the result

Once the projection has been computed and the impedance function has been split into two parts, we can interpret the results to determine whether the circuit is stable or not. As an example, we show the analysis results for an MMIC power amplifier where a stabilisation resistor is tuned to guarantee circuit stability:

In the plot on the left, the unstable part shows a nice resonance around 10GHz, which indicates an instability. Comparing the size of the obtained unstable part to the level of the interpolation error allows us to affirm that the obtained unstable part is correctly computed and did not arise due to interpolation errors.

In the plot on the right, the unstable part is a lot smaller and more noisy than before. When we compare the unstable part to the interpolation error, we notice that they are both of similar magnitude. This allows us to conclude that the obtained unstable part is due to interpolation errors and not due to an instability in the circuit.

To see more examples on how a result of projection is interpreted, have a look at our different examples.

## Implementation

The projection algorithm described above is implemented in the *PisaProject* function. Before calling that function, we need to store the circuit impedance data in an FRM object:

Z = FRM(data,'Freq',freq); |

where *data* is an array which contains the circuit impedance function(s). and *freq* is the frequency vector of the data (of length ).

When the data is gathered in the FRM object, we can pass it to the *PisaProject* function:

PROJ = PisaProject(Z); |

The result is a matlab struct with the following fields:

*stable*: FRM which contains*unstable*: FRM which contains*coeffs_stable*: Positive Fourier coefficients (array of size )*coeffs_unstable*: Negative Fourier coefficients (array of size )*InterpErr*: FRM which contains the estimated interpolation error made during the projection

### Setting the normalisation

The frequency normalisation in pisa is a property of the FRM object.

Z = FRM(data,'Freq',freq,'Normalisation',LowpassNormalisation(freq)); PROJ = PisaProject(Z); |

### Setting the interpolation

The interpolation scheme used in the computation of the Fourier coefficients is controlled by setting the “Interpolation” parameter in PisaProject:

PROJ = PisaProject(Z,'Interpolation',RationalInterpolation); |

Where the provided interpolation is an object which implements the abstract *Interpolation* class. We implemented two different interpolation methods: RationalInterpolation and LinearInterpolation. The default is linear interpolation, because of its speed and robustness.

Linear interpolation performs poorly when sharp resonances are present in the frequency response, a lot of samples are needed inside of the resonance to prevent the interpolation error to become too big. Linear interpolation should be used when the data is noisy because it does not impose a continuous derivative.

The rational interpolation method is perfectly suited for noiseless data with resonances. It is however slower than linear interpolation and it can encounter numerical issues for data which is constant or linear.

### Computation of the Fourier coefficients

PisaProject can compute the Fourier coefficients in two different ways: By Fast Fourier Transform, or by quadrature integration. This is controlled by the “Integration” parameter for PisaProject:

PROJ = PisaProject(Z,'Integration','FFT'); |

The default is to use the FFT because of its speed. It can however introduce aliasing, but it is the best way to compute a large amount of Fourier coefficients. When only a small amount of Fourier coefficients is needed, it is better to use the quadrature integration.

Besides the computation style, one can control the number of Fourier coefficients by setting the “numberOfCoefficients” parameter in PisaProject:

PROJ = PisaProject(Z,'numberOfCoefficients',1e6); |

When the FFT is used to compute the Fourier coefficients, setting this parameter correctly is important to avoid aliasing. When the data contains very sharp resonances, a high amount of Fourier coefficients will be needed to avoid this aliasing.

## References

A. Cooman, F. Seyfert, M. Olivi, S. Chevillard, and L. Baratchart, “Model-free closed-loop stability analysis: a linear functional approach” IEEE transactions on microwave theory and techniques, vol. 66, no. 1, pp. 73-80, 2018.