Skip to content

Latest commit

 

History

History
87 lines (61 loc) · 2.66 KB

README.md

File metadata and controls

87 lines (61 loc) · 2.66 KB

MMWave Calibrate

Tool to generate the calibration matrices for the MMWCAS-RF-EVM radar.

This tool allows the generation of three types of calibration matrices:

  • Coupling calibration
  • Phase and amplitude calibration
  • Frequency calibration

For generating the coupling calibration, one need to record some data with the MMWCAS-RF evaluation module, with no target in sight.

For the frequency and phase calibration, at target (more precisely a corner reflector) should be placed at a known distance (known as the reference distance) of the radar and aligned with its center of coordinate.

The recorded data in both cases must be repacked using the mmwave-repack tool.

Installation

Create a virtual environment and install the necessary packages as shown below

# Create virtual enviroment and enable it
python -m venv venv
source ./venv/bin/activate

# Install requirements
python -m pip install -r requirements.txt

Usage

# Coupling calibration
python calibrate.py -c -i <path-to-frame> [-o <output-directory>]
python calibrate.py --coupling-calibration -i <path-to-frame> [-o <output-directory>]

# Phase and Frequency calibration
python calibrate.py -w -f <calibration-config-file> -i <path-to-frame> [-o <output-directory>] -ref <target-distance>

The following CLI options are optional

# Number of TX and RX antenna
python calibrate.py ... [-ntx <num-tx-antenna> -nrx <num-rx-antenna>]

# Number of TX and RX antenna
python calibrate.py ... [-ns <num-adc-samples> -nc <num-chirp-loops>]

Use the help to see all the possible options.

Examples

# Coupling calibration
python calibrate.py -c -i /home/user/calib0/frame_1.bin

# Phase, Amplitude and Frequency calibration
python calibrate.py -w -f config/default-calib.json -i /home/user/calib1/frame_1.bin -ref 5.0

NOTE: Be careful and make sure to use the appropriate recording for each type of calibration.

Reading the calibration files

import numpy as np

ntx: int = 12       # Number of TX antenna
nrx: int = 16       # Number of RX antenna
ns: int = 256       # Number of samples per chirp

# Coupling calibration
coupling_calib = np.fromfile("counpling_calibration.bin", dtype=np.float32, count=-1).reshape(ntx, nrx, ns, 2)
coupling_calib = coupling_calib[:, :, :, 0] + 1j * coupling_calib[:, :, :, 1]

# Phase calibration
phase_calib = np.fromfile("phase_calibration.bin", dtype=np.float64, count=-1).reshape(ntx, nrx, 2)
phase_calib = phase_calib[:, :, 0] + 1j * phase_calib[:, :, 1]

# Frequency calibration
frequency_calib = np.fromfile("phase_amp_calibration.bin", dtype=np.float64, count=-1).reshape(ntx, nrx)