Python and C implementation for logarithmical power spectral density (LPSD) calculation.
Project description
Python 3 LPSD algorithm
Overview
This repository contains a Python 3 implementation of the LPSD algorithm. The implementation is similiar to the LPSD implementation in the Matlab package LTPDA. The core of the algorithm can be run as Python 3 or as (faster) C code. Both deliver the same results. To run the C core the file ltpda_dft.c has to be compiled to a shared library.
Installation
Install directly with pip:
pip install lpsd
Usage
Fully working examples can be found in /doc/examples.
With a DataFrame
Recommended interface, direct usage of a DataFrame
import pandas as pd
from lpsd import lpsd
# read time series
data = pd.read_csv("time_series.csv.gz", index_col=0)
# select column and calculate
spectrum = lpsd(data["column"])
# plot PSD
spectrum["psd"].plot(logx=True, logy=True)
Using numpy arrays
Use the traditional method lpsd_trad
, which uses simple numpy arrays.
References
- Improved spectrum estimation from digitized time series on a logarithmic frequency axis Authors: Michael Tröbs and Gerhard Heinzel
- Spectrum and spectral density estimation by the Discrete Fourier transform (DFT), including a comprehensive list of window functions and some new flat-top windows Authors: Gerhard Heinzel, Albrecht Rüdiger and Roland Schilling
- MATLAB Toolbox LTPDA Author: Martin Hewitson
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file lpsd-1.0.4.tar.gz
.
File metadata
- Download URL: lpsd-1.0.4.tar.gz
- Upload date:
- Size: 115.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.7 Linux/6.5.0-18-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd13a688b90b54654d4654afb6ab9f43b8cac81d97575826b1481ffa0b55c969 |
|
MD5 | f38fbf88b994dcb278808be41ca942fb |
|
BLAKE2b-256 | 0c83d7cd719e434ffd0389c9bd419a4fa76905078e7221d047b5fb8f468d31bf |
Provenance
File details
Details for the file lpsd-1.0.4-cp311-cp311-manylinux_2_36_x86_64.whl
.
File metadata
- Download URL: lpsd-1.0.4-cp311-cp311-manylinux_2_36_x86_64.whl
- Upload date:
- Size: 116.1 kB
- Tags: CPython 3.11, manylinux: glibc 2.36+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.7 Linux/6.5.0-18-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53ff8300e3e7dd5b7994c9244429ae6a33a48460f93d660f3c4b23cdf6e0c062 |
|
MD5 | 106030f657214966a2a6a3ec5c3c0ed7 |
|
BLAKE2b-256 | 34572f428c2ea654b2cc3e1464518f96003fba7143df627522630b02e62a973f |