Note: This repository is a fork of the original PyQa40x project and may include custom changes specific to this fork.
Installation
You can install this package via pip:
pip install your-package-name
Note for Linux Users: This package depends on PyAudio. You must install the PortAudio development headers before installing this package, otherwise the build will fail. Ubuntu/Debian:
sudo apt-get install portaudio19-dev python3-devFedora/CentOS:
sudo dnf install portaudio-devel python3-devel
PyQa40x allows you to run Python code to communicate with the QA40x hardware. No intermediate program is needed, as the PyQa40x lib understands how to use the calibration data stored inside the QA40x hardware.
The library is very much in flux, and support might be sporadic. The PyQa40x lib is one of several ways to use the QA40x hardware. There are now 5 ways to interact with your QA40x hardware:
- Using the QA40x application. This is the most-supported path. An addition to making a host of basic audio measurements, the QA40x app can also do swept plots, which is useful for plotting thinks like THD versus Level, for example. The application is located here
- Tractor. Tractor allows you create scripts to drive automated testing. You can establish pass/fail limits, allowing an operating with limited skills to test products in a production environment. Tractor works in conjuction with the QA40x application to "drive" your tests. The application is located here
- REST. REST is a common way of interacting with other entities on the internet, and every modern language provides support for implementing REST. The QA40x application handles the REST communication, and allows you to use GET/PUT/POST to control the measurements. A test program in C# is located here. More info on the Wiki is located here
- Bare Metal. If you'd like to see how to communicate with the QA40x hardware directly with c#, you could look at the repo located here
- ASIO. An ASIO driver for the QA403/QA402/QA401 is available here, allowing you to use the QA40x hardware with common audio-processing applications.
- PyQa40x. This library is an attempt to streamline a lot of common processing operations, while handling some of the more difficult topics such as normalization and windowing. The aim here is to facilitate an environment to digital signal processing development using absolute values instead of relative values. What this means is if you specify a 1Vrms sine way, the output of of the QA40x hardware will be 1Vrms.
The rest of this document focuses on running the PyQa40x examples under Jupyterlab Desktop.
Getting up and running
If you are looking for a simple starting point for running Python, Jupyterlab Desktop is probably it. It delivers a nice editing environment, includes its own Python installer, and delivers beautiful plots.
Install JupyterLab Desktop
There are a lot of flavors of Jupyter. JupyterLab Desktop is the cross-platform desktop application for JupyterLab, and it is probably the quickest and easiest way to get started with Jupyter notebooks on your local machine.
Go to the JupyterLab Desktop page on Github located here
Scroll down to the Installation section and select the installer for your particular operating system.
Once the application has installed, upon first run, you'll see an option to install Python at the base of the Jupyter home screen.
Once Python has installed, go to the Github page for the PyQa40x lib and locate the green Code button. Click that and download a zip of the library. Unzip that into the directory of your choice.
Re-launch the JupyterLab Desktop app, and from the main screen, select "Open Folder." Create a new folder on your drive off of MyDocs, and name it JupyterLabAudioTest or similar.
Open a Notebook using Python 3.
You will be greeted with an Untitled.ipynb file. Go to the cell and enter
!pip install git+https://github.com/QuantAsylum/PyQa40x.git
as shown below. After entering, you can push the "Run this Cell" button, or just enter SHIFT + ENTER
This will install the library.
Next, go to the PyQa40x directory you unzipped, and look in the LibTest subdirectory and open and copy the FirstPrinciples.py code. And then, paste that in the next cell in JupyterLab Desktop and run it. That should produce a graph similar to below:
Next, copy the contents of the file PyQa40x_thdn.py into the next cell in JupyterLab Desktop and run that. At some point, you will run into errors telling you that libraries are missing. When you encounter an error message that a library is missing, you will need to add that library. For example, if you see the error on the line
import usb1 # pip install libusb1
the comment after the import error will indicate how to install the library. For example, pip install libusb1. Just remember that if you want to run that command from a cell, you need to preface it with an exclaimation point such as !pip install libusb1.
Metadata
Release files for PyQa40x-i2c 0.3.2
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 |
|---|---|---|---|---|
| pyqa40x_i2c-0.3.2.tar.gz | 50.0 kB | Without provenance | Details for pyqa40x_i2c-0.3.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyqa40x_i2c-0.3.2-py3-none-any.whl | Python 3 | none | any | Details for pyqa40x_i2c-0.3.2-py3-none-any.whl |
Total release size: 89.3 kB
Release files / pyqa40x_i2c-0.3.2.tar.gz
| Download URL | pyqa40x_i2c-0.3.2.tar.gz |
|---|---|
| Size | 50.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
72df99b3f182afa54d49893d14c26271f13f2cb70509fa6674278093e2f7bf52
|
|
BLAKE2b-256 checksum How to use checksums |
035e7a6f3e28a43512c0dbba4bafc44aeaab2c1c4290b2a98cad207993cd47e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / pyqa40x_i2c-0.3.2-py3-none-any.whl
| Download URL | pyqa40x_i2c-0.3.2-py3-none-any.whl |
|---|---|
| Size | 39.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5a9964b7e36e05223762839061528930f158e93c9576612f3dcabe6dd555a288
|
|
BLAKE2b-256 checksum How to use checksums |
7deaca1cbb76482838cac82fe275ceb0cb7cd57caf4043c045946908b5cdebf9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Security for PyQa40x-i2c 0.3.2
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.