New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request for sin^4 window + upto 65536 Samples #58
Comments
Frequency Response of Various Windows: Desmos Used in TestWhat you will noice is that the different window functions have tradeoffs between the width of the frequency response and the noise floor. I personally prefer a lower noise floor as you can always shrink the frequency response width by increasing the number of samples. (I show this in the last image) I think that the following images will show that sin^4, and other powers of sin have much lower noise floors than the window functions offered currently. no windowBlackman Harrissin^1sin^2 (Hann)sin^4sin^6sin^8sin^10sin^10 (2x number of samples) |
Sure, the sin^4 window is no problem. |
It might be worth adding a sin^10 or sin^16 option that could be combined with 65k samples. That would be for when you want frequency accuracy more than anything else as those windows at that sample size would have a practically zero noise floor. It would be less useful for real time audio though because of the ~0.5s latency it would add. Maybe a warning at high FFT sizes saying something like, "high sample sizes add latency to measurements". |
All pushed to master now. |
My goal is to replicate the graph shown in the following video: https://youtu.be/cIQ9IXSUzuM?si=t4-2h-clXiYK6o0A&t=775
Why sin^4
Typically, many window functions, such as Hann, are a "Raised Cosine" functions. Which look like:
This is actually just equal to sin^2. On the other hand, sin^4 has the advantage of tapering more on the sides, which looks like:
When combined with a large sample window like 65536 samples, this could reduce the noise in the graph, leading to better graphs, and reduce the noise. This would also make the graph less jittery from frame to frame. As you can see from the youtube video, their graph is very smooth, and they are using the same FFT library that this project is.
Replace Exponential Moving Average with time variant version.
The moving average lets you select "gravity," which I assume is just the amount you weight the previous value with the new one. This is in general not a great way to do this because it depends on frame rate. What you should do is replace this with this equation that is calculated on each frame:
In code this would be
gravity = std::exp(-dt / m_RC)
. Where dt is the time in seconds between the previous frame and this one. RC can be changed such that higher RC values make the graph smoother and lower RC values make the graph update faster. This would be easier to control than the Gravity knob, while leading to the same smoothing effect.I would be willing to make a PR that does these if this is too much of a hassle, I was just wondering if these would be easy to implement?
The text was updated successfully, but these errors were encountered: