Skip to main content

Extract the envelope of a digital signal

Project description

Envelope

Python module to extract the envelope of signals.

More information in this paper

Functions

This module implements 3 functions:

read_wav("path/to/mono/signal.wav"), that returns a tuple (W, fps), where W is a numpy array and fps is an int with the value of the frame rate of the file.

save_wav(signal, path = "test.wav", fps = 44100), that saves a numpy array as a .wav file

get_frontiers(W), that returns a tuple (pos_idxs, neg_idxs) with the indices of the positive and negative frontiers of a numpy array representing the samples of a discrete function. If this function is called from a compatible setup (currently, Windows 64bit), it computes the frontiers faster via specialized native code. A fall-back version in pure Python is also provided, in which case a warning is printed indicated that a slower mode is being used. In both cases, the usage is the same.

Usage

install the module: pip install signal-envelope

A minimal example would then be:

import signal_envelope as se

W, _ = se.read_wav("path/to/signal.wav")
Xpos, Xneg = se.get_frontiers(W)
print(Xpos)

Two test wav files can be found at the Github repository for the project.

Source

The code for this repository (except, for now, the C++ source code of the envelope.dll) is available at Github

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

signal-envelope-0.1.1.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

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

signal_envelope-0.1.1-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file signal-envelope-0.1.1.tar.gz.

File metadata

  • Download URL: signal-envelope-0.1.1.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.1

File hashes

Hashes for signal-envelope-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5946d44d3ca1caa4d9e45c8bdb685ff2c042c9a8db6599d1d4b7ae74d05a09ee
MD5 49ad084b810ce13fd32e90950a652dba
BLAKE2b-256 2ee2d03a00fa15181b613887c467f7ba70ade99f5d4488347b9f6488dd629244

See more details on using hashes here.

File details

Details for the file signal_envelope-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: signal_envelope-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.1

File hashes

Hashes for signal_envelope-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e36b80f9bbd12dabe79670bbd5b9e6a5c119d3d88d09025589682f617491459e
MD5 525ffaed9fb445c34b020457301d30bd
BLAKE2b-256 ea47a289834fcfcc11e9f92c6cd3b09f240349d62fb696e88cce14d58773452c

See more details on using hashes here.

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