-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from fronzbot/dev
Release 0.1.0
- Loading branch information
Showing
21 changed files
with
693 additions
and
395 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
name: Bug Report | ||
about: Create a bug report about an issue with the library | ||
|
||
--- | ||
|
||
|
||
**Describe the bug** | ||
|
||
<INSERT TEXT HERE> | ||
|
||
**To Reproduce** | ||
|
||
Steps to reproduce the behavior: | ||
|
||
1. | ||
2. | ||
3. | ||
|
||
**Expected Behavior** | ||
|
||
<INSERT TEXT HERE> | ||
|
||
**python-adc-eval version:** <Library version> | ||
|
||
**Additional Information** | ||
|
||
<Any other information relevent to the bug report> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest a new feature for this library to support | ||
|
||
--- | ||
|
||
**Description** | ||
|
||
<Clear and concise description of the feature> | ||
|
||
**Additional Information** | ||
|
||
<Additional information relevent to the feature request.> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: pip | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
open-pull-requests-limit: 10 | ||
reviewers: | ||
- fronzbot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: [main, dev] | ||
pull_request: | ||
branches: [main, dev] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.9] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install -r requirements_test.txt | ||
- name: Lint | ||
run: | | ||
tox -r -e lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Upload Python Package | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: '3.9' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install twine build | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
python -m build | ||
twine upload dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
__pycache__ | ||
__pycache__ | ||
.tox | ||
python_adc_eval.egg-info | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Kevin Fronczak | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
include README.rst | ||
include LICENSE | ||
include requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
python-adc-eval |Lint| |PyPi Version| |Codestyle| | ||
=================================================== | ||
|
||
A python-based ADC evaluation tool, suitable for standalone or library-based usage | ||
|
||
Details | ||
-------- | ||
|
||
Package based on | ||
`esynr3z/adc-eval <https://github.com/esynr3z/adc-eval>`__ | ||
|
||
Tiny tools collection (Python | ||
`NumPy <https://numpy.org/>`__\ +\ `Matplotlib <https://matplotlib.org/>`__ | ||
based) to do spectral analysis and calculate the key performance | ||
parameters of an ADC. Just collect some data from the ADC, specify basic | ||
ADC parameters and run analysis. See `example.ipynb <example.ipynb>`__ | ||
(you will need `Jupyter Notebook <https://jupyter.org/>`__ to be | ||
installed). | ||
|
||
.. figure:: analyser.png | ||
:alt: analyser | ||
|
||
analyser | ||
|
||
References: - `Analog Devices MT-003 TUTORIAL “Understand SINAD, ENOB, | ||
SNR, THD, THD + N, and SFDR so You Don’t Get Lost in the Noise | ||
Floor” <https://www.analog.com/media/en/training-seminars/tutorials/MT-003.pdf>`__ | ||
- `National Instruments Application Note 041 “The Fundamentals of | ||
FFT-Based Signal Analysis and | ||
Measurement” <http://www.sjsu.edu/people/burford.furman/docs/me120/FFT_tutorial_NI.pdf>`__ | ||
|
||
Inspired by Linear Technology (now Analog Devices) | ||
`PScope <https://www.analog.com/en/technical-articles/pscope-basics.html>`__ | ||
tool. | ||
|
||
|
||
USAGE | ||
======= | ||
|
||
To load the library in a module: | ||
|
||
.. code-block:: python | ||
import adc_eval | ||
Given an array of values representing the output of an ADC, the spectrum can be analyzed with the following: | ||
|
||
.. code-block:: python | ||
import adc_eval | ||
adc_eval.spectrum.analyze(<adc list>, <adc_bits>, <adc vref>, <adc fsamp>, window='hanning', no_plot=<True/False>) | ||
|pscope| Image source: `Creating an ADC Using FPGA Resources WP - | ||
Lattice <https://www.latticesemi.com/-/media/LatticeSemi/Documents/WhitePapers/AG/CreatingAnADCUsingFPGAResources.ashx?document_id=36525>`__ | ||
|
||
.. |pscope| image:: pscope.png | ||
.. |Lint| image:: https://github.com/fronzbot/python-adc-eval/workflows/Lint/badge.svg | ||
:target: https://github.com/fronzbot/python-adc-eval/actions?query=workflow%3ALint | ||
.. |PyPi Version| image:: https://img.shields.io/pypi/v/spithon.svg | ||
:target: https://pypi.org/project/python-adc-eval | ||
.. |Codestyle| image:: https://img.shields.io/badge/code%20style-black-000000.svg | ||
:target: https://github.com/psf/black |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Initialization file for module.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
Some basic signal functions | ||
""" | ||
"""Basic signal functions.""" | ||
|
||
import numpy as np | ||
|
||
|
||
def sin(t, peak=1.5, offset=1.65, freq=1e3, ph0=0): | ||
"""Generate a sine wave.""" | ||
return offset + peak * np.sin(ph0 + 2 * np.pi * freq * t) | ||
|
||
|
||
def noise(t, mean=0, std=0.1): | ||
"""Generate random noise.""" | ||
return np.random.normal(mean, std, size=len(t)) |
Oops, something went wrong.