Skip to main content

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

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

lpsd-0.2.1.tar.gz (178.5 kB view hashes)

Uploaded Source

Built Distribution

lpsd-0.2.1-py3-none-any.whl (177.0 kB view hashes)

Uploaded Python 3

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