OFDM Waveform#
- class OFDMWaveform(subcarrier_spacing=1000.0, num_subcarriers=1024, dc_suppression=True, resources=None, structure=None, **kwargs)[source]#
Bases:
ConfigurablePilotWaveform
,Serializable
Generic Orthogonal-Frequency-Division-Multiplexing with a flexible frame configuration.
The internally applied FFT size is
OFDMWaveform.num_subcarriers()
timesCommunicationWaveform.oversampling_factor()
.- The following features are supported:
The modem can transmit or receive custom-defined frames. Frames may contain UL/DL data symbols, null carriers, pilot subcarriers, reference signals and guard intervals.
SC-FDMA can also be implemented with a precoder.
Subcarriers can be modulated with BPSK/QPSK/16-/64-/256-QAM.
Cyclic prefixes for interference-free channel estimation and equalization are supported.
- This implementation has currently the following limitations:
All subcarriers use the same modulation scheme
- Parameters:
subcarrier_spacing (float, optional) – Spacing between individual subcarriers in Hz. \(1~\mathrm{kHz}\) by default.
num_subcarriers (int, optional) – Maximum number of assignable subcarriers. Unassigned subcarriers will be assumed to be zero. \(1024\) by default.
dc_suppression (bool, optional) – Suppress the direct current component during waveform generation. Enabled by default.
resources (List[FrameResource], optional) – Frequency-domain resource section configurations.
structure (List[FrameSection], optional) – Time-domain frame configuration.
**kwargs (Any) – Waveform generator base class initialization parameters. Refer to
CommunicationWaveform
for details.
- add_resource(resource)[source]#
Add a OFDM frequency resource to the waveform.
- Parameters:
resource (FrameResource) – The resource description to be added.
- Return type:
- add_section(section)[source]#
Add a frame section to the OFDM structure.
- Parameters:
section (FrameSection) – The section to be added.
- Return type:
- demodulate(signal)[source]#
Demodulate a base-band signal stream to data symbols.
- Parameters:
signal (np.ndarray) – Vector of complex-valued base-band samples of a single communication frame.
- Return type:
- Returns:
The demodulated communication symbols
- map(data_bits)[source]#
Map a stream of bits to data symbols.
- Parameters:
data_bits (np.ndarray) – Vector containing a sequence of L hard data bits to be mapped onto data symbols.
- Returns:
Mapped data symbols.
- Return type:
- modulate(symbols)[source]#
Modulate a stream of data symbols to a base-band signal containing a single data frame.
- Parameters:
data_symbols (Symbols) – Singular stream of data symbols to be modulated by this waveform.
- Return type:
Returns: Samples of the modulated base-band signal.
- pick(placed_symbols)[source]#
Pick the mapped symbols from the communicaton frame.
Additionally removes interleaved pilot symbols.
- Parameters:
placed_symbols (StatedSymbols) – The placed symbols.
- Return type:
Returns: The symbols with the mapped symbols picked from the frame.
- place(placed_symbols)[source]#
Place the mapped symbols within the communicaton frame.
Additionally interleaves pilot symbols.
Returns: The symbols with the mapped symbols placed within the frame.
- unmap(symbols)[source]#
Map a stream of data symbols to data bits.
- Parameters:
symbols (Symbols) – Sequence of K data symbols to be mapped onto bit sequences.
- Returns:
Vector containing the resulting sequence of L data bits In general, L is greater or equal to K.
- Return type:
np.ndarray
- property bandwidth: float#
Bandwidth of the frame generated by this generator.
Used to estimate the minimal sampling frequency required to adequately simulate the scenario.
- Returns:
Bandwidth in Hz.
- Return type:
- property bit_energy: float#
Returns the theoretical average (discrete-time) bit energy of the modulated baseband_signal.
Energy of baseband_signal \(x[k]\) is defined as \(\sum{|x[k]}^2\) Only data bits are considered, i.e., reference, guard intervals are ignored.
- dc_suppression: bool#
- property modulation_order: int#
Access the modulation order.
- Returns:
The modulation order.
- Return type:
- property num_data_symbols: int#
Number of bit-mapped symbols contained within each communication frame.
- property num_subcarriers: int#
Maximum number of subcarriers.
Sometimes also referred to as FFT-size.
- Returns:
Number of subcarriers.
- Return type:
- property pilot_section: PilotSection | None#
Static pilot section transmitted at the beginning of each OFDM frame.
Required for time-domain synchronization and equalization of carrier frequency offsets.
- Returns:
FrameSection of the pilot symbols, None if no pilot is configured.
- property pilot_signal: Signal#
Model of the pilot sequence within this communication waveform.
- Returns:
The pilot sequence.
- Return type:
- property power: float#
Returns the theoretical average symbol (unitless) power,
Power of baseband_signal \(x[k]\) is defined as \(\sum_{k=1}^N{|x[k]|}^2 / N\) Power is the average power of the data part of the transmitted frame, i.e., bit energy x raw bit rate
- property resources: List[FrameResource]#
OFDM grid resources.
Returns: List of resources.
- property sampling_rate: float#
Rate at which the waveform generator signal is internally sampled.
- Returns:
Sampling rate in Hz.
- Return type:
- property structure: List[FrameSection]#
OFDM frame configuration in time domain.
Returns: List of frame elements.
- property subcarrier_spacing: float#
Subcarrier spacing between frames.
- Returns:
Spacing in Hz.
- Return type:
- property symbol_energy: float#
The theoretical average symbol (discrete-time) energy of the modulated baseband_signal.
Energy of baseband_signal \(x[k]\) is defined as \(\sum{|x[k]}^2\) Only data bits are considered, i.e., reference, guard intervals are ignored.
- Returns:
The average symbol energy in UNIT.