A Python toolbox for modeling and analyzing data converters
Project description
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 MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydataconverter-0.2.tar.gz.
File metadata
- Download URL: pydataconverter-0.2.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0233883f9009ca37c5dc29ef1f3e17cb738d73e11199ff9f301e3be87a98436
|
|
| MD5 |
3a40ff0eab60e0c2d57dfbf3d302c43c
|
|
| BLAKE2b-256 |
8e3aab1b25588dc8a5bcd33e32acaef3f6abf3048a13ea24c230ad62674fbea8
|
File details
Details for the file pydataconverter-0.2-py3-none-any.whl.
File metadata
- Download URL: pydataconverter-0.2-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37d79886b44254cb82a334d2731cc86b1c8dcc158a88b77e0e648014ec2c7cdf
|
|
| MD5 |
0d847d94e7ddc62b74eaf339e8497757
|
|
| BLAKE2b-256 |
191ac75a1a31a3ae0c79177662e5e4407e182dc927f87623c650d1c11ad0586c
|
File details
Details for the file pyDataconverter-0.2-py3-none-any.whl.
File metadata
- Download URL: pyDataconverter-0.2-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1de78a8962c52e533e33d356a381f066c159848bbd08a41ae1144b4e03c9c0ec
|
|
| MD5 |
04ef61b34523c860738fba8c3d4c56a0
|
|
| BLAKE2b-256 |
d9ec0880c61c21bcb3f4d6173581388643e5c84e9b21a7b9c53706d1c9282550
|