signal_quality#
Functions for calculating various signal quality metrics
- qampy.core.signal_quality.cal_evm(sig, M, known=None)#
Calculation of the linear Error Vector Magnitude for an M-QAM signal.
- Parameters:
sig (array_like) – input signal
M (int) – QAM order
known (array_like) – the error-free symbols
- Returns:
evm – Error Vector Magnitude
- Return type:
float
- qampy.core.signal_quality.cal_mi(signal, symbols_tx, alphabet, N0, fast=True)#
Calculate the mutual information for a given (noisy) signal array and the transmitted symbol array.
- Parameters:
signal (array_like) – The signal after transmission to calculate the MI for
symbols_tx (array_like) – The original symbols that were transmitted
alphabet (array_like) – The symbol alphabet
N0 (float) – The noise strength of the signal in linear units
fast (bool) – Use fast calculation
- Returns:
mi – The calculated mutual information
- Return type:
float
- qampy.core.signal_quality.cal_s0(E, M)#
Calculate the signal power S0 according to formula given in Gao and Tepedelenlioglu in IEEE Trans in Signal Processing Vol 53, pg 865 (2005).
Parameters:#
- Earray_like
input field
M: : int
Returns:#
- S0float
signal power estimate
- qampy.core.signal_quality.cal_ser_qam(data_rx, symbol_tx, M, method='pyx')#
Calculate the symbol error rate
- Parameters:
data_rx (array_like) – received signal
symbols_tx (array_like) – original symbols
M (int) – QAM order
method (string, option) – method to use for decision making (either af for arrayfire or pyx for cython)
- Returns:
SER – Symbol error rate estimate
- Return type:
float
- qampy.core.signal_quality.cal_snr_blind_qpsk(E)#
Calculates the SNR of a QPSK signal based on the variance of the constellation assmuing no symbol errors
- qampy.core.signal_quality.cal_snr_qam(E, M)#
Calculate the signal to noise ratio SNR according to formula given in _[1]
Parameters:#
- Earray_like
input field
- M:int
order of the QAM constallation
Returns:#
- S0/N:float
linear SNR estimate
References:#
…[1] Gao and Tepedelenlioglu in IEEE Trans in Signal Processing Vol 53, pg 865 (2005).
- qampy.core.signal_quality.make_decision(signal, symbols, method='pyt', **kwargs)#
Quantize signal array onto symbols.
- Parameters:
signal (array_like) – input signal array
symbols (array_like) – array of symbols to quantize onto
method (string, optional) – what method to use (‘af’ for arrayfire or ‘pyx’ for python)
kwargs – keyword arguments passed to pyx or af functions
- Returns:
out – array of quantized symbols
- Return type:
array_like