From 691b5821cbb946254b1aaf72925e77d9afe91884 Mon Sep 17 00:00:00 2001 From: Christos Falas Date: Sun, 29 Dec 2024 12:30:56 +0000 Subject: [PATCH] fix preprocessing arguments --- src/preprocess.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/preprocess.py b/src/preprocess.py index 2761349..7cea971 100644 --- a/src/preprocess.py +++ b/src/preprocess.py @@ -1,5 +1,4 @@ import numpy as np -from .csi import CSI import logging from queue import Queue from . import config @@ -30,15 +29,18 @@ class Preprocessor: output="sos", ) - def preprocess(self, csi: CSI): - h = csi.matrix - + def preprocess(self, h: npt.NDArray[np.complex128]) -> npt.NDArray[np.complex128]: # CSI data is not available for pilot subcarriers. h_hat = np.where( np.expand_dims(h[:, 0, 0] == 0, axis=(1, 2)), correlate(h, [[[1 / 2]], [[0]], [[1 / 2]]], mode="same"), h, ) + + # Skip every other subcarrier + # h_hat = h_hat[::2, :, :] + # logger.info(f"CSI shape: {h_hat.shape}") + h_hat = np.multiply(h_hat, h_hat.conj() / abs(h_hat.conj())) h_hat = np.nan_to_num(h_hat)