forked from Aircoookie/WLED
-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
Full audio fastpath (part2) #141
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* introducing sliding window FFT, which effectively doubles the rate of samples - and FFT results - produced per second. As a side-effect, it also makes FFT a bit less noisy. As sliding window FFT requires double the number of FFT runs, the feature is only enabled on esp32 and esp32-S3.
filter parameter tuning
* limiter on/off : made the logic a bit clearer. * use a simpler way of writing filters: a = n*a + (1-n)*b --> a = a+ n*(b-a) no functional impact.
samples arrive 2x as fast in fast mode - adjust filters accordingly
experiments: user-selectable FFT "windowing" options https://en.wikipedia.org/wiki/Window_function#Cosine-sum_windows
new: user-selectable "FFT windowing" functions. Why: depending on the audio signal, one or the other window may give better-looking results. https://en.wikipedia.org/wiki/Window_function#Cosine-sum_windows |
*some filter parameter tinkering * restore FFT_MajPeakSmth in UDP SoundSync receiver
* mic quality: When set to "low noise" or "perfect", only minimal smoothing is performed on the "Mic Volume" input. Every filter adds a delay, so this option can lead to better on-spot responses from effects. * cleanup: removed a few unused variables and unused code.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows the audio core to deliver sound data and FFT results 2x faster (43 sps --> 87 sps).
The concept behind this PR is called "sliding window FFT" (aka 50% overlapping FFT). In normal FFT a full batch of samples is first read then analyzed. With sliding window, 50% old samples and 50% new samples are put into each FFT run. This leads to faster responses (new samples arrive twice as fast) and improved accuracy of FFT (samples suppressed by windowing get a second chance in the next run). It also requires twice the number of FFT runs, so you'll need a fast MCU.
Limitations
how to configure
Info Page (with SR_STATS enabled)
Normal mode
== > Fastpath Mode ==>