Code Monkey home page Code Monkey logo

harmonic-retrieval's Introduction

Frequency-Selective Harmonic Retrieval

The harmonic retrieval problem is to identify sinusoids in a segment of sampled data and to estimate the frequency of each sinusoid. This repo hosts a solution to the problem, which is derived from the state space representation in frequency domain. A major advantage of this method is manifested by its ability to focus only on a narrow frequency band and completely ignore the rest, which can greatly save the computational cost. Moreover, the accuracy of the retrieval result is remarkably good. Since it exploits the sinusoidal model of the data, as well as the modulus and the argument of the Fourier transform, the method is able to achieve a superresolution, surpassing the Rayleigh limit of the conventional periodogram estimate.

This code is implemented in Python, with a particular aim of easy-to-use in mind.

Prerequisites

  • Python 3
  • SciPy & NumPy

Inventory

class Harm_Retri()

attributes

  • y_k: Fourier transform of the input data
  • freq: frequency grid in native units, i.e., from -1/2 to 1/2
  • idx_l: lower index (inclusive) of the focused frequency band after round-off on the frequency grid
  • idx_u: upper index (inclusive) of the focused frequency band after round-off on the frequency grid

methods

load(data)

  • argument
    • data: complex input data in 2D array, where the last axis is for Fourier transform and the first axis is for average

aim(band)

  • argument
    • band: 2-tuple comprising lower and upper limits of the frequency band in native units

shoot(J_c, rho)

  • arguments
    • J_c: number of harmonics in the band
    • rho: power spectral density of the noise in the band
  • returns
    • fhat: retrieved harmonics in ascending order
    • val: eigenvalues in descending order from one intermediate step as a hint on the actual J_c

Example

This code is also shipped with a simple example. Simply run the code in the standalone mode.

python3 harmonic_retrieval.py

For details, see the bottom lines of the code.

Reference

Xiangcheng Chen, Phys. Rev. E 101, 053310 (2020).

An Open Access is kindly provided by the University of Groningen.

License

This repository is licensed under the GNU GPLv3.

harmonic-retrieval's People

Contributors

nerdull avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.