Skip to main content

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-dev

Fedora/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:

  1. 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
  2. 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
  3. 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
  4. 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
  5. ASIO. An ASIO driver for the QA403/QA402/QA401 is available here, allowing you to use the QA40x hardware with common audio-processing applications.
  6. 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.

image

Open a Notebook using Python 3.

image

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

image

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:

image

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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyQa40x-i2c 0.3.1
File Size Uploaded Provenance Actions
pyqa40x_i2c-0.3.1.tar.gz 49.8 kB Without provenance Details for pyqa40x_i2c-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for PyQa40x-i2c 0.3.1
File Interpreter ABI Platform Actions
pyqa40x_i2c-0.3.1-py3-none-any.whl Python 3 none any Details for pyqa40x_i2c-0.3.1-py3-none-any.whl

Total release size: 89.0 kB

Release files / pyqa40x_i2c-0.3.1.tar.gz

Download URL pyqa40x_i2c-0.3.1.tar.gz
Size 49.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4cfb07d39be7944025a67b32c16dba8964d39452acad42600eb0cacffd43dbb8
BLAKE2b-256 checksum
How to use checksums
8f4b5cd998cd34beaa54c99f8e91ea5ed88ff36019f28ac954abfe557af78fb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / pyqa40x_i2c-0.3.1-py3-none-any.whl

Download URL pyqa40x_i2c-0.3.1-py3-none-any.whl
Size 39.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ed1ae4bcb027ca7f5b2f41975a09d45c2ad00d2cf41ab4858356562ac01f887
BLAKE2b-256 checksum
How to use checksums
d3420cb3708c0e01bd5596c78a3338f8d25aeb2ac77eb08d3b82fe64066177df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Security for PyQa40x-i2c 0.3.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page