Signal Processing

genalyzer.downsample(a, ratio, interleaved=False)

Downsample a waveform

Args:

a (ndarray) : Input array of type complex128, int16, int32, or int64

ratio (int) : Downsample ratio

interleaved (double) : If true, a is interleaved I/Q data

Returns:

out (ndarray) : float64, int16, int32, or int64 numpy array consisting of downsampled waveform

genalyzer.fshift(a, *args)

Perform frequency shift

Args:

a (ndarray) : Input array of type complex128, float64, int16, int32, or int64

args (list)Additional arguments
  1. If a is of type complex128 or float64, then perform frequency shift of interleaved normalized samples with the following interpretation.

    fs (double) : Sample rate

    fshift_ (double) : Shift frequency

    In this case, if a is not complex, then a is interpreted to contain interleaved I/Q samples.

  2. If a is of type float64, then perform frequency shift of split normalized samples.

    q (float64) : Quadrature component

    fs (double) : Sample rate

    fshift_ (double) : Shift frequency

    In this case, a is interpreted to be the In-phase component.

  3. If a is of type int16, int32, or int64, then perform frequency shift of interleaved quantized samples with the following interpretation.

    n (int) : Resolution (Bitwidth of a)

    fs (double) : Sample rate

    fshift_ (double) : Shift frequency

    fmt (CodeFormat): Code format

    In this case, a is interpreted to contain interleaved quantized samples.

  4. If a is of type int16, int32, or int64, then perform frequency shift of split quantized samples with the following interpretation.

    q (int16, int32, or int64) : Quadrature component

    n (int) : Resolution (Bitwidth of a)

    fs (double) : Sample rate

    fshift_ (double) : Shift frequency

    fmt (CodeFormat): Code format

    In this case, a is interpreted to to be the In-phase component.

Returns:

out (ndarray) : Frequency-shifted input waveform. The output datatype is the same as the input datatype.

genalyzer.normalize(a, n, fmt=CodeFormat.TWOS_COMPLEMENT)

Normalize a waveform

Args:

a (ndarray) : Input array of type int16, int32, or int64

n (int) : Resolution (Bitwidth of a)

fmt (CodeFormat): Code format

Returns:

out (ndarray) : float64 numpy array consisting of normalized input waveform

genalyzer.polyval(a, c)

Apply distortion as a polynomial function

Args:

a (ndarray) : Input array of type float64

c (ndarray) : Polynomial coefficient array of type float64

Returns:

out (ndarray) : float64 numpy array consisting of distorted input waveform

genalyzer.quantize16(a, fsr, n, noise=0.0, fmt=CodeFormat.TWOS_COMPLEMENT)

Quantize a floating-point waveform

Args:

a (ndarray) : Input array of type float64

fsr (double) : Full-scale range of the waveform

n (int) : Resolution (Bitwidth of a)

noise (double) : Quantization Noise RMS level

fmt (CodeFormat): Code format

Returns:

out (ndarray) : int16 numpy array consisting of quantized input waveform

genalyzer.quantize32(a, fsr, n, noise=0.0, fmt=CodeFormat.TWOS_COMPLEMENT)

Quantize a floating-point waveform

Args:

a (ndarray) : Input array of type float64

fsr (double) : Full-scale range of the waveform

n (int) : Resolution (Bitwidth of a)

noise (double) : Quantization Noise RMS level

fmt (CodeFormat): Code format

Returns:

out (ndarray) : int32 numpy array consisting of quantized input waveform

genalyzer.quantize64(a, fsr, n, noise=0.0, fmt=CodeFormat.TWOS_COMPLEMENT)

Quantize a floating-point waveform

Args:

a (ndarray) : Input array of type float64

fsr (double) : Full-scale range of the waveform

n (int) : Resolution (Bitwidth of a)

noise (double) : Quantization Noise RMS level

fmt (CodeFormat): Code format

Returns:

out (ndarray) : int64 numpy array consisting of quantized input waveform

genalyzer.quantize(a, fsr, n, noise=0.0, fmt=CodeFormat.TWOS_COMPLEMENT)

Quantize a floating-point waveform

Args:

a (ndarray) : Input array of type float64

fsr (double) : Full-scale range of the waveform

n (int) : Resolution (Bitwidth of a)

noise (double) : Quantization Noise RMS level

fmt (CodeFormat): Code format

Returns:

out (ndarray) : numpy array consisting of quantized input waveform of datatype int16 if n <= 16, int32 otherwise