Coder Social home page Coder Social logo

Comments (9)

DrDiettrich avatar DrDiettrich commented on May 24, 2024 1

from arduinofft.

kosme avatar kosme commented on May 24, 2024

from arduinofft.

jerabaul29 avatar jerabaul29 commented on May 24, 2024

Mmh, if I remember well FFT(a f) = a FFT(f), so applying the correction before or after the transform should be the same, right? Or am I missing something? ...

from arduinofft.

hugke729 avatar hugke729 commented on May 24, 2024

@jerabaul29 : your expression is correct if a is a constant, but in this case it is a window. Look at the second panel in the first figure of the article you linked to. Note, also, that weighingFactor is a confusing name here. It's not a single factor, it's a window.. Finally, per issue #61, the Hann window isn't quite right.

from arduinofft.

jerabaul29 avatar jerabaul29 commented on May 24, 2024

Mmh, agree I should have been clearer and write that:

FFT(a * signal * windowing) = a * FFT(signal * windowing),

I wrote in the way I did because it is the usual notation when working with proofs of linearity on vector spaces.

But with a the constant scaling factor, it should be the same before or after applying the FFT I would think? ...

Just to be clear: I am aware that the Hanning window looks like a 'bell', I am thinking of the factor 0.54 that seems to disagree with other sources I have found.

from arduinofft.

jerabaul29 avatar jerabaul29 commented on May 24, 2024

Yes, I am aware of that. What we discuss here is the factor to use so that the windowing does not change the energy content.

from arduinofft.

jerabaul29 avatar jerabaul29 commented on May 24, 2024

If someone else looks into this and finds this thread. I took a bit of time to double check this. I am pretty confident that these formula are not right:

case FFT_WIN_TYP_HAMMING: // hamming
weighingFactor = 0.54 - (0.46 * cos(twoPi * ratio));
break;
case FFT_WIN_TYP_HANN: // hann
weighingFactor = 0.54 * (1.0 - cos(twoPi * ratio));
break;

I take as a reference the reference numpy documentation, which I have much trust in:

https://numpy.org/doc/stable/reference/generated/numpy.hanning.html

https://numpy.org/doc/stable/reference/generated/numpy.hamming.html

And a table from univ. Zurich for the "scaling coefficients":

https://www.physik.uzh.ch/local/teaching/SPI301/LV-2015-Help/lvanlsconcepts.chm/Scaling_Smoothing_Windows.html

which are in agreement with the previous link.

I am personally moving to kissfft, as it fits my needs better.

from arduinofft.

jerabaul29 avatar jerabaul29 commented on May 24, 2024

Sorry, the Hamming should be good, but the Hann is probably wrong. It is right as pointed higher up that this is the same issue as #61.

from arduinofft.

jerabaul29 avatar jerabaul29 commented on May 24, 2024

(but I still think that these windows are not compensated; which is fine, but may be worth having a line of comment about the need to compensate to keep either amplitude or energy constant :) ).

from arduinofft.

Related Issues (20)

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.