Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NearFieldCorrection: fix unit scale of lambda #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion mmwave/dsp/compensation.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,14 @@ def near_field_correction(idx,
None. azimuth_output is changed in-place.
"""

LAMBDA_77GHz_MILLIMETER = 3e8 / 77e9
# From the mmwave sdk 02.01.00.04 : #define MMWDEMO_XWR16XX_EVM_77GHZ_LAMBDA (3.8961)
# All length units are in mm. The LAMBDA (wavelength) below is based on 77 GHz
# and corresponds to the actual spacing on the EVM, it is not
# tied to the actual start frequency set in profile config, hence does not
# need to be computed on the fly from that configuration.
# lambda = c / f = 3e8 m/s / 77e9 Hz = 0.0038961 m -> in millimeter: 3.8961 mm as above
# As all calculations here are meant to be calculated in millimeters, we have to scale lambda accordingly!
LAMBDA_77GHz_MILLIMETER = (3e8 / 77e9) * 1000.0
MMWDEMO_TWO_PI_OVER_LAMBDA = 2.0 * math.pi / LAMBDA_77GHz_MILLIMETER

# Sanity check and check if nearFieldCorrection is necessary.
Expand Down