"""DFT-spread OFDM (SC-FDMA style, localized mapping). Identical grid/CP structure to OFDM; each data symbol's 48 constellation symbols are DFT-48 precoded before subcarrier mapping (lower PAPR, single-carrier-like). The pilot symbol is sent directly in the frequency domain (DMRS-style, no spreading). """ from __future__ import annotations import numpy as np from .ofdm import OFDM class DFTsOFDM(OFDM): name = "dfts_ofdm" def _fill_grid(self, s): data = s.reshape(s.shape[:-1] + (self.n_sym - 1, self.n_occ)) data = np.fft.fft(data, axis=-1, norm="ortho") # DFT spreading pil = np.broadcast_to(self.pilots[:, None, :], s.shape[:-1] + (1, self.n_occ)) return np.concatenate([pil, data], axis=-2) def _extract_data(self, grid): d = np.fft.ifft(grid[..., 1:, :], axis=-1, norm="ortho") # de-spread return d.reshape(d.shape[:-2] + (self.cfg.n_data,))