pyDataconverter
A Python toolbox for modeling and analyzing Data Converters (ADCs and DACs) and their performance metrics.
Features
-
Signal Generation
- Sine waves, ramps, and multi-tone signals
- Support for both single-ended and differential signals
- Configurable signal parameters (frequency, amplitude, etc.)
-
Data Converter Modeling
- Base ADC class with extensible architecture
- Support for various ADC architectures (SAR, Pipeline, etc.)
- Configurable parameters (resolution, reference voltage, etc.)
-
Analysis Tools
- Dynamic performance metrics (SNR, SFDR, THD, etc.)
- Static performance metrics (DNL, INL, etc.)
- Spectral analysis with FFT tools
- Histogram analysis for both uniform and sine wave inputs
Installation
git clone https://github.com/yourusername/pyDataconverter.git
cd pyDataconverter
pip install -e .
This can also be installed as a python module with pip install pyDataconverter
Quick Start
from pyDataconverter import SimpleADC
from pyDataconverter.utils.signal_gen import generate_sine
from pyDataconverter.utils.metrics import calculate_dynamic_metrics
# Create ADC instance
adc = SimpleADC(n_bits=12, v_ref=1.0)
# Generate test signal
fs = 1e6 # 1 MHz sampling rate
f_in = 10e3 # 10 kHz input
signal = generate_sine(f_in, fs, amplitude=0.9)
# Convert signal
output = [adc.convert(v) for v in signal]
# Calculate metrics
metrics = calculate_dynamic_metrics(output, fs, f_in)
print(f"SNDR: {metrics['SNDR']:.1f} dB")
print(f"SFDR: {metrics['SFDR']:.1f} dB")
print(f"THD: {metrics['THD']:.1f} dB")
Documentation
Signal Generation
# Generate single tone
signal = generate_sine(frequency=10e3,
sampling_rate=1e6,
amplitude=0.9)
# Generate two-tone signal
signal = generate_two_tone(f1=10e3,
f2=11e3,
sampling_rate=1e6)
# Generate differential signals
v_pos, v_neg = convert_to_differential(signal, vcm=0.5)
Analysis Functions
Dynamic Metrics
metrics = calculate_dynamic_metrics(
time_data=output,
fs=1e6,
f0=10e3,
full_scale=1.0 # Optional: for dBFS results
)
Static Metrics
metrics = calculate_static_metrics(
input_voltages=ramp_in,
output_codes=codes,
n_bits=12
)
Histogram Analysis
hist = calculate_histogram(
codes=output_codes,
n_bits=12,
input_type='sine',
remove_pdf=True
)
Project Structure
pyDataconverter/
├── __init__.py
├── architectures/ # Data converter architecture implementations
├── examples/ # Example files that illustrate usage
├── utils/ # Utility functions
└── analysis/ # Analysis tools
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the GPL-3.0 license - see the LICENSE file for details.
Metadata
Release files for pyDataconverter 0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pydataconverter-0.3.tar.gz | 63.1 kB | Without provenance | Details for pydataconverter-0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pydataconverter-0.3-py3-none-any.whl | Python 3 | none | any | Details for pydataconverter-0.3-py3-none-any.whl |
Total release size: 111.3 kB
Release files / pydataconverter-0.3.tar.gz
| Download URL | pydataconverter-0.3.tar.gz |
|---|---|
| Size | 63.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f9b0ef0d47b999fdbf2a00f5b4f80f777af14d03b14202ac0dd2543e90fa3792
|
|
BLAKE2b-256 checksum How to use checksums |
6d28e115526ee9a563a39037a8c3ad5cca225b2014a43702d3ee327f875c2c17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / pydataconverter-0.3-py3-none-any.whl
| Download URL | pydataconverter-0.3-py3-none-any.whl |
|---|---|
| Size | 48.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ec18c09b71ec8a76336be486cf2790deabc36743568beba67d586844feed5067
|
|
BLAKE2b-256 checksum How to use checksums |
fe8f5ec13ed15e3c764b1244a6bc31054a2993bee02306dfebf4f6688de38cda
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for pyDataconverter 0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.