# 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.

## 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:

${\displaystyle v(t)=V\sin(\omega t+\varphi )}$

where ${\displaystyle V}$ 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:

${\displaystyle Y(t)=\sin(\omega t)}$
${\displaystyle X(t)=\cos(\omega t)}$

This multiplication result in two quadrature signals:

${\displaystyle v_{y}(t)=v(t)Y(t)={\frac {V}{2}}[\cos(\varphi )-\cos(2\omega t+\varphi )]}$
${\displaystyle v_{x}(t)=v(t)X(t)={\frac {V}{2}}[\sin(\varphi )-\sin(2\omega t+\varphi )]}$

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

${\displaystyle v'_{y}(t)={\frac {v}{2}}\cos(\varphi )}$
${\displaystyle v'_{x}(t)={\frac {v}{2}}\sin(\varphi )}$

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

${\displaystyle V=2{\sqrt {(v'_{x}(t)^{2}+v'_{y}(t)^{2})}}}$
The phase of the signal can be found using:
${\displaystyle \varphi =\arctan \left({\frac {v'_{y}(t)}{v'_{x}(t)}}\right)}$

Demodulating using this technique requires ${\displaystyle Y(t)}$ and ${\displaystyle X(t)}$ 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 ${\displaystyle Y(t)}$and ${\displaystyle X(t)}$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:

${\displaystyle i_{i}(t)=I_{i}\sin(\omega _{i}t+\varphi _{I_{i}})}$

where ${\displaystyle I_{i}}$ is the amplitude of the ${\displaystyle i_{th}}$emitting coil waveform, ${\displaystyle \omega _{i}}$ is the excitation frequency and $\displaystyle \varphi_i is the current phase relative to an arbitrary reference. Summing all N current waveforms results in: $i(t) = \sum^N_{i=1} I_i\sin(\omega_i t + \varphi_{I_{i}})$$

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

${\displaystyle v(t)=\sum _{i=1}^{N}V_{i}\sin(\omega _{i}t+\varphi _{V_{i}})}$

where $V_i$ is the amplitude of the induced voltage component and $\displaystyle \varphi_{V_i} is the associated phase. Each frequency component of the voltage signal is extracted using two reference signals: $Y_i = \sin(\omega_{ri} t)$$

${\displaystyle X_{i}=\cos(\omega _{ri}t)}$

where $\omega_{ri}$ 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:

${\displaystyle \mathbf {V} =[V_{1},V_{2}...V_{n}]}$
${\displaystyle \mathbf {I} =[I_{1},I_{2}...I_{n}]}$
${\displaystyle \mathbf {\varphi _{V}} =[\varphi _{V_{1}},\varphi _{V_{2}}...\varphi _{V_{n}}]}$
${\displaystyle \mathbf {\varphi _{I}} =[\varphi _{I_{1}},\varphi _{I_{2}}...\varphi _{I_{n}}]}$

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

${\displaystyle \Delta \mathbf {\varphi } =\mathbf {\varphi _{V}} -\mathbf {\varphi _{I}} }$

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 ${\displaystyle \omega _{ri}}$ is slightly different from the frequency to be demodulated ${\displaystyle \omega _{i}}$since they are not locked. This results in a $\displaystyle \Delta\omega=\omega_{ri} - \omega_r 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: $i(t) = I\sin(\omega t + \varphi_I)$$

${\displaystyle v(t)=V\sin(\omega t+\varphi _{V})}$

The simulated reference signals used for demodulation are given by:

${\displaystyle Y(t)=\sin(\omega _{r}t)}$
${\displaystyle X(t)=\cos(\omega _{r}t)}$

Starting with the sensor voltage $v(t)$, we multiply by the reference signals just as in the synchronous case to produce:

${\displaystyle v(t)Y(t)={\frac {V}{2}}[\cos((\omega -\omega _{r})+\varphi _{V})-\cos((\omega +\omega _{r})+\varphi _{V})]}$
${\displaystyle v(t)X(t)={\frac {V}{2}}[\sin((\omega -\omega _{r})+\varphi _{V})-\sin((\omega +\omega _{r})+\varphi _{V})]}$

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

${\displaystyle v_{x}={\frac {V}{2}}\sin(\Delta \omega t+\varphi _{V})}$
${\displaystyle v_{y}={\frac {V}{2}}\cos(\Delta \omega t+\varphi _{V})}$

where the difference in frequency is given by:

${\displaystyle \Delta \omega =\omega -\omega _{r}}$

These signals are close to DC since they oscillate at a frequency of $\displaystyle \Delta\omega. The amplitude [itex] V can be determined as in the synchronous case using: $V = 2\sqrt{(v_x^2 + v_y^2)}$$ The phase can be determined using:

${\displaystyle \gamma _{V}(t)=\arctan {\frac {v_{x}}{v_{y}}}=\Delta \omega t+\varphi _{V}}$

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 ${\displaystyle I}$ and ${\displaystyle \gamma _{I}\.Subtractingthephasecomponent[itex]\gamma _{V}}$ from ${\displaystyle \gamma _{I}}$ gives the constant relative phase angle between the two waveforms:

${\displaystyle \gamma _{V}-\gamma _{I}=\varphi _{V}-\varphi _{I}}$

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.