Fourier Analysis Configuration¶
- genalyzer.fa_analysis_band(test_key, center, width)¶
Set the analysis band, limiting metric computations to a specific frequency range.
Only spectral content within [center - width/2, center + width/2] is included in SNR, SINAD, and other metrics.
- Args:
test_key(str) : Test key (key to a Fourier Analysis object)center(floatorstr) : Analysis band center in Hz, or an expression string referencing variableswidth(floatorstr) : Analysis band width in Hz, or an expression string referencing variables
- genalyzer.fa_clk(test_key, x, as_noise=False)¶
Configure clock sub-harmonic divisors for identifying clock spurs.
For each divisor d in x, spurs at fs/d and its harmonics are identified and tagged as CLK components. If as_noise is True, these are classified as noise rather than distortion.
- Args:
test_key(str) : Test key (key to a Fourier Analysis object)x(listofint) : Clock divisorsas_noise(bool) : If True, CLK components are classified as noise instead of distortion
- genalyzer.fa_conv_offset(test_key, enable)¶
Enable or disable the converter offset component.
When enabled, a tone at the converter offset frequency is identified in the spectrum.
- Args:
test_key(str) : Test key (key to a Fourier Analysis object)enable(bool) : If True, enable the converter offset component
- genalyzer.fa_create(test_key)¶
Create a new Fourier analysis configuration object.
Registers the object in the global object manager under the given key. This must be called before any other
fa_*configuration functions.- Args:
test_key(str) : Test key under which to register the object
- genalyzer.fa_dc(test_key, as_dist)¶
Control whether the DC component (bin 0) is classified as distortion or noise.
By default, DC is treated as noise. Setting as_dist=True includes DC power in distortion metrics like THD.
- Args:
test_key(str) : Test key (key to a Fourier Analysis object)as_dist(bool) : If True, classify DC as distortion; if False, classify as noise
- genalyzer.fa_fdata(test_key, f)¶
Set the data rate (effective sample rate of the signal).
In systems with digital downconversion, fdata may differ from fsample.
- Args:
test_key(str) : Test key (key to a Fourier Analysis object)f(floatorstr) : Data rate in S/s, or an expression string referencing variables
- genalyzer.fa_fixed_tone(test_key, comp_key, tag, freq, ssb=-1)¶
Add a tone component at a specific frequency.
The tone is identified by comp_key and classified according to tag (SIGNAL, HD, IMD, etc.).
- Args:
test_key(str) : Test key (key to a Fourier Analysis object)comp_key(str) : Unique identifier for this componenttag(FaCompTag) : Component classification tagfreq(floatorstr) : Tone frequency in Hz, or an expression string referencing variablesssb(int) : Number of single-side bins (-1 uses the group default)
- genalyzer.fa_fsample(test_key, f)¶
Set the sample rate of the ADC.
- Args:
test_key(str) : Test key (key to a Fourier Analysis object)f(floatorstr) : Sample rate in S/s, or an expression string referencing variables
- genalyzer.fa_fshift(test_key, f)¶
Set the cumulative frequency shift applied to the signal after sampling.
Used to account for digital downconversion or other frequency translation applied after the ADC.
- Args:
test_key(str) : Test key (key to a Fourier Analysis object)f(floatorstr) : Shift frequency in Hz, or an expression string referencing variables
- genalyzer.fa_fund_images(test_key, enable)¶
Enable or disable fundamental image components in complex FFT analysis.
When enabled, the image of each signal tone is identified and classified.
- Args:
test_key(str) : Test key (key to a Fourier Analysis object)enable(bool) : If True, enable fundamental image components
- genalyzer.fa_hd(test_key, n)¶
Set the maximum harmonic distortion order.
Harmonics 2 through n of each signal tone are automatically generated and tracked. For example, n=5 tracks HD2 through HD5.
- Args:
test_key(str) : Test key (key to a Fourier Analysis object)n(int) : Maximum harmonic order
- genalyzer.fa_ilv(test_key, x, as_noise=False)¶
Configure interleaving factors for identifying interleaving spurs.
For each factor f in x, offset and gain/timing spurs at fs/f offsets from signal tones are tracked. If as_noise is True, these are classified as noise rather than distortion.
- Args:
test_key(str) : Test key (key to a Fourier Analysis object)x(listofint) : Interleaving factorsas_noise(bool) : If True, interleaving spurs are classified as noise instead of distortion
- genalyzer.fa_imd(test_key, n)¶
Set the maximum intermodulation distortion order.
When multiple signal tones are present, IMD products up to order n are automatically generated and tracked.
- Args:
test_key(str) : Test key (key to a Fourier Analysis object)n(int) : Maximum intermodulation distortion order
- genalyzer.fa_load(filename, test_key='')¶
Load a Fourier analysis configuration from a JSON file.
Registers the loaded object in the global object manager and returns the key under which it was registered.
- Args:
filename(str) : Path to the JSON configuration filetest_key(str) : Optional key to register the object under (if empty, uses key from file)- Returns:
str: The key under which the object was registered
- genalyzer.fa_max_tone(test_key, comp_key, tag, ssb=-1)¶
Add a tone component located at the maximum magnitude in the spectrum.
The tone is placed at the largest spectral bin not already assigned to another component. Useful for finding the strongest signal when its exact frequency is unknown.
- Args:
test_key(str) : Test key (key to a Fourier Analysis object)comp_key(str) : Unique identifier for this componenttag(FaCompTag) : Component classification tagssb(int) : Number of single-side bins (-1 uses the group default)
- genalyzer.fa_preview(test_key, cplx=False)¶
Return a string showing the current analysis configuration.
Displays all defined components and their frequencies. Useful for verifying configuration before running analysis.
- Args:
test_key(str) : Test key (key to a Fourier Analysis object)cplx(bool) : If True, include complex-specific components in the preview- Returns:
str: Formatted string representation of the analysis configuration
- genalyzer.fa_quad_errors(test_key, enable)¶
Enable or disable quadrature error components in complex FFT analysis.
When enabled, image and gain/phase imbalance tones are identified and classified in the spectrum.
- Args:
test_key(str) : Test key (key to a Fourier Analysis object)enable(bool) : If True, enable quadrature error components
- genalyzer.fa_remove_comp(test_key, comp_key)¶
Remove a previously added component from the analysis configuration.
- Args:
test_key(str) : Test key (key to a Fourier Analysis object)comp_key(str) : Key of the component to remove
- genalyzer.fa_reset(test_key)¶
Reset the Fourier analysis object to its default configuration.
Removes all user-defined components and variables.
- Args:
test_key(str) : Test key (key to a Fourier Analysis object)
- genalyzer.fa_ssb(test_key, group, n)¶
Set the number of single-side bins (SSB) for a component group.
Each tone occupies 2*n+1 FFT bins total (n bins on each side of the center bin plus the center bin itself). Windowed FFTs require SSB > 0 to capture spectral leakage.
- Args:
test_key(str) : Test key (key to a Fourier Analysis object)group(FaSsb) : Component group (DEFAULT, DC, SIGNAL, or WO)n(int) : Number of single-side bins
- genalyzer.fa_ssb_dc(test_key, n)¶
Configure number of single-side bins for DC.
Deprecated since version Use:
fa_ssb(test_key, FaSsb.DC, n)instead.- Args:
test_key(str) : Test key (key to a Fourier Analysis object)n(int) : Number of single-side bins
- genalyzer.fa_ssb_def(test_key, n)¶
Configure default number of single-side bins for auto-generated components.
Deprecated since version Use:
fa_ssb(test_key, FaSsb.DEFAULT, n)instead.- Args:
test_key(str) : Test key (key to a Fourier Analysis object)n(int) : Number of single-side bins
- genalyzer.fa_ssb_wo(test_key, n)¶
Configure number of single-side bins for WO components.
Deprecated since version Use:
fa_ssb(test_key, FaSsb.WO, n)instead.- Args:
test_key(str) : Test key (key to a Fourier Analysis object)n(int) : Number of single-side bins
- genalyzer.fa_var(test_key, name, value)¶
Set the value of an expression variable.
Variables can be referenced in frequency expressions used by
fa_fdata,fa_fsample,fa_fshift, andfa_fixed_tone. For example, set variable “fs” to 1e9 and use “fs” in expressions.- Args:
test_key(str) : Test key (key to a Fourier Analysis object)name(str) : Variable namevalue(float) : Variable value
- genalyzer.fa_wo(test_key, n)¶
Set the number of worst-other (WO) tones to identify.
WO tones are the n largest spectral components not classified as signal, harmonic, IMD, interleaving, or clock components. The largest WO tone determines SFDR.
- Args:
test_key(str) : Test key (key to a Fourier Analysis object)n(int) : Number of worst-other tones to track