API Reference¶
API Reference for Genalyzer library.
Table of Contents¶
Enumerations¶
- group Enumerations
Typedefs
-
typedef enum GnAnalysisType GnAnalysisType
GnAnalysisType enumerates analysis types.
-
typedef enum GnCodeFormat GnCodeFormat
GnCodeFormat enumerates binary code formats.
-
typedef enum GnDnlSignal GnDnlSignal
GnDnlSignal enumerates signal types for which DNL can be computed.
-
typedef enum GnFACompTag GnFACompTag
GnFACompTag enumerates Fourier analysis component tags.
-
typedef enum GnFASsb GnFASsb
GnFASsb enumerates the component categories for which the number of single side bins (SSB) can be set.
-
typedef enum GnFreqAxisFormat GnFreqAxisFormat
GnFreqAxisFormat enumerates frequency axis formats.
-
typedef enum GnFreqAxisType GnFreqAxisType
GnFreqAxisType enumerates frequency axis types.
-
typedef enum GnInlLineFit GnInlLineFit
GnInlLineFit enumerates INL line fitting options.
-
typedef enum GnRfftScale GnRfftScale
GnRfftScale enumerates real FFT scaling options.
-
typedef enum GnWindow GnWindow
GnWindow enumerates window functions.
Enums
-
enum GnAnalysisType
GnAnalysisType enumerates analysis types.
Values:
-
enumerator GnAnalysisTypeDNL
DNL (differential nonlinearity)
-
enumerator GnAnalysisTypeFourier
Fourier (FFT)
-
enumerator GnAnalysisTypeHistogram
Histogram.
-
enumerator GnAnalysisTypeINL
INL (integral nonlinearity)
-
enumerator GnAnalysisTypeWaveform
Waveform.
-
enumerator GnAnalysisTypeDNL
-
enum GnCodeFormat
GnCodeFormat enumerates binary code formats.
Values:
-
enumerator GnCodeFormatOffsetBinary
Offset Binary.
-
enumerator GnCodeFormatTwosComplement
Two’s Complement.
-
enumerator GnCodeFormatOffsetBinary
-
enum GnDnlSignal
GnDnlSignal enumerates signal types for which DNL can be computed.
Values:
-
enumerator GnDnlSignalRamp
Ramp.
-
enumerator GnDnlSignalTone
Tone (Sinusoid)
-
enumerator GnDnlSignalRamp
-
enum GnFACompTag
GnFACompTag enumerates Fourier analysis component tags.
Values:
-
enumerator GnFACompTagDC
DC component (always Bin 0)
-
enumerator GnFACompTagSignal
Signal component.
-
enumerator GnFACompTagHD
Harmonic distortion.
-
enumerator GnFACompTagIMD
Intermodulation distortion.
-
enumerator GnFACompTagILOS
Interleaving offset component.
-
enumerator GnFACompTagILGT
Interleaving gain/timing/BW component.
-
enumerator GnFACompTagCLK
Clock component.
-
enumerator GnFACompTagUserDist
User-designated distortion.
-
enumerator GnFACompTagNoise
Noise component (e.g. WorstOther)
-
enumerator GnFACompTagDC
-
enum GnFASsb
GnFASsb enumerates the component categories for which the number of single side bins (SSB) can be set.
Values:
-
enumerator GnFASsbDefault
Default SSB (applies to auto-generated components)
-
enumerator GnFASsbDC
SSB for DC component.
-
enumerator GnFASsbSignal
SSB for Signal components.
-
enumerator GnFASsbWO
SSB for WorstOther components.
-
enumerator GnFASsbDefault
-
enum GnFreqAxisFormat
GnFreqAxisFormat enumerates frequency axis formats.
Values:
-
enumerator GnFreqAxisFormatBins
Bins.
-
enumerator GnFreqAxisFormatFreq
Frequency.
-
enumerator GnFreqAxisFormatNorm
Normalized.
-
enumerator GnFreqAxisFormatBins
-
enum GnFreqAxisType
GnFreqAxisType enumerates frequency axis types.
Values:
-
enumerator GnFreqAxisTypeDcCenter
DC centered, e.g. [-fs/2, fs/2) (complex FFT only)
-
enumerator GnFreqAxisTypeDcLeft
DC on left, e.g. [0, fs) (complex FFT only)
-
enumerator GnFreqAxisTypeReal
Real axis, e.g. [0, fs/2] (real FFT only)
-
enumerator GnFreqAxisTypeDcCenter
-
enum GnInlLineFit
GnInlLineFit enumerates INL line fitting options.
Values:
-
enumerator GnInlLineFitBestFit
Best fit.
-
enumerator GnInlLineFitEndFit
End fit.
-
enumerator GnInlLineFitNoFit
No fit.
-
enumerator GnInlLineFitBestFit
-
enum GnRfftScale
GnRfftScale enumerates real FFT scaling options.
Values:
-
enumerator GnRfftScaleDbfsDc
Full-scale sinusoid measures -3 dBFS.
-
enumerator GnRfftScaleDbfsSin
Full-scale sinusoid measures 0 dBFS.
-
enumerator GnRfftScaleNative
Full-scale sinusoid measures -6 dBFS.
-
enumerator GnRfftScaleDbfsDc
-
enum GnWindow
GnWindow enumerates window functions.
Values:
-
enumerator GnWindowBlackmanHarris
Blackman-Harris.
-
enumerator GnWindowHann
Hann (“Hanning”)
-
enumerator GnWindowNoWindow
No window (Rectangular)
-
enumerator GnWindowBlackmanHarris
-
typedef enum GnAnalysisType GnAnalysisType
API Utilities¶
- group APIUtilities
Functions
-
int gn_analysis_results_key_sizes(size_t *key_sizes, size_t key_sizes_size, GnAnalysisType type)¶
gn_analysis_results_key_sizes
The library string termination setting determines whether or not a null terminator is included in the key sizes. See gn_set_string_termination.
- Parameters:
key_sizes – [out] Key size array pointer
key_sizes_size – [in] Key size array size
type – [in] Analysis type
- Returns:
0 on success, non-zero otherwise
-
int gn_analysis_results_size(size_t *size, GnAnalysisType type)¶
gn_analysis_results_size
- Parameters:
size – [out] Number of key-value result pairs
type – [in] Analysis type
- Returns:
0 on success, non-zero otherwise
-
int gn_enum_value(int *value, const char *enumeration, const char *enumerator)¶
gn_enum_value
- Parameters:
value – [out] Underlying value of enumeration::enumerator
enumeration – [in] Enumeration name
enumerator – [in] Enumerator name
- Returns:
0 on success, non-zero otherwise
-
int gn_error_check(bool *error)¶
gn_error_check
- Parameters:
error – [out] true if an error has occurred; false otherwise
- Returns:
Always returns 0
-
int gn_error_clear()¶
gn_error_clear
- Returns:
Always returns 0
-
int gn_error_string(char *buf, size_t size)¶
gn_error_string
- Parameters:
buf – [out] Pointer to character array
size – [in] Size of character array
- Returns:
0 on success, non-zero otherwise
-
int gn_set_string_termination(bool null_terminated)¶
gn_set_string_termination
Some functions in this library return strings by filling character buffers (arrays) provided by the caller. This function sets a global library setting that determines whether or not strings should be null-terminated. If set to true, functions that return strings will write a ‘\0’ as the last character. In addition, functions that return the size of a string will include the null terminator in the size.
- Parameters:
null_terminated – [in] If true, strings are terminated with ‘\0’
- Returns:
Always returns 0
-
int gn_version_string(char *buf, size_t size)¶
gn_version_string
- Parameters:
buf – [in,out] Pointer to character array
size – [in] Size of character array
- Returns:
0 on success, non-zero otherwise
-
int gn_analysis_results_key_sizes(size_t *key_sizes, size_t key_sizes_size, GnAnalysisType type)¶
Array Operations¶
- group ArrayOperations
Functions
-
int gn_abs(double *out, size_t out_size, const double *in, size_t in_size)¶
gn_abs
- Parameters:
out – [out] Output array pointer
out_size – [in] Output array size
in – [in] Input array pointer
in_size – [in] Input array size
- Returns:
0 on success, non-zero otherwise
-
int gn_angle(double *out, size_t out_size, const double *in, size_t in_size)¶
gn_angle
- Parameters:
out – [out] Output array pointer
out_size – [in] Output array size
in – [in] Input array pointer
in_size – [in] Input array size
- Returns:
0 on success, non-zero otherwise
-
int gn_db(double *out, size_t out_size, const double *in, size_t in_size)¶
gn_db
- Parameters:
out – [out] Output array pointer
out_size – [in] Output array size
in – [in] Input array pointer
in_size – [in] Input array size
- Returns:
0 on success, non-zero otherwise
-
int gn_db10(double *out, size_t out_size, const double *in, size_t in_size)¶
gn_db10
- Parameters:
out – [out] Output array pointer
out_size – [in] Output array size
in – [in] Input array pointer
in_size – [in] Input array size
- Returns:
0 on success, non-zero otherwise
-
int gn_db20(double *out, size_t out_size, const double *in, size_t in_size)¶
gn_db20
- Parameters:
out – [out] Output array pointer
out_size – [in] Output array size
in – [in] Input array pointer
in_size – [in] Input array size
- Returns:
0 on success, non-zero otherwise
-
int gn_norm(double *out, size_t out_size, const double *in, size_t in_size)¶
gn_norm
- Parameters:
out – [out] Output array pointer
out_size – [in] Output array size
in – [in] Input array pointer
in_size – [in] Input array size
- Returns:
0 on success, non-zero otherwise
-
int gn_abs(double *out, size_t out_size, const double *in, size_t in_size)¶
Code Density¶
- group CodeDensity
Functions
-
int gn_code_axis(double *out, size_t size, int n, GnCodeFormat format)¶
gn_code_axis
- Parameters:
out – [out] Array pointer
size – [in] Array size
n – [in] Resolution
format – [in] Code format
- Returns:
0 on success, non-zero otherwise
-
int gn_code_axisx(double *out, size_t size, int64_t min, int64_t max)¶
gn_code_axisx
- Parameters:
out – [out] Array pointer
size – [in] Array size
min – [in] Min code
max – [in] Max code
- Returns:
0 on success, non-zero otherwise
-
int gn_dnl(double *dnl, size_t dnl_size, const uint64_t *hist, size_t hist_size, GnDnlSignal type)¶
gn_dnl
- Parameters:
dnl – [out] Output array pointer
dnl_size – [in] Output array size
hist – [in] Input array pointer
hist_size – [in] Input array size
type – [in] Signal type
- Returns:
0 on success, non-zero otherwise
-
int gn_dnl_analysis(char **rkeys, size_t rkeys_size, double *rvalues, size_t rvalues_size, const double *dnl, size_t dnl_size)¶
gn_dnl_analysis
The results contain the following key-value pairs (see general description of Analysis Routines).
Key
Description
min
Minumum value
max
Maximum value
avg
Average value
rms
RMS value
min_index
Index of first occurence of minimum value
max_index
Index of first occurence of maximum value
first_nm_index
Index of first non-missing code
last_nm_index
Index of last non-missing code
nm_range
Non-missing code range (1 + (last_nm_index - first_nm_index))
- Parameters:
rkeys – [out] Result keys array pointer
rkeys_size – [in] Result keys array size
rvalues – [out] Result values array pointer
rvalues_size – [in] Result values array size
dnl – [in] Input array pointer
dnl_size – [in] Input array size
- Returns:
0 on success, non-zero otherwise
-
int gn_hist16(uint64_t *hist, size_t hist_size, const int16_t *in, size_t in_size, int n, GnCodeFormat format, bool preserve)¶
gn_hist16
- Parameters:
hist – [out] Histogram array pointer
hist_size – [in] Histogram array size
in – [in] Input array pointer
in_size – [in] Input array size
n – [in] Code width (i.e. ADC resolution)
format – [in] Code format
preserve – [in] If true, hist is not cleared before computing the histogram
- Returns:
0 on success, non-zero otherwise
-
int gn_hist32(uint64_t *hist, size_t hist_size, const int32_t *in, size_t in_size, int n, GnCodeFormat format, bool preserve)¶
gn_hist32
- Parameters:
hist – [out] Histogram array pointer
hist_size – [in] Histogram array size
in – [in] Input array pointer
in_size – [in] Input array size
n – [in] Code width (i.e. ADC resolution)
format – [in] Code format
preserve – [in] If true, hist is not cleared before computing the histogram
- Returns:
0 on success, non-zero otherwise
-
int gn_hist64(uint64_t *hist, size_t hist_size, const int64_t *in, size_t in_size, int n, GnCodeFormat format, bool preserve)¶
gn_hist64
- Parameters:
hist – [out] Histogram array pointer
hist_size – [in] Histogram array size
in – [in] Input array pointer
in_size – [in] Input array size
n – [in] Code width (i.e. ADC resolution)
format – [in] Code format
preserve – [in] If true, hist is not cleared before computing the histogram
- Returns:
0 on success, non-zero otherwise
-
int gn_histx16(uint64_t *hist, size_t hist_size, const int16_t *in, size_t in_size, int64_t min, int64_t max, bool preserve)¶
gn_histx16
- Parameters:
hist – [out] Histogram array pointer
hist_size – [in] Histogram array size
in – [in] Input array pointer
in_size – [in] Input array size
min – [in] Min code
max – [in] Max code
preserve – [in] If true, hist is not cleared before computing the histogram
- Returns:
0 on success, non-zero otherwise
-
int gn_histx32(uint64_t *hist, size_t hist_size, const int32_t *in, size_t in_size, int64_t min, int64_t max, bool preserve)¶
gn_histx32
- Parameters:
hist – [out] Histogram array pointer
hist_size – [in] Histogram array size
in – [in] Input array pointer
in_size – [in] Input array size
min – [in] Min code
max – [in] Max code
preserve – [in] If true, hist is not cleared before computing the histogram
- Returns:
0 on success, non-zero otherwise
-
int gn_histx64(uint64_t *hist, size_t hist_size, const int64_t *in, size_t in_size, int64_t min, int64_t max, bool preserve)¶
gn_histx64
- Parameters:
hist – [out] Histogram array pointer
hist_size – [in] Histogram array size
in – [in] Input array pointer
in_size – [in] Input array size
min – [in] Min code
max – [in] Max code
preserve – [in] If true, hist is not cleared before computing the histogram
- Returns:
0 on success, non-zero otherwise
-
int gn_hist_analysis(char **rkeys, size_t rkeys_size, double *rvalues, size_t rvalues_size, const uint64_t *hist, size_t hist_size)¶
gn_hist_analysis
The results contain the following key-value pairs (see general description of Analysis Routines).
Key
Description
sum
Sum of all histogram bins
first_nz_index
First non-zero bin
last_nz_index
Last non-zero bin
nz_range
Non-zero bin range (1 + (last_nz_index - first_nz_index))
- Parameters:
rkeys – [out] Result keys array pointer
rkeys_size – [in] Result keys array size
rvalues – [out] Result values array pointer
rvalues_size – [in] Result values array size
hist – [in] Input array pointer
hist_size – [in] Input array size
- Returns:
0 on success, non-zero otherwise
-
int gn_inl(double *inl, size_t inl_size, const double *dnl, size_t dnl_size, GnInlLineFit fit)¶
gn_inl
- Parameters:
inl – [out] Output array pointer
inl_size – [in] Output array size
dnl – [in] Input array pointer
dnl_size – [in] Input array size
fit – [in] Line fit type
- Returns:
0 on success, non-zero otherwise
-
int gn_inl_analysis(char **rkeys, size_t rkeys_size, double *rvalues, size_t rvalues_size, const double *inl, size_t inl_size)¶
gn_inl_analysis
The results contain the following key-value pairs (see general description of Analysis Routines).
Key
Description
min
Minumum value
max
Maximum value
min_index
Index of first occurence of minimum value
max_index
Index of first occurence of maximum value
- Parameters:
rkeys – [out] Result keys array pointer
rkeys_size – [in] Result keys array size
rvalues – [out] Result values array pointer
rvalues_size – [in] Result values array size
inl – [in] Input array pointer
inl_size – [in] Input array size
- Returns:
0 on success, non-zero otherwise
-
int gn_code_axis(double *out, size_t size, int n, GnCodeFormat format)¶
Code Density Helpers¶
- group CodeDensityHelpers
Functions
-
int gn_code_density_size(size_t *size, int n, GnCodeFormat format)¶
gn_code_density_size
- Parameters:
size – [out] Output array size
n – [in] Code width (i.e. ADC resolution)
format – [in] Code format
- Returns:
0 on success, non-zero otherwise
-
int gn_code_densityx_size(size_t *size, int64_t min, int64_t max)¶
gn_code_densityx_size
- Parameters:
size – [out] Output array size
min – [in] Min code
max – [in] Max code
- Returns:
0 on success, non-zero otherwise
-
int gn_code_density_size(size_t *size, int n, GnCodeFormat format)¶
Fourier Analysis¶
- group FourierAnalysis
Functions
-
int gn_fft_analysis(char **rkeys, size_t rkeys_size, double *rvalues, size_t rvalues_size, const char *cfg_id, const double *in, size_t in_size, size_t nfft, GnFreqAxisType axis_type)¶
gn_fft_analysis returns all Fourier analysis results
The results contain the following key-value pairs (see general description of Analysis Routines).
Key
Description
Units
signaltype
Signal type: 0=Real, 1=Complex
nfft
FFT size
datasize
Data size
fbin
Frequency bin size
Hz
fdata
Data rate
S/s
fsample
Sample rate
S/s
fshift
Shift frequency
Hz
fsnr
Full-scale-to-noise ratio (a.k.a. “SNRFS”)
dB
snr
Signal-to-noise ratio
dB
sinad
Signal-to-noise-and-distortion ratio
dB
sfdr
Spurious-free dynamic range
dB
abn
Average bin noise
dBFS
nsd
Noise spectral density
dBFS/Hz
carrierindex
Order index of the Carrier tone
maxspurindex
Order index of the MaxSpur tone
ab_width
Analysis band width
Hz
ab_i1
Analysis band first index
ab_i2
Analysis band last index
{PREFIX}_nbins
Number of bins associated with PREFIX
{PREFIX}_rss
Root-sum-square associated with PREFIX
{TONEKEY}:orderindex
Tone order index
{TONEKEY}:freq
Tone frequency
Hz
{TONEKEY}:ffinal
Tone final frequency
Hz
{TONEKEY}:fwavg
Tone weighted-average frequency
Hz
{TONEKEY}:i1
Tone first index
{TONEKEY}:i2
Tone last index
{TONEKEY}:nbins
Tone number of bins
{TONEKEY}:inband
0: tone is in-band; 1: tone is out-of-band
{TONEKEY}:mag
Tone magnitude
{TONEKEY}:mag_dbfs
Tone magnitude relative to full-scale
dBFS
{TONEKEY}:mag_dbc
Tone magnitude relative to carrier
dBc
{TONEKEY}:phase
Tone phase
rad
{TONEKEY}:phase_c
Tone phase relative to carrier
rad
- Parameters:
rkeys – [out] Result keys array pointer
rkeys_size – [in] Result keys array size
rvalues – [out] Result values array pointer
rvalues_size – [in] Result values array size
cfg_id – [in] Configuration identifier (filename or object key)
in – [in] Interleaved Re/Im input array pointer
in_size – [in] Input array size
nfft – [in] FFT size
axis_type – [in] Frequency axis type
- Returns:
0 on success, non-zero otherwise
-
int gn_fft_analysis_select(double *rvalues, size_t rvalues_size, const char *cfg_id, const char **rkeys, size_t rkeys_size, const double *in, size_t in_size, size_t nfft, GnFreqAxisType axis_type)¶
gn_fft_analysis_select returns select Fourier analysis results
- Parameters:
rvalues – [out] Result values array pointer
rvalues_size – [in] Result values array size
cfg_id – [in] Configuration identifier (filename or object key)
rkeys – [in] Result keys array pointer
rkeys_size – [in] Result keys array size
in – [in] Interleaved Re/Im input array pointer
in_size – [in] Input array size
nfft – [in] FFT size
axis_type – [in] Frequency axis type
- Returns:
0 on success, non-zero otherwise
-
int gn_fft_analysis_single(double *rvalue, const char *cfg_id, const char *rkey, const double *in, size_t in_size, size_t nfft, GnFreqAxisType axis_type)¶
gn_fft_analysis_single returns a single Fourier analysis result
- Parameters:
rvalue – [out] Result value
cfg_id – [in] Configuration identifier (filename or object key)
rkey – [in] Result key
in – [in] Interleaved Re/Im input array pointer
in_size – [in] Input array size
nfft – [in] FFT size
axis_type – [in] Frequency axis type
- Returns:
0 on success, non-zero otherwise
-
int gn_fft_analysis(char **rkeys, size_t rkeys_size, double *rvalues, size_t rvalues_size, const char *cfg_id, const double *in, size_t in_size, size_t nfft, GnFreqAxisType axis_type)¶
Fourier Analysis Configuration¶
- group FourierAnalysisConfiguration
Functions
-
int gn_fa_analysis_band(const char *obj_key, double center, double width)¶
gn_fa_analysis_band
- Parameters:
obj_key – [in] Object key
center – [in] Analysis band center
width – [in] Analysis band width
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_analysis_band_e(const char *obj_key, const char *center, const char *width)¶
gn_fa_analysis_band_e
- Parameters:
obj_key – [in] Object key
center – [in] Analysis band center expression
width – [in] Analysis band width expression
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_clk(const char *obj_key, const int *clk, size_t clk_size, bool as_noise)¶
gn_fa_clk
- Parameters:
obj_key – [in] Object key
clk – [in] Pointer to array of clock divisors
clk_size – [in] Size of array of clock divisors
as_noise – [in] If true, CLK components will be treated as noise
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_conv_offset(const char *obj_key, bool enable)¶
gn_fa_conv_offset
- Parameters:
obj_key – [in] Object key
enable – [in] If true, enable converter offset
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_create(const char *obj_key)¶
gn_fa_create
- Parameters:
obj_key – [in] Object key
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_dc(const char *obj_key, bool as_dist)¶
gn_fa_dc
- Parameters:
obj_key – [in] Object key
as_dist – [in] If true, treat DC as distortion
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_fdata(const char *obj_key, double f)¶
gn_fa_fdata
- Parameters:
obj_key – [in] Object key
f – [in] fdata
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_fdata_e(const char *obj_key, const char *f)¶
gn_fa_fdata_e
- Parameters:
obj_key – [in] Object key
f – [in] fdata expression
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_fixed_tone(const char *obj_key, const char *comp_key, GnFACompTag tag, double freq, int ssb)¶
gn_fa_fixed_tone
- Parameters:
obj_key – [in] Object key
comp_key – [in] Component key
tag – [in] Tag
freq – [in] Frequency
ssb – [in] Number of single-side bins
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_fixed_tone_e(const char *obj_key, const char *comp_key, GnFACompTag tag, const char *freq, int ssb)¶
gn_fa_fixed_tone_e
- Parameters:
obj_key – [in] Object key
comp_key – [in] Component key
tag – [in] Tag
freq – [in] Frequency expression
ssb – [in] Number of single-side bins
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_fsample(const char *obj_key, double f)¶
gn_fa_fsample
- Parameters:
obj_key – [in] Object key
f – [in] fsample
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_fsample_e(const char *obj_key, const char *f)¶
gn_fa_fsample_e
- Parameters:
obj_key – [in] Object key
f – [in] fsample expression
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_fshift(const char *obj_key, double f)¶
gn_fa_fshift
- Parameters:
obj_key – [in] Object key
f – [in] fshift
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_fshift_e(const char *obj_key, const char *f)¶
gn_fa_fshift_e
- Parameters:
obj_key – [in] Object key
f – [in] fshift expression
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_fund_images(const char *obj_key, bool enable)¶
gn_fa_fund_images
- Parameters:
obj_key – [in] Object key
enable – [in] If true, enable fundamental images
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_hd(const char *obj_key, int n)¶
gn_fa_hd
- Parameters:
obj_key – [in] Object key
n – [in] Order of harmonic distortion, i.e., the maximum harmonic
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_ilv(const char *obj_key, const int *ilv, size_t ilv_size, bool as_noise)¶
gn_fa_ilv
- Parameters:
obj_key – [in] Object key
ilv – [in] Pointer to array of interleaving factors
ilv_size – [in] Size of array of interleaving factors
as_noise – [in] If true, ILV components will be treated as noise
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_imd(const char *obj_key, int n)¶
gn_fa_imd
- Parameters:
obj_key – [in] Object key
n – [in] Order of intermodulation distortion
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_load(char *buf, size_t size, const char *filename, const char *obj_key)¶
gn_fa_load
If obj_key is empty, the object key is derived from filename.
- Parameters:
buf – [out] Pointer to character array
size – [in] Size of character array
filename – [in] Filename
obj_key – [in] Object key
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_max_tone(const char *obj_key, const char *comp_key, GnFACompTag tag, int ssb)¶
gn_fa_max_tone
- Parameters:
obj_key – [in] Object key
comp_key – [in] Component key
tag – [in] Tag
ssb – [in] Number of single-side bins
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_preview(char *buf, size_t size, const char *cfg_id, bool cplx)¶
gn_fa_preview
- Parameters:
buf – [out] Pointer to character array
size – [in] Size of character array
cfg_id – [in] Configuration identifier (filename or object key)
cplx – [in] If true, preview will include complex components
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_quad_errors(const char *obj_key, bool enable)¶
gn_fa_quad_errors
- Parameters:
obj_key – [in] Object key
enable – [in] If true, enable quadrature errors
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_remove_comp(const char *obj_key, const char *comp_key)¶
gn_fa_remove_comp
- Parameters:
obj_key – [in] Object key
comp_key – [in] Component key
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_reset(const char *obj_key)¶
gn_fa_reset
- Parameters:
obj_key – [in] Object key
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_ssb(const char *obj_key, GnFASsb group, int ssb)¶
gn_fa_ssb
- Parameters:
obj_key – [in] Object key
group – [in] SSB group
ssb – [in] Number of single-side bins
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_var(const char *obj_key, const char *name, double value)¶
gn_fa_var
- Parameters:
obj_key – [in] Object key
name – [in] Variable name
value – [in] Variable value
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_wo(const char *obj_key, int n)¶
gn_fa_wo
- Parameters:
obj_key – [in] Object key
n – [in] Number of worst others
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_analysis_band(const char *obj_key, double center, double width)¶
Fourier Analysis Results¶
- group FourierAnalysisResults
Functions
-
int gn_fa_result(double *result, const char **rkeys, size_t rkeys_size, const double *rvalues, size_t rvalues_size, const char *rkey)¶
gn_fa_result
- Parameters:
result – [out] Result associated with rkey
rkeys – [in] Result keys array pointer
rkeys_size – [in] Result keys array size
rvalues – [in] Result values array pointer
rvalues_size – [in] Result values array size
rkey – [in] Key of desired result
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_result_string(char *result, size_t result_size, const char **rkeys, size_t rkeys_size, const double *rvalues, size_t rvalues_size, const char *rkey)¶
gn_fa_result_string
- Parameters:
result – [out] Result string associated with rkey
result_size – [in] Size of result string
rkeys – [in] Result keys array pointer
rkeys_size – [in] Result keys array size
rvalues – [in] Result values array pointer
rvalues_size – [in] Result values array size
rkey – [in] Key of desired result
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_result(double *result, const char **rkeys, size_t rkeys_size, const double *rvalues, size_t rvalues_size, const char *rkey)¶
Fourier Analysis Helpers¶
- group FourierAnalysisHelpers
Functions
-
int gn_fa_load_key_size(size_t *size, const char *filename, const char *obj_key)¶
gn_fa_load_key_size
The library string termination setting determines whether or not a null terminator is included in the size. See gn_set_string_termination.
- Parameters:
size – [out] Number of characters in key
filename – [in] Filename
obj_key – [in] Object key
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_preview_size(size_t *size, const char *cfg_id, bool cplx)¶
gn_fa_preview_size
The library string termination setting determines whether or not a null terminator is included in the size. See gn_set_string_termination.
- Parameters:
size – [out] Number of characters in compenent list string
cfg_id – [in] Configuration identifier (filename or object key)
cplx – [in] If true, list will include complex components
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_result_string_size(size_t *size, const char **rkeys, size_t rkeys_size, const double *rvalues, size_t rvalues_size, const char *rkey)¶
gn_fa_result_string_size
The library string termination setting determines whether or not a null terminator is included in the size. See gn_set_string_termination.
- Parameters:
size – [out] Number of characters result string
rkeys – [in] Result keys array pointer
rkeys_size – [in] Result keys array size
rvalues – [in] Result values array pointer
rvalues_size – [in] Result values array size
rkey – [in] Key of desired result
- Returns:
0 on success, non-zero otherwise
-
int gn_fft_analysis_results_key_sizes(size_t *key_sizes, size_t key_sizes_size, const char *cfg_id, size_t in_size, size_t nfft)¶
gn_fft_analysis_results_key_sizes
The library string termination setting determines whether or not a null terminator is included in the key sizes. See gn_set_string_termination.
- Parameters:
key_sizes – [out] Key size array pointer
key_sizes_size – [in] Key size array size
cfg_id – [in] Configuration identifier (filename or object key)
in_size – [in] Input array size
nfft – [in] FFT size
- Returns:
0 on success, non-zero otherwise
-
int gn_fft_analysis_results_size(size_t *size, const char *cfg_id, size_t in_size, size_t nfft)¶
gn_fft_analysis_results_size
- Parameters:
size – [out] Number of key-value result pairs
cfg_id – [in] Configuration identifier (filename or object key)
in_size – [in] Input array size
nfft – [in] FFT size
- Returns:
0 on success, non-zero otherwise
-
int gn_fa_load_key_size(size_t *size, const char *filename, const char *obj_key)¶
Fourier Transforms¶
- group FourierTransforms
Functions
-
int gn_fft(double *out, size_t out_size, const double *i, size_t i_size, const double *q, size_t q_size, size_t navg, size_t nfft, GnWindow window)¶
gn_fft
- Parameters:
out – [out] Interleaved Re/Im output array pointer
out_size – [in] Output array size
i – [in] In-phase input array pointer
i_size – [in] In-phase input array size
q – [in] Quadrature input array pointer
q_size – [in] Quadrature input array size
navg – [in] FFT averaging number
nfft – [in] FFT size
window – [in] Window
- Returns:
0 on success, non-zero otherwise
-
int gn_fft16(double *out, size_t out_size, const int16_t *i, size_t i_size, const int16_t *q, size_t q_size, int n, size_t navg, size_t nfft, GnWindow window, GnCodeFormat format)¶
gn_fft16
- Parameters:
out – [out] Interleaved Re/Im output array pointer
out_size – [in] Output array size
i – [in] In-phase input array pointer
i_size – [in] In-phase input array size
q – [in] Quadrature input array pointer
q_size – [in] Quadrature input array size
n – [in] Resolution
navg – [in] FFT averaging number
nfft – [in] FFT size
window – [in] Window
format – [in] Code format
- Returns:
0 on success, non-zero otherwise
-
int gn_fft32(double *out, size_t out_size, const int32_t *i, size_t i_size, const int32_t *q, size_t q_size, int n, size_t navg, size_t nfft, GnWindow window, GnCodeFormat format)¶
gn_fft32
- Parameters:
out – [out] Interleaved Re/Im output array pointer
out_size – [in] Output array size
i – [in] In-phase input array pointer
i_size – [in] In-phase input array size
q – [in] Quadrature input array pointer
q_size – [in] Quadrature input array size
n – [in] Resolution
navg – [in] FFT averaging number
nfft – [in] FFT size
window – [in] Window
format – [in] Code format
- Returns:
0 on success, non-zero otherwise
-
int gn_fft64(double *out, size_t out_size, const int64_t *i, size_t i_size, const int64_t *q, size_t q_size, int n, size_t navg, size_t nfft, GnWindow window, GnCodeFormat format)¶
gn_fft64
- Parameters:
out – [out] Interleaved Re/Im output array pointer
out_size – [in] Output array size
i – [in] In-phase input array pointer
i_size – [in] In-phase input array size
q – [in] Quadrature input array pointer
q_size – [in] Quadrature input array size
n – [in] Resolution
navg – [in] FFT averaging number
nfft – [in] FFT size
window – [in] Window
format – [in] Code format
- Returns:
0 on success, non-zero otherwise
-
int gn_rfft(double *out, size_t out_size, const double *in, size_t in_size, size_t navg, size_t nfft, GnWindow window, GnRfftScale scale)¶
gn_rfft
This function will be implemented in the future.
- Parameters:
out – [out] Interleaved Re/Im output array pointer
out_size – [in] Output array size
in – [in] Input array pointer
in_size – [in] Input array size
navg – [in] FFT averaging number
nfft – [in] FFT size
window – [in] Window
scale – [in] Scaling mode
- Returns:
0 on success, non-zero otherwise
-
int gn_rfft16(double *out, size_t out_size, const int16_t *in, size_t in_size, int n, size_t navg, size_t nfft, GnWindow window, GnCodeFormat format, GnRfftScale scale)¶
gn_rfft16
- Parameters:
out – [out] Interleaved Re/Im output array pointer
out_size – [in] Output array size
in – [in] Input array pointer
in_size – [in] Input array size
n – [in] Resolution
navg – [in] FFT averaging number
nfft – [in] FFT size
window – [in] Window
format – [in] Code format
scale – [in] Scaling mode
- Returns:
0 on success, non-zero otherwise
-
int gn_rfft32(double *out, size_t out_size, const int32_t *in, size_t in_size, int n, size_t navg, size_t nfft, GnWindow window, GnCodeFormat format, GnRfftScale scale)¶
gn_rfft32
- Parameters:
out – [out] Interleaved Re/Im output array pointer
out_size – [in] Output array size
in – [in] Input array pointer
in_size – [in] Input array size
n – [in] Resolution
navg – [in] FFT averaging number
nfft – [in] FFT size
window – [in] Window
format – [in] Code format
scale – [in] Scaling mode
- Returns:
0 on success, non-zero otherwise
-
int gn_rfft64(double *out, size_t out_size, const int64_t *in, size_t in_size, int n, size_t navg, size_t nfft, GnWindow window, GnCodeFormat format, GnRfftScale scale)¶
gn_rfft64
- Parameters:
out – [out] Interleaved Re/Im output array pointer
out_size – [in] Output array size
in – [in] Input array pointer
in_size – [in] Input array size
n – [in] Resolution
navg – [in] FFT averaging number
nfft – [in] FFT size
window – [in] Window
format – [in] Code format
scale – [in] Scaling mode
- Returns:
0 on success, non-zero otherwise
-
int gn_fft(double *out, size_t out_size, const double *i, size_t i_size, const double *q, size_t q_size, size_t navg, size_t nfft, GnWindow window)¶
Fourier Transform Helpers¶
- group FourierTransformHelpers
Functions
-
int gn_fft_size(size_t *out_size, size_t i_size, size_t q_size, size_t navg, size_t nfft)¶
gn_fft_size
- Parameters:
out_size – [out] Output array size
i_size – [in] In-phase input array size
q_size – [in] Quadrature input array size
navg – [in] FFT averaging number
nfft – [in] FFT size
- Returns:
0 on success, non-zero otherwise
-
int gn_rfft_size(size_t *out_size, size_t in_size, size_t navg, size_t nfft)¶
gn_rfft_size
- Parameters:
out_size – [out] Output array size
in_size – [in] Input array size
navg – [in] FFT averaging number
nfft – [in] FFT size
- Returns:
0 on success, non-zero otherwise
-
int gn_fft_size(size_t *out_size, size_t i_size, size_t q_size, size_t navg, size_t nfft)¶
Fourier Utilities¶
- group FourierUtilities
Functions
-
int gn_alias(double *out, double fs, double freq, GnFreqAxisType axis_type)¶
gn_alias
- Parameters:
out – [out] Output pointer
fs – [in] Sample rate (S/s)
freq – [in] Frequency (Hz)
axis_type – [in] Frequency axis type
- Returns:
0 on success, non-zero otherwise
-
int gn_coherent(double *out, size_t nfft, double fs, double freq)¶
gn_coherent
- Parameters:
out – [out] Output pointer
nfft – [in] FFT size
fs – [in] Sample rate (S/s)
freq – [in] Desired frequency (Hz)
- Returns:
0 on success, non-zero otherwise
-
int gn_fftshift(double *out, size_t out_size, const double *in, size_t in_size)¶
gn_fftshift
- Parameters:
out – [out] Output array pointer
out_size – [in] Output array size
in – [in] Input array pointer
in_size – [in] Input array size
- Returns:
0 on success, non-zero otherwise
-
int gn_freq_axis(double *out, size_t size, size_t nfft, GnFreqAxisType axis_type, double fs, GnFreqAxisFormat axis_format)¶
gn_freq_axis
- Parameters:
out – [out] Array pointer
size – [in] Array size
nfft – [in] FFT size
axis_type – [in] Frequency axis type
fs – [in] Sample rate (S/s)
axis_format – [in] Frequency axis format
- Returns:
0 on success, non-zero otherwise
-
int gn_ifftshift(double *out, size_t out_size, const double *in, size_t in_size)¶
gn_ifftshift
- Parameters:
out – [out] Output array pointer
out_size – [in] Output array size
in – [in] Input array pointer
in_size – [in] Input array size
- Returns:
0 on success, non-zero otherwise
-
int gn_alias(double *out, double fs, double freq, GnFreqAxisType axis_type)¶
Fourier Utility Helpers¶
- group FourierUtilityHelpers
Functions
-
int gn_freq_axis_size(size_t *size, size_t nfft, GnFreqAxisType axis_type)¶
gn_freq_axis_size
- Parameters:
size – [out] Output array size
nfft – [in] FFT size
axis_type – [in] Frequency axis type
- Returns:
0 on success, non-zero otherwise
-
int gn_freq_axis_size(size_t *size, size_t nfft, GnFreqAxisType axis_type)¶
Manager¶
- group Manager
Functions
-
int gn_mgr_clear()¶
gn_mgr_clear
- Returns:
Always returns 0
-
int gn_mgr_compare(bool *result, const char *obj_key1, const char *obj_key2)¶
gn_mgr_compare
- Parameters:
result – [out] true if the objects are equal, false otherwise
obj_key1 – [in] Object key 1
obj_key2 – [in] Object key 2
- Returns:
0 on success, non-zero otherwise
-
int gn_mgr_contains(bool *result, const char *obj_key)¶
gn_mgr_contains
- Parameters:
result – [out] true if Manager contains key, false otherwise
obj_key – [in] Object key
- Returns:
Always returns 0
-
int gn_mgr_remove(const char *obj_key)¶
gn_mgr_remove
- Parameters:
obj_key – [in] Object key
- Returns:
Always returns 0
-
int gn_mgr_save(char *buf, size_t size, const char *obj_key, const char *filename)¶
gn_mgr_save
If filename is empty, the filename is derived from obj_key.
- Parameters:
buf – [out] Pointer to character array
size – [in] Size of character array
obj_key – [in] Object key
filename – [in] Filename
- Returns:
0 on success, non-zero otherwise
-
int gn_mgr_size(size_t *size)¶
gn_mgr_size
- Parameters:
size – [out] Number of objects owned by the manager
- Returns:
Always returns 0
-
int gn_mgr_to_string(char *buf, size_t size, const char *obj_key)¶
gn_mgr_to_string
- Parameters:
buf – [out] Pointer to character array
size – [in] Size of character array
obj_key – [in] Object key
- Returns:
0 on success, non-zero otherwise
-
int gn_mgr_type(char *buf, size_t size, const char *obj_key)¶
gn_mgr_type
- Parameters:
buf – [out] Pointer to character array
size – [in] Size of character array
obj_key – [in] Object key
- Returns:
0 on success, non-zero otherwise
-
int gn_mgr_clear()¶
Manager Helpers¶
- group ManagerHelpers
Functions
-
int gn_mgr_save_filename_size(size_t *size, const char *obj_key, const char *filename)¶
gn_mgr_save_filename_size
The library string termination setting determines whether or not a null terminator is included in the size. See gn_set_string_termination.
- Parameters:
size – [out] Number of characters in filename
obj_key – [in] Object key
filename – [in] Filename
- Returns:
0 on success, non-zero otherwise
-
int gn_mgr_to_string_size(size_t *size, const char *obj_key)¶
gn_mgr_to_string_size
The library string termination setting determines whether or not a null terminator is included in the size. See gn_set_string_termination.
- Parameters:
size – [out] Number of characters in the string
obj_key – [in] Object key
- Returns:
0 on success, non-zero otherwise
-
int gn_mgr_type_size(size_t *size, const char *obj_key)¶
gn_mgr_type_size
The library string termination setting determines whether or not a null terminator is included in the size. See gn_set_string_termination.
- Parameters:
size – [out] Number of characters in object type string
obj_key – [in] Object key
- Returns:
0 on success, non-zero otherwise
-
int gn_mgr_save_filename_size(size_t *size, const char *obj_key, const char *filename)¶
Signal Processing¶
- group SignalProcessing
Functions
-
int gn_downsample(double *out, size_t out_size, const double *in, size_t in_size, int ratio, bool interleaved)¶
gn_downsample
- Parameters:
out – [out] Output array pointer
out_size – [in] Output array size
in – [in] Input array pointer
in_size – [in] Input array size
ratio – [in] Downsample ratio
interleaved – [in] If true, ‘in’ is interleaved I/Q data
- Returns:
0 on success, non-zero otherwise
-
int gn_downsample16(int16_t *out, size_t out_size, const int16_t *in, size_t in_size, int ratio, bool interleaved)¶
gn_downsample16
- Parameters:
out – [out] Output array pointer
out_size – [in] Output array size
in – [in] Input array pointer
in_size – [in] Input array size
ratio – [in] Downsample ratio
interleaved – [in] If true, ‘in’ is interleaved I/Q data
- Returns:
0 on success, non-zero otherwise
-
int gn_downsample32(int32_t *out, size_t out_size, const int32_t *in, size_t in_size, int ratio, bool interleaved)¶
gn_downsample32
- Parameters:
out – [out] Output array pointer
out_size – [in] Output array size
in – [in] Input array pointer
in_size – [in] Input array size
ratio – [in] Downsample ratio
interleaved – [in] If true, ‘in’ is interleaved I/Q data
- Returns:
0 on success, non-zero otherwise
-
int gn_downsample64(int64_t *out, size_t out_size, const int64_t *in, size_t in_size, int ratio, bool interleaved)¶
gn_downsample64
- Parameters:
out – [out] Output array pointer
out_size – [in] Output array size
in – [in] Input array pointer
in_size – [in] Input array size
ratio – [in] Downsample ratio
interleaved – [in] If true, ‘in’ is interleaved I/Q data
- Returns:
0 on success, non-zero otherwise
-
int gn_fshift(double *out, size_t out_size, const double *i, size_t i_size, const double *q, size_t q_size, double fs, double fshift)¶
gn_fshift
- Parameters:
out – [out] Output array pointer
out_size – [in] Output array size
i – [in] In-phase input array pointer
i_size – [in] In-phase input array size
q – [in] Quadrature input array pointer
q_size – [in] Quadrature input array size
fs – [in] Sample rate
fshift – [in] Shift frequency
- Returns:
0 on success, non-zero otherwise
-
int gn_fshift16(int16_t *out, size_t out_size, const int16_t *i, size_t i_size, const int16_t *q, size_t q_size, int n, double fs, double fshift, GnCodeFormat format)¶
gn_fshift16
- Parameters:
out – [out] Output array pointer
out_size – [in] Output array size
i – [in] In-phase input array pointer
i_size – [in] In-phase input array size
q – [in] Quadrature input array pointer
q_size – [in] Quadrature input array size
n – [in] Code width
fs – [in] Sample rate
fshift – [in] Shift frequency
format – [in] Code format
- Returns:
0 on success, non-zero otherwise
-
int gn_fshift32(int32_t *out, size_t out_size, const int32_t *i, size_t i_size, const int32_t *q, size_t q_size, int n, double fs, double fshift, GnCodeFormat format)¶
gn_fshift32
- Parameters:
out – [out] Output array pointer
out_size – [in] Output array size
i – [in] In-phase input array pointer
i_size – [in] In-phase input array size
q – [in] Quadrature input array pointer
q_size – [in] Quadrature input array size
n – [in] Code width
fs – [in] Sample rate
fshift – [in] Shift frequency
format – [in] Code format
- Returns:
0 on success, non-zero otherwise
-
int gn_fshift64(int64_t *out, size_t out_size, const int64_t *i, size_t i_size, const int64_t *q, size_t q_size, int n, double fs, double fshift, GnCodeFormat format)¶
gn_fshift64
- Parameters:
out – [out] Output array pointer
out_size – [in] Output array size
i – [in] In-phase input array pointer
i_size – [in] In-phase input array size
q – [in] Quadrature input array pointer
q_size – [in] Quadrature input array size
n – [in] Code width
fs – [in] Sample rate
fshift – [in] Shift frequency
format – [in] Code format
- Returns:
0 on success, non-zero otherwise
-
int gn_normalize16(double *out, size_t out_size, const int16_t *in, size_t in_size, int n, GnCodeFormat format)¶
gn_normalize16
- Parameters:
out – [out] Output array pointer
out_size – [in] Output array size
in – [in] Input array pointer
in_size – [in] Input array size
n – [in] Resolution
format – [in] Code format
- Returns:
0 on success, non-zero otherwise
-
int gn_normalize32(double *out, size_t out_size, const int32_t *in, size_t in_size, int n, GnCodeFormat format)¶
gn_normalize32
- Parameters:
out – [out] Output array pointer
out_size – [in] Output array size
in – [in] Input array pointer
in_size – [in] Input array size
n – [in] Resolution
format – [in] Code format
- Returns:
0 on success, non-zero otherwise
-
int gn_normalize64(double *out, size_t out_size, const int64_t *in, size_t in_size, int n, GnCodeFormat format)¶
gn_normalize64
- Parameters:
out – [out] Output array pointer
out_size – [in] Output array size
in – [in] Input array pointer
in_size – [in] Input array size
n – [in] Resolution
format – [in] Code format
- Returns:
0 on success, non-zero otherwise
-
int gn_polyval(double *out, size_t out_size, const double *in, size_t in_size, const double *c, size_t c_size)¶
gn_polyval
- Parameters:
out – [out] Output array pointer
out_size – [in] Output array size
in – [in] Input array pointer
in_size – [in] Input array size
c – [in] Coefficient array pointer
c_size – [in] Coefficient array size
- Returns:
0 on success, non-zero otherwise
-
int gn_quantize16(int16_t *out, size_t out_size, const double *in, size_t in_size, double fsr, int n, double noise, GnCodeFormat format)¶
gn_quantize16
- Parameters:
out – [out] Output array pointer
out_size – [in] Output array size
in – [in] Input array pointer
in_size – [in] Input array size
fsr – [in] Full-scale range
n – [in] Resolution
noise – [in] Input referred RMS noise
format – [in] Code format
- Returns:
0 on success, non-zero otherwise
-
int gn_quantize32(int32_t *out, size_t out_size, const double *in, size_t in_size, double fsr, int n, double noise, GnCodeFormat format)¶
gn_quantize32
- Parameters:
out – [out] Output array pointer
out_size – [in] Output array size
in – [in] Input array pointer
in_size – [in] Input array size
fsr – [in] Full-scale range
n – [in] Resolution
noise – [in] Input referred RMS noise
format – [in] Code format
- Returns:
0 on success, non-zero otherwise
-
int gn_quantize64(int64_t *out, size_t out_size, const double *in, size_t in_size, double fsr, int n, double noise, GnCodeFormat format)¶
gn_quantize64
- Parameters:
out – [out] Output array pointer
out_size – [in] Output array size
in – [in] Input array pointer
in_size – [in] Input array size
fsr – [in] Full-scale range
n – [in] Resolution
noise – [in] Input referred RMS noise
format – [in] Code format
- Returns:
0 on success, non-zero otherwise
-
int gn_downsample(double *out, size_t out_size, const double *in, size_t in_size, int ratio, bool interleaved)¶
Signal Processing Helpers¶
- group SignalProcessingHelpers
Functions
-
int gn_downsample_size(size_t *out_size, size_t in_size, int ratio, bool interleaved)¶
gn_downsample_size
- Parameters:
out_size – [out] Output array size
in_size – [in] Input array size
ratio – [in] Downsample ratio
interleaved – [in] If bool, ‘in’ is interleaved I/Q data
- Returns:
0 on success, non-zero otherwise
-
int gn_fshift_size(size_t *out_size, size_t i_size, size_t q_size)¶
gn_fshift_size
- Parameters:
out_size – [out] Output array size
i_size – [in] In-phase input array size
q_size – [in] Quadrature input array size
- Returns:
0 on success, non-zero otherwise
-
int gn_downsample_size(size_t *out_size, size_t in_size, int ratio, bool interleaved)¶
Waveforms¶
- group Waveforms
Functions
-
int gn_cos(double *out, size_t size, double fs, double ampl, double freq, double phase, double td, double tj)¶
gn_cos
- Parameters:
out – [out] Array pointer
size – [in] Array size
fs – [in] Sample rate (S/s)
ampl – [in] Amplitude
freq – [in] Frequency (Hz)
phase – [in] Phase (rad)
td – [in] Time delay (s)
tj – [in] RMS Aperture jitter (s)
- Returns:
0 on success, non-zero otherwise
-
int gn_gaussian(double *out, size_t size, double mean, double sd)¶
gn_gaussian
- Parameters:
out – [out] Array pointer
size – [in] Array size
mean – [in] Mean
sd – [in] Standard deviation
- Returns:
0 on success, non-zero otherwise
-
int gn_ramp(double *out, size_t size, double start, double stop, double noise)¶
gn_ramp
- Parameters:
out – [out] Array pointer
size – [in] Array size
start – [in] Start value
stop – [in] Stop value
noise – [in] RMS noise
- Returns:
0 on success, non-zero otherwise
-
int gn_sin(double *out, size_t size, double fs, double ampl, double freq, double phase, double td, double tjrms)¶
gn_sin
- Parameters:
out – [out] Array pointer
size – [in] Array size
fs – [in] Sample rate (S/s)
ampl – [in] Amplitude
freq – [in] Frequency (Hz)
phase – [in] Phase (rad)
td – [in] Time delay (s)
tjrms – [in] RMS Aperture jitter (s)
- Returns:
0 on success, non-zero otherwise
-
int gn_wf_analysis(char **rkeys, size_t rkeys_size, double *rvalues, size_t rvalues_size, const double *in, size_t in_size)¶
gn_wf_analysis
The results contain the following key-value pairs (see general description of Analysis Routines).
Key
Description
min
Minumum value
max
Maximum value
mid
Middle value ((max + min) / 2)
range
Range (max - min)
avg
Average value
rms
RMS value
rmsac
RMS value with DC removed
min_index
Index of first occurence of minimum value
max_index
Index of first occurence of maximum value
- Parameters:
rkeys – [out] Result keys array pointer
rkeys_size – [in] Result keys array size
rvalues – [out] Result values array pointer
rvalues_size – [in] Result values array size
in – [in] Waveform array pointer
in_size – [in] Waveform array size
- Returns:
0 on success, non-zero otherwise
-
int gn_wf_analysis16(char **rkeys, size_t rkeys_size, double *rvalues, size_t rvalues_size, const int16_t *in, size_t in_size)¶
gn_wf_analysis16
See description of gn_wf_analysis.
- Parameters:
rkeys – [out] Result keys array pointer
rkeys_size – [in] Result keys array size
rvalues – [out] Result values array pointer
rvalues_size – [in] Result values array size
in – [in] Waveform array pointer
in_size – [in] Waveform array size
- Returns:
0 on success, non-zero otherwise
-
int gn_wf_analysis32(char **rkeys, size_t rkeys_size, double *rvalues, size_t rvalues_size, const int32_t *in, size_t in_size)¶
gn_wf_analysis32
See description of gn_wf_analysis.
- Parameters:
rkeys – [out] Result keys array pointer
rkeys_size – [in] Result keys array size
rvalues – [out] Result values array pointer
rvalues_size – [in] Result values array size
in – [in] Waveform array pointer
in_size – [in] Waveform array size
- Returns:
0 on success, non-zero otherwise
-
int gn_wf_analysis64(char **rkeys, size_t rkeys_size, double *rvalues, size_t rvalues_size, const int64_t *in, size_t in_size)¶
gn_wf_analysis64
See description of gn_wf_analysis.
- Parameters:
rkeys – [out] Result keys array pointer
rkeys_size – [in] Result keys array size
rvalues – [out] Result values array pointer
rvalues_size – [in] Result values array size
in – [in] Waveform array pointer
in_size – [in] Waveform array size
- Returns:
0 on success, non-zero otherwise
-
int gn_cos(double *out, size_t size, double fs, double ampl, double freq, double phase, double td, double tj)¶