Signal Processing¶
- genalyzer.downsample(a, ratio, interleaved=False)¶
Downsample a waveform
- Args:
a(ndarray) : Input array of typecomplex128,int16,int32, orint64ratio(int) : Downsample ratiointerleaved(double) : If true,ais interleaved I/Q data- Returns:
out(ndarray) :float64,int16,int32, orint64numpyarray consisting of downsampled waveform
- genalyzer.fshift(a, *args)¶
Perform frequency shift
- Args:
a(ndarray) : Input array of typecomplex128,float64,int16,int32, orint64args(list)Additional argumentsIf
ais of typecomplex128orfloat64, then perform frequency shift of interleaved normalized samples with the following interpretation.fs(double) : Sample ratefshift_(double) : Shift frequencyIn this case, if
ais not complex, then a is interpreted to contain interleaved I/Q samples.If
ais of typefloat64, then perform frequency shift of split normalized samples.q(float64) : Quadrature componentfs(double) : Sample ratefshift_(double) : Shift frequencyIn this case,
ais interpreted to be the In-phase component.If
ais of typeint16,int32, orint64, then perform frequency shift of interleaved quantized samples with the following interpretation.n(int) : Resolution (Bitwidth of a)fs(double) : Sample ratefshift_(double) : Shift frequencyfmt(CodeFormat): Code formatIn this case,
ais interpreted to contain interleaved quantized samples.If
ais of typeint16,int32, orint64, then perform frequency shift of split quantized samples with the following interpretation.q(int16,int32, orint64) : Quadrature componentn(int) : Resolution (Bitwidth ofa)fs(double) : Sample ratefshift_(double) : Shift frequencyfmt(CodeFormat): Code formatIn this case,
ais 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 typeint16,int32, orint64n(int) : Resolution (Bitwidth ofa)fmt(CodeFormat): Code format- Returns:
out(ndarray) :float64numpyarray consisting of normalized input waveform
- genalyzer.polyval(a, c)¶
Apply distortion as a polynomial function
- Args:
a(ndarray) : Input array of typefloat64c(ndarray) : Polynomial coefficient array of typefloat64- Returns:
out(ndarray) :float64numpyarray 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 typefloat64fsr(double) : Full-scale range of the waveformn(int) : Resolution (Bitwidth ofa)noise(double) : Quantization Noise RMS levelfmt(CodeFormat): Code format- Returns:
out(ndarray) :int16numpyarray 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 typefloat64fsr(double) : Full-scale range of the waveformn(int) : Resolution (Bitwidth ofa)noise(double) : Quantization Noise RMS levelfmt(CodeFormat): Code format- Returns:
out(ndarray) :int32numpyarray 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 typefloat64fsr(double) : Full-scale range of the waveformn(int) : Resolution (Bitwidth ofa)noise(double) : Quantization Noise RMS levelfmt(CodeFormat): Code format- Returns:
out(ndarray) :int64numpyarray 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 typefloat64fsr(double) : Full-scale range of the waveformn(int) : Resolution (Bitwidth ofa)noise(double) : Quantization Noise RMS levelfmt(CodeFormat): Code format- Returns:
out(ndarray) :numpyarray consisting of quantized input waveform of datatypeint16ifn <= 16,int32otherwise