phypy package¶
Subpackages¶
Submodules¶
phypy.analog module¶
Module for performing ‘analog’ related PHY tasks such as the power amplifier
-
class
phypy.analog.
PowerAmp
(order: int = 5, memory_depth: int = 4, memory_stride: int = 1, noise_variance: float = 0.05, add_lo_leakage: bool = True, add_iq_imbalance: bool = True, seed: int = 1)[source]¶ Bases:
phypy.structures.MemoryPolynomial
Power amplifier class that implements a baseband, memory-polynomial based PA
-
static
calculate_nmse
(desired, actual)[source]¶ Calculate the normalized mean squared error Todo:
- Check this. I think I need to divide by number of samples
-
static
phypy.cli module¶
Console script for phypy.
phypy.corrections module¶
Module for performing corrections on impairments related to the PHY such as DPD
-
class
phypy.corrections.
ILA_DPD
(order: int = 5, memory_depth: int = 1, memory_stride: int = 5, n_iterations: int = 2)[source]¶ Bases:
phypy.structures.MemoryPolynomial
Implements a DPD object that uses an indirect learning architecture (ILA)
Implements a digital predistorter (DPD) that uses an indirect learning architecture (ILA) and a parallel hammerstein, memory polynomial structure that acts as an inverse of the PA model.
phypy.dsp module¶
DSP Module for basic DSP functions
-
phypy.dsp.
frequency_shift
(signal, shift_amount, sampling_rate)[source]¶ Performs a shift in the freqeuency shift by multiplying by a complex sinusoid
- Args:
- signal: The signal to be shifted as a nparray shift_amount: Amount to shift by in Hz sampling_rate: The original sampling rate of the signal in Hz
- Returns:
- Returns a nparray with the signal shifted by the shift amount
phypy.modulators module¶
Modulator Module that implements various wireless modulators
These modulators are meant to turn arbitrary bit patterns to analog waveforms for wireless transmission.
-
class
phypy.modulators.
OFDM
(n_subcarriers: int = 1200, subcarrier_spacing: int = 15000, cp_length: int = 144, constellation: str = 'QPSK', seed: int = 0)[source]¶ Bases:
object
Class that creates OFDM signals.
This class will set up an OFDM modulator to create random OFDM signals.
- Attributes:
- n_subcarriers: Number of subcarriers per OFDM symbol subcarrier_spacing: Spacing between subcarriers in Hz cp_length : Number of samples in the cyclic prefix fft_size: Size of the IFFT/FFT used. sampling_rate: The native sampling rate based on the FFT size and subcarrier spacing symbol_alphabet: The constellation points
- Todo:
- Add an arbitrary bit input
- Add a demodulator
-
add_cyclic_prefix
(td_waveform)[source]¶ Adds cyclic prefix
Adds by taking the last few samples and appending it to the beginning of the signal
- Args:
- td_waveform: IFFT output signal.
- Returns:
- time domain signal with a cyclic prefix
-
frequency_to_time_domain
(fd_symbol)[source]¶ Convert the frequency domain symbol to time domain via IFFT
- Args:
- fd_symbol: One frequency domain symbol
- Returns:
- time domain signal
phypy.structures module¶
File for mathematical structures like a memory polynomial
-
class
phypy.structures.
MemoryPolynomial
(order: int = 5, memory_depth: int = 4, memory_stride: int = 1)[source]¶ Bases:
object
-
static
check_for_errors
(order, memory_depth, memory_stride)[source]¶ Check for errors. Must be odd order with positive memory
-
n_coeffs
¶ “Total number of coefficients including the polynomial order and memory depth
-
n_rows
¶ Total number of rows in the coeff matrix
-
perform_least_squares
(x, y)[source]¶ Perform a least squares fit Todo:
- Add support for regularized LS.
-
static
Module contents¶
Top-level package for PhyPy.