Changes

From OpenEMT.org
Jump to: navigation, search

Signal demodulation

108 bytes added, 19:10, 3 November 2017
no edit summary
<math display="block">v'_x(t) = \frac{v}{2}\sin(\varphi)</math>
The amplitude of the modulating signal $<math>V$ </math> can be found using:
<math display="block">V = 2\sqrt{(v'_x(t)^2 + v'_y(t)^2)}</math>
The phase of the signal can be found using:
<math display="block">x[n] = \sum_{i=1}^N V_i\sin\left(\frac{2 \pi f_i n}{f_s}+\varphi_i\right)</math>
where N is the number of frequency of interest (N = 8, one frequency per emitter coil), <math>f_i$ </math> is the frequency of interest in hertz, <math>f_s$ </math> is the sampling frequency of the DAQ, <math>V_i</math> is the amplitude and <math>\varphi_i</math> is an associated phase shift. Collecting and string <math>p$ </math> points results in a vector <math>\mathbf{X}</math> containing <math>p$ </math> samples:
<math display="block">\mathbf{X}=\left[x[0],x[1] ... x[p-1]\right]</math>
In the previous section asynchronous demodulation was discussed. The first step of the demodulation involves multiplying the sampled signal by two sinusoids <math>Y(n)=\sin(2\pi f_{ri} n)</math> and <math>X(n)=\cos(2\pi f_{ri} n)</math>, where <math>f_{ri}</math> is the simulated reference signal close in frequency to <math>f_i</math>. Using Euler's relation we combine <math>X(n)$ </math> and <math>Y(n)</math> into a single discrete complex sinusoid:
<math display="block">\cos(2\pi f_{ri}n) + j\sin(2\pi f_{ri} n) = e^{\frac{2 \pi f_{ri} j n }{f_s}}</math>
where <math>j = \sqrt{-1}</math>. This complex exponential encapsulates the two quadrature signal components required for demodulation. Given the <math>N$ </math>emitter coil frequencies, <math>N$ </math> complex exponentials are required for the demodulation of each frequency. A <math>p \times N$ </math> matrix of complex exponentials is created such that when pre-multiplied by <math>\mathbf{X}</math> results in a vector of voltage magnitude:
<math display="block"> \mathbf{E} = \begin{bmatrix}
\vdots& \ddots & \vdots \newline
\epsilon_i[p-1] & \dots & \epsilon_N[p-1]
\end{bmatrix}$$</math>
where
<math display="block">\epsilon_i[n]=e^{\frac{2 \pi f_{ri} j n }{f_s}}$$</math>
The row vector of demodulated voltages is given by premultiplying <math>\mathbf{E}</math> by the row vector of <math>p$ </math> samples:
<math display="block">\mathbf{Y} = [\widetilde{V}_1 ... \widetilde{V}_N] = 2\mathbf{X}\mathbf{E}</math>
------------------------------------
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 <math>mathbf{X}</math>. Consider an FIR filter denoted by <math>f_i$ </math> with $<math>p$ </math>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]</math>
<math display="block">F = [f_0, f_1, f_2 \dots f_{p-1}]</math>
The FIR filter can be applied to the demodulator by scaling each input sample of <math>X$ </math> with the corresponding FIR coefficient given by <math>F$</math>. This is achieved using an element by element multiplication:
<math display="block">\mathbf{Y} = 2(\mathbf{X}\circ \mathbf{F})\mathbf{E} </math>
where <math>\circ</math>represents the element-wise multiplication operator.
The amplitude of each frequency component can be determined by calculating the absolute value of <math>\mathbf{Y}</math>, which is a complex quantity. The phase of <math>\mathbf{Y}</math>an be found using the complex argument of <math>Y$</math>
<math display="block">[V_1 V_2 \dots V_N] = |\mathbf{Y}|</math>
<math display="block">[\varphi_1, \varphi_2 \dots \varphi_N] = \arg(\mathbf{Y})</math>
The implementation of this calculation can be found in the Matlab code provided in the OSF file repository.

Navigation menu