The measured data from the 14-bit ADC is buffered and sign-extended to 16-bit format. The amplitude of the input signal is adjusted by using a PGA to avoid overflow. The gain of the PGA can be controlled manually, setting its gain to a fixed value, or it can be controlled automatically by the FPGA. The received data are demodulated using the phase-sensitive (I/Q) detector.
2.4.1. Phase-Sensitive Demodulation
Phase-sensitive demodulation (PSD) is a simple and reliable demodulation method to calculate the in-phase (I) and quadrature (Q) components of the measured voltages. However, it needs two demodulation blocks for each frequency to be demodulated simultaneously, which can become costly in terms of FPGA resources if the number of frequencies acquired simultaneously is too high. A workaround is to perform the demodulation multiple times for the same data set [
17].
Considering a number of frequencies
n, the measured voltages (
) modulated by the body are represented by:
where
is the modulated amplitude and
is the phase induced by the tissues impedances, for each frequency
.
The demodulation of the I and Q components for each frequency is performed separately by multiplying the measured signal
with the original sine and cosine of each frequency, respectively. For that, a dedicated multiplier of a XtremeDSP Slice is used. Although the theory of PSD is well-known [
29], we provide a supplement with the intermediate steps of the demodulation for convenience to the reader. The following equations show the generalized
and
component of a frequency
.
Figure 6 presents the compact block diagram of the demodulation implemented in the FPGA for both
I and
Q components, of the 16-bit signal extended (16 ext) measured voltages. This block is repeated for each frequency
.
A Cascaded Integrator-Comb (CIC) filter was used for low-pass filtering. CIC filters are similar to moving average filters in which, in each step, the filter is implemented recursively, adding the next sample and subtracting the last. They are a special class of digital linear-phase finite impulse response (FIR) filters used for decimation and interpolation [
30]. It is advisable to use CIC filters as an alternative to other FIR filters, when high sample rate changes are desired.
Figure 7 shows a 4-stage CIC decimator. It has four cascaded integrator stages, followed by a decimator of factor R (sample rate change) that, in turn, is followed by four comb stages. The CIC filters only use additions and subtractions, and do not employ multipliers [
30]; this is why they are a good option for FPGA implementations.
As the CIC core of the FPGA only allows signals of 24-bit maximum, the precision of the multiplication result (32-bit) had to be reduced (rounded). The CIC was configured as one channel decimation filter with four stages N and a differential delay M = 1. The sample rate change R was set to be programmable depending on the frequency used, and has an absolute maximum of 8192 samples. The window has to contain an integer number of complete periods of the frequency . The output width was fixed to 32-bit using truncation quantization.
Sequentially, the resultant I and Q components are saved in separated FIFOs, each containing the 208 values of 32-bit corresponding to one complete cycle, i.e., one EIT frame.
As mentioned in
Section 2.3, our system makes uses of multiplexers and two of them are connected only to the even electrodes and the other two only to the odd electrodes. Furthermore, the differential amplifier connected to the output of the multiplexers has its positive pole connected to the multiplexer of the odds electrodes and the negative pole connected to the one of even electrodes. Hence, when measuring between electrode 1 and 2 (“V
”), and after between 2 and 3 (“V
”), the signal of the second measurement will be inverted relative to the first one as depicted in
Figure 8, and so forth. Thus, due to the difference amplifier, in every second voltage measurement the signal is inverted. Because of this system configuration, we are limited in the combinations of measurements we can perform, and thus this influence has to be corrected.
Analogue to the current injection pair, in which the even and odd electrodes are connected to
(
π radians) phase shifted signals, working one as source and the other as sink, and therefore the injected signal is inverted for every second electrode pair. When demodulating an inverted measured signal, using a non-inverted reference signal, the I and Q components will be inverted:
The correction of this signal inversion was performed in the processing after the demodulation by the software at the PC. For that, the 208 values of the I and Q components were corrected by multiplying these signals with an array containing 208,
or 1 values, since
and
. Only the values multiplied by
are inverted. The correction array
c is a combination of both, the inversion provoked by the voltage measurement and the inversion provoked by the current injection.
Figure 9 is an example of the correction of the signal inversion.
To consider the interaction between the conductivity (in-phase) and permittivity (quadrature) of the measured signals (whose inversion was previously corrected), the amplitude (
A) and the phase (
φ) were calculated in Matlab and were obtained from the following equations:
In Matlab, the phase is calculated using the function atan2 or angle, which returns the four-quadrant inverse tangent, in combination with the function unwrap to correct the radian phase angle jumps.
As frequency-difference images of amplitude as well as phase are intended, further attention is required when treating the phase component. The resultant phase
is frequency-dependent. Thus, it must first be converted to time shift
in seconds, in order to be comparable between frequencies:
To suppress the amplitude and phase dependencies at different frequencies of the measurement device itself, the data are normalized. For the amplitude at each frequency (
), the amplitude is normalized by its maximum of the 208 values:
so that all the values are between a value near 0 (but not 0) and 1.
The phase, in this case as time shift, is normalized by subtracting the mean value of the time shift (
) of a frame (208 measurement values), so that the relative time shifts in seconds relative to its mean stay the same. Only the offset time shift, generated mostly by the measurement system itself, is canceled:
Thus, the time shifts for both frequencies are centered at 0.
Finally, the frequency-difference data of the amplitude (
) and time shift (
), necessary for the reconstruction, is given by:
where
is the lowest frequency, and the
the highest one.