Skip to main content

A tool to measure noise spectra

Project description

Spectran

Spectran Logo

A simple spectrum analyzer. Read a voltage signal and perform a spectral analysis.

grafik

Usage

Installation and Execution

Install via

pip install spectran

Run via

import spectran
spectran.run()

or in terminal

python -m spectran

Workflow

  1. First, select driver and device and click connect. This connects the device.
  2. Then, select all other options like sample_rate, input_channel, etc.
  3. Finally, start the measurement by clicking on Start Measurement.

API Connection

It is possible to remotely control most of Spectran's features via an API. API key can be set with the environment variable API_KEY. Default host is 127.0.0.1 on port 8111. (host should be 0.0.0.0 to access from other network devices) You can check your connection by typing in a browser

http://<host>:<port>

A detailed example can be found in this example.

First, the connection to the API has to be set up (you might have to input your api key):

api = API_Connection()

Afterwards one can set up devices and measurements:

api.connect_device("DummyDAQ", 'Dev1')

CONFIG = {
    "input_channel": "ai0",
    "sample_rate": 50_000 * ureg.Hz,
    "duration": 0.05 * ureg.second,
    "averages": 4,
    "signal_range_min": -3 * ureg.volt, 
    "signal_range_max":  3 * ureg.volt,
    "unit": "Volt",
}
api.set_config(CONFIG)    

# start the measurement
api.start_measurement()
# this waits for the measurement to finish
api.wait_for_measurement()
# this saves the data to a file
api.save_file(f"data.txt")

Development

Install module into environment

pip install -e .[dev]

Extensibility

Spectran is written to provide extensive possibilities for extension. Just extend the spectran.daq.DAQ class for a new driver and implement all necessary functions.

Then add this class to list of drivers in spectran.daq.__init__

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spectran-0.6.0.tar.gz (54.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spectran-0.6.0-py3-none-any.whl (40.1 kB view details)

Uploaded Python 3

File details

Details for the file spectran-0.6.0.tar.gz.

File metadata

  • Download URL: spectran-0.6.0.tar.gz
  • Upload date:
  • Size: 54.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for spectran-0.6.0.tar.gz
Algorithm Hash digest
SHA256 55344a4313fa95050d0a0dc42a76638c451b1896563eb88db0ae746687cb0083
MD5 6f592dbedee0fcc0f68e38d64b208b98
BLAKE2b-256 81ffb8f19cd9e2db2d0a8e221ed5ef29a10fb878a428de091adb07ecf9054428

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectran-0.6.0.tar.gz:

Publisher: publish.yml on ullmannJan/spectran

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spectran-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: spectran-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 40.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for spectran-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3d7ed9a4cd66a1f5581dd01be9c3bc929db17f93635b9375a4c3b4f623307a2c
MD5 8dbf46be0193fb8e1ab0c09f8ac66abe
BLAKE2b-256 1b93977ebab7e4196c814a2a8d5de2e88763d1a1edf578b62e97a309a1aa73c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for spectran-0.6.0-py3-none-any.whl:

Publisher: publish.yml on ullmannJan/spectran

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page