API Reference
This page is auto-generated from the docstrings of each submodule under genalyzer.mcp.
Generators
Waveform generator MCP tools.
- genalyzer.mcp.generators.generate_gaussian_noise(num_points: int, mean: float = 0.0, std: float = 0.1, seed: int | None = None, output_path: str | None = None) dict
Generate AWGN samples and save to .npy.
Useful for NSD (noise spectral density) characterization and histogram Gaussian-fit tests.
- genalyzer.mcp.generators.generate_ramp(num_points: int, start: float = -1.0, stop: float = 1.0, output_path: str | None = None) dict
Generate a linear ramp from start to stop and save to .npy.
Useful for DNL and INL characterization. The ramp covers the closed interval [start, stop].
- genalyzer.mcp.generators.generate_real_tone(num_points: int, sample_rate: float, tone_freq: float, amplitude: float = 0.9, phase: float = 0.0, output_path: str | None = None) dict
Generate a real-valued sinusoidal test tone and save to .npy.
Use this for real-only ADC characterization. For complex (IQ) ADCs, prefer generate_test_tone.
- genalyzer.mcp.generators.generate_test_tone(num_points: int, sample_rate: float, tone_freq: float, amplitude: float = 0.9, output_path: str | None = None) dict
Generate a synthetic complex sinusoidal test tone and save to a .npy file.
- Args:
num_points: Number of samples to generate. sample_rate: Sample rate in Hz. tone_freq: Tone frequency in Hz. amplitude: Amplitude (0.0 to 1.0, default 0.9). output_path: Path to save the .npy file. Auto-generated if not provided.
- Returns:
Dictionary with output_path, num_points, sample_rate, and tone_freq.
Quantize
Quantize MCP tool — applies N-bit quantization to a waveform.
- genalyzer.mcp.quantize.quantize(npy_path: str, bits: int, fullscale: float = 1.0, noise: float = 0.0, output_path: str | None = None) dict
Quantize a time-domain waveform to N-bit codes, saving as .npy.
- Args:
npy_path: Path to input .npy or .csv time-domain samples. bits: Number of quantizer bits (e.g. 12, 14, 16). fullscale: Full-scale range of the quantizer (default 1.0). noise: Optional additive-noise standard deviation passed to the native
gn.quantize() call (default 0.0 — ideal quantizer).
output_path: Path to save the quantized .npy. Auto-generated if omitted.
- Returns:
Dictionary with output_path, bits, and fullscale.
Fourier
Fourier-domain analysis MCP tools.
- genalyzer.mcp.fourier.analyze_spectrum(npy_path: str, sample_rate: float, nfft: int | None = None, num_tones: int = 1, max_harmonics: int = 6, window: str = 'no_window', ssb: int = 12, wo: int = 0, plot: bool = False) dict
All-in-one spectral analysis: load data, compute FFT, and return metrics.
When
plot=True, an annotated spectrum PNG is also written next to the input file.
- genalyzer.mcp.fourier.compute_fft(npy_path: str, sample_rate: float, nfft: int | None = None, output_path: str | None = None) dict
Compute FFT of time-domain data stored in a .npy or .csv file.
- Args:
npy_path: Path to input .npy or .csv file containing time-domain samples. sample_rate: Sample rate in Hz. nfft: FFT size. Defaults to the length of the input data. output_path: Path to save the FFT result .npy file. Auto-generated if not provided.
- Returns:
Dictionary with output_path, nfft, and sample_rate.
- genalyzer.mcp.fourier.get_fa_metrics(fft_npy_path: str, sample_rate: float, tone_freq: float, max_harmonics: int = 6, wo: int = 0) dict
Compute frequency analysis metrics from a pre-computed FFT .npy file.
Use this when you already have an FFT artifact and want metrics from it, for example in a sweep pipeline that reuses one FFT across many metric extractions.
Histogram
Histogram and code-density MCP tools.
- genalyzer.mcp.histogram.analyze_histogram(npy_path: str, nbits: int, code_format: str = 'twos_complement', plot: bool = False) dict
Compute histogram analysis metrics from integer code samples.
Returns the four native
gn.hist_analysissummary fields:sum(total sample count),first_nz_index/last_nz_index(first/last non-empty bin), andnz_range(span of populated codes). When plot=True, also render a histogram PNG next to the input file.
- genalyzer.mcp.histogram.compute_histogram(npy_path: str, nbits: int, code_format: str = 'twos_complement', output_path: str | None = None) dict
Compute the code histogram of integer samples.
- Args:
npy_path: Path to .npy/.csv with integer code samples. nbits: Bit depth of the quantizer that produced the data. code_format: “twos_complement” (default) or “offset_binary”. output_path: Path to save histogram .npy. Auto-generated if omitted.
Linearity (DNL / INL)
DNL / INL MCP tools.
- genalyzer.mcp.linearity.analyze_dnl(npy_path: str, nbits: int, signal_type: str = 'tone', code_format: str = 'twos_complement', plot: bool = False) dict
All-in-one DNL analysis from a raw code-samples .npy file.
Loads samples, builds a histogram, computes DNL, returns summary metrics (dnl_max, dnl_min, dnl_abs_max). When plot=True, also renders a DNL PNG.
- genalyzer.mcp.linearity.analyze_inl(npy_path: str, nbits: int, signal_type: str = 'tone', code_format: str = 'twos_complement', fit: str = 'best_fit', plot: bool = False) dict
All-in-one INL analysis from a raw code-samples .npy file.
- genalyzer.mcp.linearity.compute_dnl(hist_npy_path: str, signal_type: str = 'tone', output_path: str | None = None) dict
Compute DNL from a histogram .npy produced by compute_histogram.
- Args:
hist_npy_path: Path to a .npy histogram. signal_type: “tone” (default) or “ramp”. output_path: Path to save DNL .npy. Auto-generated if omitted.
- genalyzer.mcp.linearity.compute_inl(dnl_npy_path: str, fit: str = 'best_fit', output_path: str | None = None) dict
Compute INL from a DNL .npy produced by compute_dnl.
- Args:
dnl_npy_path: Path to a .npy DNL array. fit: “best_fit” (default) or “end_point” (maps to END_FIT). output_path: Path to save INL .npy. Auto-generated if omitted.
Waveform
Time-domain waveform MCP tools.
IO helpers
File IO layer for MCP tools. Handles .npy and .csv transparently.
- genalyzer.mcp.io.load_array(path: str) ndarray
Load a 1-D numpy array from a .npy or .csv file.
Returns a real-valued array for single-column CSV and .npy real arrays, or a complex-valued array for two-column CSV (I,Q) and .npy complex arrays. CSV header detection: if the first cell of row 0 is not a float, row 0 is treated as a header and skipped.