Discrete Fourier Transform¶
Discrete Fourier precodings apply a Fourier transform to the input symbols in between the mapping and modulation stage during transmission. Inversely, the precoding is applied after demodulation and before the demapping stage during reception.
They can be configured by adding an instance to the
SymbolPrecoding
of a Modem
exposed by the precoding
attribute:
1# Create a new simulation featuring a single device
2simulation = Simulation()
3device = simulation.new_device()
4
5# Create a new modem
6# This should be replaced by a BaseModem implementation such as DuplexLink
7modem = BaseModem(device=device)
8
9# Configure an OFDM waveform
10modem.waveform = OFDMWaveform(
11 oversampling_factor=2,
12 num_subcarriers=1024,
13 grid_resources=[GridResource(
14 repetitions=100,
15 prefix_ratio=0.0684,
16 elements=[
17 GridElement(ElementType.DATA, 9),
18 GridElement(ElementType.REFERENCE, 1),
19 ]
20 )],
21 grid_structure=[SymbolSection(3, [0])]
22)
23
24# Configure the precoding
25modem.precoding[0] = DFT()
- class DFT(fft_norm='ortho')[source]¶
Bases:
SymbolPrecoder
,Serializable
A precoder applying the Discrete Fourier Transform to each data stream.
- Parameters:
fft_norm (str, optional) – The norm applied to the discrete fourier transform. See also numpy.fft.fft for details
- decode(symbols)[source]¶
Decode a data stream before reception.
This operation may modify the number of streams as well as the number of data symbols per stream.
- Parameters:
symbols (Symbols) – Symbols to be decoded.
- Return type:
Returns: Decoded symbols.
- Raises:
NotImplementedError – If a decoding operation is not supported.
- encode(symbols)[source]¶
Encode a data stream before transmission.
This operation may modify the number of streams as well as the number of data symbols per stream.
- Parameters:
symbols (StatedSymbols) – Symbols to be encoded.
- Return type:
Returns: Encoded symbols.
- Raises:
NotImplementedError – If an encoding operation is not supported.