import matplotlib.pyplot as plt
import numpy as np
from radicalsdk.h5dataset import H5DatasetLoader
from radicalsdk.radar.config_v1 import read_radar_params
from radicalsdk.radar.v1 import RadarFrame
data = H5DatasetLoader('../samples/indoor_sample_50.h5')
# Read config and configure RadarFrame object
radar_config = read_radar_params('../samples/indoor_human_rcs.cfg')
rf = RadarFrame(radar_config)
FRAME_IDX = 2
mmwave_range_az = rf.compute_range_azimuth(data['radar'][FRAME_IDX])
range_cube = rf.range_cube.copy()
Reference implementation in NumPy
plt.figure(figsize=(5, 10))
plt.imshow(np.log(np.abs(rf.compute_range_azimuth(data['radar'][FRAME_IDX]))))
plt.show()
Full Tensorflow implementation
spectrum, weights = aoa_capon(
range_cube,
steering_vec=tf.cast(rf.steering_vec, tf.complex128),
mu = None
)
plt.figure(figsize=(5, 10))
plt.imshow(np.fliplr(np.flipud(np.log(np.abs(spectrum)))))
plt.show()