Ti Mmwave Labs: Driver Vital Signs - Developer'S Guide
Ti Mmwave Labs: Driver Vital Signs - Developer'S Guide
Ti Mmwave Labs: Driver Vital Signs - Developer'S Guide
• To measure these small scale vibrations/displacements, we measure the change in phase of the
FMCW signal with time at the target range bin
4 - b corresponds to the change in phase when the target moves a distance R
b R
- Note that a smaller wavelength will give better displacement sensitivity
• Code Composer Studio (CCS) project along with source code is provided for this lab
• Pre-built binary files are also provided that can be loaded on to the AWR-1642 EVM 2
FMCW Radar Basics
Periodic linearly-increasing frequency chirps (known as Frequency-Modulated Continuous Wave (FMCW))
are transmitted by radar towards the object
2R
td
c
Frequency, Hz
fb
B
td
T
Time, sec
Time, sec
B
j 2 f c t t 2
Transmitted FMCW signal is given by s (t ) e
T
2
B
j 2 f c t td t td
Signal at the receiver is a delayed version of the transmitted signal r ( t ) e
T
The received signal from an object at range R after mixing and filtering is given by
BR 4
j 4 t R
j f bt b
s (t ).r (t ) e cT
e
3
FMCW Radar – Vital signs Measurements
Note that for a single object, the beat signal b(t) is a sinusoidal and has both frequency 𝑓𝑏 and phase ∅𝑏
BR 4
j 4 t R
j f bt b
b( t ) e cT
e
fb b
To measure small scale vibrations, we measure the change in phase of the FMCW signal with time at the
object range bin. If an object moves a distance ∆R then the change in phase between consecutive
measurements is given by 4 As an example at λ=4 mm when we have displacements as
b R
small as ∆R = 1mm, the corresponding phase change is b
Phase can be measured by taking the FFT of the beat signal b(t) and computing the phase at the object
range-bin.
Suppose we take the FFT and the object is at range-bin m, then the vibration signal x(t) can be extracted by
measuring the phase at range-bin m at time indices nTs , where n is the chirp index and Ts is the time
between consecutive measurements
Note that we are assuming that the vibrations x(t) are
x ( m, nTs ) b ( m, nTs ) small so that the object remains in the same range-bin
4
during the duration of the measurements 4
Chirp Configuration for Demo
100 ADC Samples per chirp. Chirp duration is 50 ms based on the IF sampling rate of 2 MHz
Each frame is configured to have 2 chirps. However only the 1st Chirp in the frame is used for processing
A single TX-RX antenna pair is currently used for processing (Although all the RX antennas are enabled)
Vital signs waveform is sampled along the “slow time axis” hence the vital signs sampling rate is equal to the Frame-rate of system
Frame 1 Frame 2 Frame 3
Frame N
Object
Range-Bins
Range Bin
Further Processing for
Extract Phase and unwrap Vital Signs Estimation
for the object range bin
Heart
Bandwidth 4 GHz Motion
Rate
Corrupted
Fc (Starting Frequency) 77 GHz No
segment
Fs (Slow Time Axis sampling)
20 Hz
Fs_fast (Fast Time Axis Yes
sampling) 2 MHz
Discard the
N (Samples per Chirp) 100 segment
Tc (Chirp Duration) 50 us
6
Block Diagram Description
Range FFT : A Fast Fourier Transform (FFT) is performed on the ADC data to obtain the range profile. The
magnitude of the range-profile is displayed on the PC-GUI.
Target Range-bin : The range-bin corresponding to the target is found by finding the max-value in the range profile
within the user-specified range limits.
Phase Extraction : The phase value of the selected range-bin is computed from the complex range profile data and
these phase values are measured over time. The assumption is that the subject is in the same range-bin throughout
these measurements. If the subject moves to a different range-bin then it will take a few seconds before the algorithm
locks into the new target range-bin.
Phase Unwrapping : Phase values are between [-π, π ] and need to be unwrapped to obtain the actual
displacement profiles. Phase unwrapping is performed by adding/subtracting 2π from the phase whenever the phase
difference between consecutive values is greater/less than ± π. The unwrapped phase is displayed as the chest
displacement on the PC-GUI.
Phase Difference : The phase difference operation is performed on the unwrapped phase by subtracting successive
phase values. This helps in enhancing the heart-beat signal and removing any phase drifts.
Impulsive Noise Removal : The un-wrapped differential phase might be corrupted by several noise-induced phase
wrapping errors. This impulse-like noise is removed by computing a forward a(m)–a(m+1) and backward a(m)-a(m-1)
phase difference for each a(m) and if these exceed a certain threshold then a(m) is replaced by an interpolated value.
7
Block Diagram Description
Bandpass Filtering : The phase values (after unwrapping and phase differences) are passed through two band-
pass filters (serially-cascaded Bi-Quad IIR filter). These band-pass filters operate in real-time input data to generate
a continuous stream of output data. The data after band-pass filtering is displayed as the breathing waveform and
heart waveform in the PC-GUI.
Motion corrupted segment removal/Gain Control : The purpose of this block is to reduce the impact of any large
amplitude movements on the heart-rate estimates. The waveform is divided into segment of L=20 samples
(corresponding to 1 sec). If the energy within this data segment exceeds a user-defined threshold (E > ETh), then all
the samples in that data segment/block are either scaled by ETh or are alternatively discarded from the time-domain
E
cardiac waveform.
Vital Signs Waveforms : Band-pass filter outputs are stored in the breathing-waveform and cardiac-waveform
buffer. Pre-processing steps such as windowing, gain control can be done on these prior to spectral estimation.
Spectral Estimation : These buffers are passed on to the spectral estimation block. Several different types of
spectral estimation techniques can be implemented. The current implementation provides a FFT, auto-correlation
and an estimate based on the inter-peak distances in the time-domain waveforms to estimate the vital signs.
Vital Signs Decision : The final heart-rate and breathing-rate decisions are made based on the confidence metric
from different spectral estimation methods.
8
Steps for Building from the Source Code and Run
1. 2. 3. 4. 5.
Pre- Import Lab Build Lab Preparing Running the
requisites project project the EVM Lab
9
1. Pre-requisites 1. Install Pre-requisites 2 3 4 5
• It is assumed that you have the TI mmWave SDK 2.0.0.4 and all the related
tools installed as mentioned in the mmWave SDK release notes.
– The mmWave SDK release notes include the links for downloading the required
versions of the above tools.
• If you have already installed the mmWave SDK and all the required tools, you
can move on to the next step i.e. downloading the lab on to your machine.
10
1. Pre-requisites 1. Install Pre-requisites 2 3 4 5
11
Steps
1. 2. 3. 4. 5.
Pre- Import Lab Build Lab Preparing Running the
requisites project project the EVM Lab
12
2. Import Lab Project 1
2
Import Lab project
3 4 5
14
Steps
1. 2. 3. 4. 5.
Pre- Import Lab Build Lab Preparing Running the
requisites project project the EVM Lab
15
3. Build the Lab 1 2
3
Build Lab project
4 5
• At this point we assume the two projects have been • The dss project must be built BEFORE the mss
imported in CCS. If they have not please go to Step project.
2.
• With the mss project selected in Project
Explorer, right click on the project and select
• With the dss project selected in Project Explorer, Rebuild Project
right click on the project and select Rebuild
Project. • On successful completion of the build, you
– Selecting Rebuild instead of Build ensures that the should see the output in CCS console as shown
project is always re-compiled. This is especially here and the following three files should be
important in case the previous build failed with errors. produced in the project debug directory
1. 2. 3. 4. 5.
Pre- Import Lab Build Lab Preparing Running the
requisites project project the EVM Lab
17
4. Preparing the EVM 1 2 3
4. Preparing
the EVM 5
• There are two ways to execute the compiled code on the EVM:
– Deployment mode : Flashing the binary (.bin image) on to the EVM serial flash
• In this mode, the EVM boots autonomously from flash and starts running the bin image.
– Debug mode: Downloading and running the executable (.xer4f image) from CCS.
• You will need to flash a small CCS debug firmware on the EVM (one time) to allow
connecting with CCS. This debug firmware image is provided with the mmWave SDK.
• The Getting Started Guide has demonstrated the deployment mode
• The following presentation explains the second method i.e. Debug mode (CCS).
– To prepare the EVM for debug mode, we start with flashing the CCS debug firmware
image.
– Please use the flashing process described in the Getting Started Guide to flash the
following binary to the EVM.
• C:\ti\mmwave_sdk_xx_xx_xx_xx\packages\ti\utils\ccsdebug\xwr16xx_ccsdebug.bin
18
Steps
1. 2. 3. 4. 5.
Pre- Download Build Lab Preparing Running the
requisites Lab project project the EVM Lab
19
5. Connecting EVM to CCS 1 2 3 4 5. Running the
Lab
22
5. Loading the binary 1 2 3 4 5. Running the
Lab
23
5. Running the binary 1 2 3 4 5. Running the
Lab
• With both executables loaded, select • Select dss_main.c, as shown, and press
the Run/Resume button
mss_main.c and press the Run/Resume
button • Further console output should be
generated as shown.
• The program should start executing and • You should see the “CLI is operational”
generate console output. message which indicates that the program
• If everything goes fine, you should see is ready and waiting for the sensor
configuration
the “MMWDemoMSS mmWave Control
Initialization was successful” message
which indicates that the program is • The sensor configuration is sent using the
waiting for the DSS to be started GUI. Follow Getting Started Guide for
more details on placing the sensor and
starting the GUI.
24
Running the Lab PC-GUI 1 2 3 4 5. Running the
Lab
COM ports
(The GUI should
automatically fill
these fields)
If the GUI does not open you might need the vc runtime
which can be downloaded from the link below
https://support.microsoft.com/en-us/help/2977003/the-latest-
supported-visual-c-downloads
25
Running the Lab PC-GUI 1 2 3 4 5. Running the
Lab
1. Press the Start Push button in the GUI. In the Display Prompt window you should see the configuration
settings being read from the configuration text file and sent through the UART to the EVM
2. As soon as the sensorStart command is sent, the GUI should start displaying the data
3. Please follow the Getting Started Guide for more details on placing the sensor and starting the GUI.
26
Running GUI – (Configuration)
• The mmWave sensor device and algorithm configurations are set through the configuration text file. These files are located
in vitalSigns_host\gui\profiles\
• Configuration commands relevant to the vital signs algorithm are vitalSignsCfg and motionDetection
Breathing Waveform Size 256 Specifies the number of points within the waveforms. As an example, given a
frame-rate of 20 Hz and 256 number of samples in the waveform then the time
Heart-rate Waveform Size 320 duration of the waveform would be = 256/20 ~ 12.8 seconds. In general, larger
the time duration, better the frequency resolution after the FFT and higher the FFT
processing gain. However, due to the inherent time-frequency resolution tradeoff,
we lose the ability to measure instantaneous changes in the heart-rate and
breathing-rate
Rx-Antenna to Process 1 Rx receiver number to process. Data from a single RX antenna is processed in the
current implementation
Alpha filter value for Breathing waveform 0.1 Alpha filter values for recursive averaging of the waveform energies based on the
energy computation equation below where x(n) is the current waveform value while E(n) is the energy.
Scale Factor for breathing waveform 300000 Scaling factors to convert waveform values in floating points to 32 bit integers
required for the FFT.
Data segments Length 20 Data segment over which the energy is computed
(L)
Threshold (ETH) 0.04 Energy threshold value. If the energy in the data segment length exceeds this value then the
data segment is discarded
29
Output packet on UART
Vital Signs Output Stats
Parameter Type
Header rangeBinIndexMax uint16
rangeBinIndexPhase uint16
MagicWord
Packet Structure ( 0x0102, 0x0304, 0x0506, 0x0708) 8 Bytes maxVal float
processingCyclesOut uint32
rangeBinStartIndex uint16
40 Bytes
Total packet size is multiple of 32 bytes
32
Saving data using the PC-GUI
• The PC-GUI also gives the option of saving the data that is displayed on the GUI.
Data can be saved by checking the “Save Data” check box. This can be checked
anytime the GUI is running
• The saved data follows the same format mentioned in the slide “Output packet on
UART”
33
Saving data using the PC-GUI (cont.)
• Note that the complex range-FFT output (i.e. both real and imaginary values) from
the user-specified range-bins are also saved. The complex range-FFT output would
allow the user to extract the phase from a range-bin of interest and write their own
post-processing scripts to extract the vital signs signature.
• An example Matlab script to read the saved file is provided in the folder
“…\vitalSigns_host\gui\gui_source\matlabScripts”
34
Compiling the GUI using Qt
• The PC-GUI was developed in C++ using MSVC 2017 compiler within the Qt framework.
• If the user desires to modify the GUI source code then please follow the following steps
• Download and install Qt (Qt Creator 4.3 was used in the current version)
• Once Qt is installed. Select File Open File or Project ….
• Go to the GUI source files (…\vitalSigns_host\gui\gui_source) and open the project file with the
extension “.pro”
• You may be asked to configure the project. In the current version MSVC 2017 was used to
compile the project. You may also use other compilers.
35
36