## Setting up a Digitally Tunable Resonator using the HF2LI

This article describes how to simulate a band pass filter or resonator using the HF2LI lock-in amplifier. The digitally tunable parameters make it very versatile and e.g. allow to use it for benchmarking a phase locked loop.

### Hardware Requirements

To model a resonator with a Zurich Instruments HF2LI a number of options, which are listed below, need to be enabled on the base instrument.

- Zurich Instruments HF2LI
- Zurich Instruments HF2LI-MF Multi Frequency Option
- Zurich Instruments HF2LI-PID Quad PID controller Option

### General idea

In principle, a lock-in amplifier is nothing but a band pass filter. However, base-band data is only displayed and not upconverted again.

But with the functionality of the HF2LI, its PID controllers and some creativity, one can easily perform this piece. Please have a look at the following block diagram that explains the necessary setup.

At this point the phase shifter at the input can be neglected. It allows to add an offset to the LPF’s phase transfer function if the filter is used to provide positive or negative feedback to a system.

There are three important parts in this diagram. The first is the quadrature input mixer that folds an input signal down to the base band (not necessarily DC) and results in an X and Y component. The second is the output mixer, which upconverts the base band signal again, resulting in the same signal at the output that is applied to the input – provided it passes the third part which is the low pass filter in between.

If the input frequency differs from the carrier (center) frequency too much, then X and Y will rotate very fast in the imaginary plane. As this rotation is restricted in frequency by the demodulator’s low pass filter, only a fraction of the input amplitude will pass through to the output. Therefore, the further away the input frequency from the chosen center, the higher the damping of the obtained band pass filter.

As the X and Y values are read and forwarded using the PID controllers which are limited to an update rate of about 75kS/s, the maximum bandwidth of the simulated BPF is restricted to about 10kHz. Any bandwidth below this maximum can be achieved by restricting the demodulation filters’ bandwidths.

### Transfer function plot

Sweeping the band pass filter center frequency by setting the reference signal accordingly.

Sweeping the band pass filter Q-factor by setting the demodulator filter bandwidth accordingly.

Sweepint the band pass filter Q-factor by setting the demodulator filter order accordingly.

### Filter Mathematics

The band pass filter described here is based on a cascade of first order low pass filters which have a tranfer bahavior that can be described with the following formulas:

The mixers shift this filter behavior up to the filter’s center frequency. Therefore,

The maximum phase shift for a first order band pass filter will be

to either side with a zero phase shift at the center frequency.

For a higher order filter, the transfer function has to be taken to its power and the phase shift has to be multiplied.

The Q-factor of a resonator can generally be determined using the derivative of its phase curve.

As two PID controllers with a finite sampling rate of about 75 kHz are used to forward the X and Y amplitudes to the output mixer, an additional phase shift of

has to be taken into account.

Now, the Q-factor of the resulting band pass filter is defined by the phase slope at its center frequency (point of highest slope)

finally leading to a Q-factor of

Here, tau is the low pass filter time constant of a single stage.

Alternatively, for a first order LPF, the following well-known formula can also be applied:

The characteristic frequency of the filter is equivalent to the low pass filter bandwidth:

### Some performance specifications

- Frequency range of Resonance: 3mHz to 50MHz
- Filter Bandwidth = 0.6mHz up to about 10kHz, limited by the PID update rate of about 75kS/s
- PID update rate also results in a minimum phase slope of 5°/kHz due to delays
- Minimal Q-Factor is about 10, physically limited due to the need of omega / two omega suppression
- Maximal Q-Factor is about 730e9 @ 50MHz, about 15e6 at 1kHz. Limited by maximum integration time constant of 583s.

The bandwidth limitation due to the PID sampling rate can be seen in the following graph, where some distortions at half the sampling rate (Nyquist) are highlighted.

### Downloads

- The file BPF.zicfg can be used to quickly set up a band pass filter. By changing the frequency, bandwidth and order for demodulator 1, the filter characteristics can be altered.

### Sources

Low pass filter mathematics PDF

### Acknowledgements

I’d like to acknowledge the contribution of Dragan Lesic for the block diagram.