Skip to main content

Functions useful for analyzing digitized signals.

Project description

Digital Signal Processing Toolkit

This code started as a C++ program to perform trapezoidal filtering to a digitized signal from XIA LLC's Pixie-16 hardware. The original sample code came from a VB program using IGOR as its base. It fairly well approximates the filter calculations that happen on a Pixie-16 module. These algorithms are mostly focused around XIA's hardware and function, but can be applied to any digitized signal.

Installation

pip install dsp_toolkit

Verify installation

You can verify the installation by opening up a python console and executing the following

from dsp_toolkit.sample_data import sample_traces as st
import dsp_toolkit.filtering.filters as ft

filter = ft.calculate_trapezoidal_filter(st.plastic_scintillator, 10, 5)
print(filter)

Your results should be identical to

results = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.6, 0.4, 0.5,
           0.2, 0.6, 0.7, 0.3, 0.0, 0.0, 0.0, -0.1, -0.3, -0.1, -0.1, -0.1, 0.1, 0.0, -0.1, 0.3,
           0.3, 0.2, 0.0, -0.3, -0.1, 0.0, 0.0, 0.1, -0.1, -0.2, 0.2, 0.2, 0.0, -0.2, -0.2, 0.0,
           0.1, 0.0, 0.0, -0.2, 0.4, 0.9, 0.8, 0.7, 0.6, 0.5, 0.7, 0.8, 0.6, 6.5, 74.8, 267.0,
           574.5, 912.4, 1215.2, 1463.4, 1657.5, 1805.4, 1909.0, 1921.7, 1789.9, 1526.5, 1220.0,
           940.1, 703.5, 456.4, 129.2, -278.9, -695.9, -1063.5, -1359.4, -1583.3, -1749.9, -1866.3,
           -1888.6, -1764.0, -1505.7, -1198.9, -912.5, -676.4, -497.0, -363.7, -266.1, -191.3,
           -130.7, -85.5, -56.4, -38.8, -28.2, -21.0, -15.7, -10.8, -10.3, -16.8, -23.2, -24.7,
           -23.0, -18.6, -12.4, -7.0]

For more detailed usage checkout the Demo notebook.

Module Descriptions

filtering

Implements a simple trapezoidal filter without any bells and whistles. We also include a simple RC low-pass filter used for conditioning signals.

XIA LLC uses trapezoidal filtering to calculate trigger positions and energies. The functions in this script approximate the Pixie-16 on-board calculations. We have functions to calculate

  • trigger positions,
  • signal baseline,
  • signal energy,
  • energy sums,
  • and trigger and energy responses.

We've made no attempt to convert bins to time. Users can do this trivially if they know the sampling frequency of their signal.

sample_data

The sample data include both energy spectra, and digitized signals. The signals can be used with the various filtering and fitting functions. The energy spectra can be used with pileup calculations.

signal_pileup

Takes a user provided energy distribution (either binned or raw) and calculates signal pileups based on trapezoidal filter parameters and count rates. We've also provided some macros that can be used with the CERN ROOT program. Those scripts served as the basis for the python functions.

timing

Provides both fitting and constant fraction discrimination (CFD) functions. We implement both a traditional CFD, and a CFD described in XIA's Pixie-16 Manual. We implement a couple of different fitting functions. The vandle function is the most tested and used function.

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

dsp_toolkit-2.8.2.tar.gz (31.0 kB view details)

Uploaded Source

Built Distribution

dsp_toolkit-2.8.2-py3-none-any.whl (30.5 kB view details)

Uploaded Python 3

File details

Details for the file dsp_toolkit-2.8.2.tar.gz.

File metadata

  • Download URL: dsp_toolkit-2.8.2.tar.gz
  • Upload date:
  • Size: 31.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0.post20201221 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

File hashes

Hashes for dsp_toolkit-2.8.2.tar.gz
Algorithm Hash digest
SHA256 ab5982f2899480df2a4238e839c6aaf58cdcdfadd78ae27c0217cf7e4320d91d
MD5 b9560a8533ddb904012046bbf7ff50ba
BLAKE2b-256 35a5c6eeba7f38b919984fb276d34ea7dcbc37ae5d47d960d4f526b85228418d

See more details on using hashes here.

File details

Details for the file dsp_toolkit-2.8.2-py3-none-any.whl.

File metadata

  • Download URL: dsp_toolkit-2.8.2-py3-none-any.whl
  • Upload date:
  • Size: 30.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0.post20201221 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

File hashes

Hashes for dsp_toolkit-2.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0fc593dc2d9158f156bc5b784efb8f21779044ba90a0aa4391a6598f049ed0db
MD5 ba1c1606d266cb8c175b7fbadbf20357
BLAKE2b-256 e99234c2fb9331bb18d4e318ac44d17bcbf3846fdae46df1294647a82734cb5c

See more details on using hashes here.

Supported by

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