Allow skipping subcarriers

This is useful for when processing from files which are larger than can
be processed in real-time.
This commit is contained in:
Christos Falas 2025-02-11 11:16:27 +00:00
parent 638440feff
commit c19ac69a0e
No known key found for this signature in database
2 changed files with 5 additions and 4 deletions

View File

@ -17,6 +17,7 @@ class Preprocessing(BaseModel):
return (self.lowcut, self.highcut) return (self.lowcut, self.highcut)
bandpass: Bandpass bandpass: Bandpass
subcarrier_step: int
class MUSIC(BaseModel): class MUSIC(BaseModel):
@ -67,8 +68,8 @@ class Config(BaseModel):
@property @property
def delta_f(self) -> int: def delta_f(self) -> int:
if self.frame_format == "HESU": if self.frame_format == "HESU":
return 78_125 return 78_125 * self.preprocessing.subcarrier_step
return 312_500 return 312_500 * self.preprocessing.subcarrier_step
@model_validator(mode="after") @model_validator(mode="after")
def channels(self) -> Self: def channels(self) -> Self:

View File

@ -34,8 +34,8 @@ class Preprocessor:
h, h,
) )
# Skip every other subcarrier # Skip subcarrierss per config
# h_hat = h_hat[::2, :, :] h_hat = h_hat[:: config.preprocessing.subcarrier_step, :, :]
# logger.info(f"CSI shape: {h_hat.shape}") # logger.info(f"CSI shape: {h_hat.shape}")
h_hat = np.multiply(h_hat, h_hat.conj() / abs(h_hat.conj())) h_hat = np.multiply(h_hat, h_hat.conj() / abs(h_hat.conj()))