Giter Club home page Giter Club logo

jurihock / sdft Goto Github PK

View Code? Open in Web Editor NEW
21.0 21.0 5.0 3.47 MB

Single file forward and inverse Sliding DFT in C, C++ and Python

License: MIT License

CMake 7.43% C 29.00% C++ 20.53% Python 27.02% Shell 0.87% Makefile 1.46% Batchfile 0.88% Rust 12.83%
algorithms audio c99 cpp cpp11 dft digital-signal-processing discrete-fourier-transform dsp fft fourier fourier-transform math python qdft sdft signal-processing sliding-dft spectral-analysis spectral-synthesis

sdft's People

Contributors

jurihock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sdft's Issues

Docs: Explain Interpretation of Vector and Linear Spacing more

Hi,

Nice library! Am looking forward to seeing how it performs on my data.

From the readme:

It takes real valued samples and estimates the corresponding half size complex valued DFT vector for each of them.

Would you be able to add a short sentence in the readme, and maybe something in the examples, that clarifies how this vector is to be interpreted please? Most of these seem to be taking the entire signal and transforming, then doing the inverse and verifying the difference isn't too great.

For my usecase though, I need to compute the bandpowers at known frequencies realtime, adding one sample at a time (and I also think an example closer to this might be helpful - e.g. plotting the phase and amplitude). So it's not entirely clear to me how the mapping between the DFT vector/bin counts and the relative frequencies is defined, whilst I have some guesses.

I would have assumed they might be linearly-spaced, for the specified number of bins, between zero and some maximum, but then if not user-specified, inferring what this upper limit is remains a question. Or does it simply count up from zero one at a time, same as the FFT - so that a total of 128 samples and a bin count of 65 would be an equivalent output format? Does the interpretation depend on how many samples I push into the algorithm, or is it fixed? Would be good if this could be confirmed somewhere in the documentation.

Thanks!

Discussions Tab?

Hi,

I had a question - but not a bug or FR, just wanted to be sure I had understood and was using the library properly.

I can ask here, but rather than clutter the issue list with a non-issue, would you be open to enabling the "discussions" feature in GitHub (docs)?

Thanks

Improvements to the Sliding Discrete Fourier Transform Algorithm (kSDFT)

kSDFT

A modulated SDFT network was presented in [mSDFT, Fig. 3]. That network frequency translates the N-delay comb stage’s output spectral energy, originally centered at kfs /N Hz, down to 0 Hz and implements a complex resonator where exact pole/zero cancellation occurs at z = 1 on the z-plane. Although that network is guaranteed stable, it is less computationally efficient than is our proposed SDFT network in Figure 3.

Control latency via Fourier time-shifting property

The note in "Sliding DFT for Fun and Musical Profit" is misleading:

A zero latency version is more expensive, and while we have had it implemented in our experimental code it seems rather too much.

There is no such thing like "zero latency" due to windowing. The amplitude of the first/last sample is suppressed by the window function in the time domain. Consequently "zero latency" means "zero amplitude". Applying circular shift before proper windowing is quite pointless.

Improvements

  • Basic usage as a standalone example
  • Additional getters
  • Basic benchmark
  • Rework convolution loop
  • C++ namespace sdft
  • Try to build all C++ examples as possible, regardless of the Python availability

Could you add a more detailed example code?

Hello, I am very interested in testing out this implementation for real time frequency analysis of a signal. However, I do not understand how to implement the method.

In scipy.ftt I would compute a sliding window with the last 'n' values and perform the fourier transform on the array. Using sdft I would be able to update the transform online with just the last value and the result of the previous iteration right?

Could you upload a basic example with a couple of sine waves, please? Sorry for the inconvenience.

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.