# Signal demodulation

Demodulation refers to the extraction of information from a carrier wave. The extracted information is either digital or analog in nature. For example, Wifi transmits digital information on 2.4GHz and 5GHz frequencies, while a typical FM radio transmits analog signals in the form of sound at carrier frequencies between 80-100MHz.

In the case of Anser EMT, the carrier signals are those transmitted by the eight field emitter coils in the field generator. The extracted information are the magnitudes of each of the received frequency components. The sensor coil detects these carrier frequencies as described in section (5b) and produces a composite signal representing the sum of the received carrier frequencies. Following amplification and sampling, the magnitudes of these carrier signals are extracted using asynchronous demodulation techniques. The position and orientation algorithm compares these magnitudes with the system magnetic field model in order resolve a unique sensor position and orientation.

## Contents

## Demodulation theory

Two modulation schemes are discussed in this section, synchronous and asynchronous methods are discussed. Asynchronous demodulation is the chosen scheme as it provides more information regarding the orientation of the sensor.

In order to calculate the amplitude of the AC magnetic field experienced by the sensor many techniques are available. Generally, the signals of interest are small in amplitude with relatively large noise levels as well as interference from the other transmitting channels. The most common method to extract the signals of this type is synchronous demodulation, also known as synchronous detection or lock-in amplification

### Synchronous demodulation

Synchronous demodulation is a method for extracting information from an AC carrier signal. Although asynchronous demodulation is used in Anser, synchronous demodulation illustrates basic concepts that are used in the asynchronous design.

The amplitude and phase of an AC signal can be calculated through multiplication by a reference signal that is locked in frequency with the original signal. The multiplication by the reference signal, shifts the signal down to a lower frequency, typically DC, which is then easier to accurately measure. The "locking" of frequencies can be implemented in many ways although the simplest is to use the source of the signal as a reference.

Consider an input signal:

where is the modulating signal we wish to extract. The amplitude and phase of this signal can be determined by multiplying by two reference signals at the same frequency:

This multiplication result in two quadrature signals:

The DC component of the signal is extracted by using an appropriate low-pass filter. The resulting DC values are:

The amplitude of the modulating signal $V$ can be found using:

Demodulating using this technique requires and be generated from the reference source. This requires each of the eight coil voltages (20.5kHz, 21.5kHz...) to be individually sampled for processing, requiring an analogue to digital converter with a very high aggregate sampling frequency. Instead, simulated reference signals may be used to generate and which results in asynchronous demodulation.

### Asynchronous demodulation

Asynchronous demodulation uses simulated reference signals to generate the quadrature signals for demodulation. These simulated signals are **not** locked in phase with the signal to be demodulated and can experience frequency mismatch. This results in an increase in the number calculations required when determining the phase and magnitude of the signal of interest, but reduces the number of signals required for sampling.

Consider a tracking system consisting of N emitting coils, each coil carrying a current component of the following form:

where is the amplitude of the emitting coil waveform, is the excitation frequency and is the current phase relative to an arbitrary reference. Summing all N current waveforms results in:

The induced voltage on the sensor is a sum of the voltages induced by the coil currents:

where is the amplitude of the induced voltage component and is the associated phase. Each frequency component of the voltage signal is extracted using two reference signals:

where is the frequency of the simulated reference signal. This demodulation results in the amplitudes and phases of all the frequency components relative to the simulated reference signal as follows:

By subtracting the individual phases from each other the relative phase angle between the sensor voltage and coil current waveforms can be found:

The sign of this phase information indicates the axial orientation of the electromagnetic sensor with respect to the magnetic field.

With a simulated reference signal it can be difficult to lock the frequency to the signal source without the use of phase locking techniques. In our system this often results in a small mismatch in frequency since the simulated reference signal for a particular coil is slightly different from the frequency to be demodulated since they are not locked. This results in a causing a low frequency oscillation in the demodulated signal, which would not be present in synchronous demodulation.

To demonstrate this, consider a single frequency where the coil current and sensor voltage waveforms are given by:

The simulated reference signals used for demodulation are given by:

Starting with the sensor voltage , we multiply by the reference signals just as in the synchronous case to produce:

Extracting the low frequency components using a low-pass filter yields two quadrature voltage signals:

where the difference in frequency is given by:

These signals are close to DC since they oscillate at a frequency of . The amplitude can be determined as in the synchronous case using:

Its clear that the phase has a time dependency. This is due to the frequency mismatch of the carrier and reference signals. In order to remove this dependency, the same demodulation procedure above is performed to the coil current waveform i(t) to produce and . Subtracting the phase component from gives the constant relative phase angle between the two waveforms:

This 'double demodulation' allows both the accurate retrieval of the amplitude and phase of each of the induced sensor voltages. Implementation details of how this demodulation is achieved are described in the next section.

## Demodulation implementation

- Demodulation implementation**

### =

The asynchronous demodulation process takes place in Matlab using an efficient matrix calculation technique. This method involves recording a number of samples of each signal of interest. This has the advantage of reduced solving time since all samples are available at the time of calculation. This is in contrast to real-time processing where samples are gathered and processed one-by-one in turn.

The signals of interest we wish to sample are:

1. The induced voltage on the 5-DOF sensor coil(s) 2. The composite coil current signal

Initially we consider the induced voltage on a single sensor that has been discretised through sampling:

where N is the number of frequency of interest (N = 8, one frequency per emitter coil), is the amplitude and is an associated phase shift. Collecting and string containing **Failed to parse (syntax error): {\displaystyle p$ samples: <math display="block">\mathbf{X}=\left[x[0],x[1] ... x[p-1]\right]}**

In the previous section asynchronous demodulation was discussed. The first step of the demodulation involves multiplying the sampled signal by two sinusoids and , where is the simulated reference signal close in frequency to . Using Euler's relation we combine into a single discrete complex sinusoid:

where . This complex exponential encapsulates the two quadrature signal components required for demodulation. Given the results in a vector of voltage magnitude:

**Failed to parse (unknown function "\newline"): {\displaystyle \mathbf{E} = \begin{bmatrix} \epsilon_i[0] & \dots & \epsilon_N[0] \newline \vdots& \ddots & \vdots \newline \epsilon_i[p-1] & \dots & \epsilon_N[p-1] \end{bmatrix}$$ where <math display="block">\epsilon_i[n]=e^{\frac{2 \pi f_{ri} j n }{f_s}}$$ The row vector of demodulated voltages is given by premultiplying <math>\mathbf{E}}**
by the row vector of **Failed to parse (syntax error): {\displaystyle p$ samples: <math display="block">\mathbf{Y} = [\widetilde{V}_1 ... \widetilde{V}_N] = 2\mathbf{X}\mathbf{E}}**

is a complex valued row-vector due to the presence of in the complex exponential calculation. The absolute value of each entry in is the amplitude received frequency of interest, .

Finite impulse response (FIR filter)

A finite impulse response filter is implemented as part of the demodulation step. This low pass FIR filter eliminates unwanted frequency components from the input sample stream . Consider an FIR filter denoted by **Failed to parse (syntax error): {\displaystyle f_i$ with $p$ coefficients (\textit{i.e.} equal to the number of input samples). The output of such a filter can be represented as: <math display="block">p[n] = \sum_{i=0}^{p-1}f_ix[n-i]}**

where is the filtered sample vector and is a single filter tap coefficient. Each filter coefficient can be represented by a single matrix as shown below:

The FIR filter can be applied to the demodulator by scaling each input sample of **Failed to parse (syntax error): {\displaystyle X$ with the corresponding FIR coefficient given by <math>F$. This is achieved using an element by element multiplication: <math display="block">\mathbf{Y} = 2(\mathbf{X}\circ \mathbf{F})\mathbf{E} }**

where represents the element-wise multiplication operator.

The amplitude of each frequency component can be determined by calculating the absolute value of , which is a complex quantity. The phase of an be found using the complex argument of **Failed to parse (syntax error): {\displaystyle Y$ <math display="block">[V_1 V_2 \dots V_N] = |\mathbf{Y}|}**

The implementation of this calculation can be found in the Matlab code provided in the OSF file repository.