Proposal for a revamped equalizer #360
Replies: 4 comments 8 replies
-
|
Hi @DarthRainbows, I'm glad of this discussion! First of all I am not a great audio engeener and I am not always developed with C/C++ in the last few decades :) The SoLoud library used in this plugin is meant to be as light as possible to be used mainly for games and it uses only code really open and free to use/modify. Lately I come across the same doubt as your for the current EQ. I finally started an app using this plugin and I looked at the EQ filter too because of its very low quality. As you noticed, it uses a 256 FFT size which is quite low for an EQ filter, but it uses also an algorithm that is based on pitch shift bins which is not ideal. The FFT is the key for this filter as you know, and the FFT code is not the best for performances compared to KissFFT or FFTW, but the author of SoLoud C++ lib wanted a really permissive license for all his code. So, I tried to implement a new EQ filter already! It is still in progress and maybe you come in time to help me :). It is in the
Yes, for example when the Thanks for this discussion, and if you want to join experimenting or improving whatever you think, you are very welcomed! |
Beta Was this translation helpful? Give feedback.
-
I was thinking more in terms of potentially breaking functionality by making the FFT no longer restricted to 256. Like, does the visualizer assume a size of 256? We'd need to be on the lookout for those things while testing. Just for a first-order approximation of effort, I asked Gemini to analyze the complexity of replacing the Oouma FFT algorithm with the muFFT package. Assuming it didn't hallucinate anything here, the task doesn't seem so bad. Still probably worth making into its own project, IMO, especially if we don't have a C++ expert on hand to do the work.
|
Beta Was this translation helpful? Give feedback.
-
I completely agree!! So much so that I'd like to start thinking using muFFT.
if I remember well, when the So, there could be few or not big changes in the SoLoud core and only those 2 filters should be changed a lilttle. Even the way the FFT is obtained for visualization purposes could probably be updated without too much trouble. I'll be taking a look at this soon, and if you'd like to join, you're welcome! |
Beta Was this translation helpful? Give feedback.
-
|
I looked at muFFT and unfortunately it seems that it doesn't support arm64 architectures. Looking at the issues it's an old wish that come up with a fork. We could try that fork or maybe try to find something else like FFT-implementation-in-C. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've spent a few days looking into the equalizer filter, and I came across some flaws that are baked into its implementation:
A fixed count of EQ bands limits the use cases for the EQ. Allowing for custom band counts would be expand those.
Not knowing the frequency centers, however, impacts the usability of the equalizer. It becomes an exercise of guess and check to see if the result is what you want.
A small FFT size is good for performance, but it severely restricts frequency resolution. A 44.1kHz sample rate would result in 172Hz bins. That's a pretty large resolution; you can't build an equalizer with a band around 50Hz and another band around 120Hz, they're both in the same bin. As I understand it, 1024 bins is generally considered the minimum for an EQ, and 2048 or even 4096 for the professional grade stuff.
My C++ skills are 25 years out of date, so it would be nice to get some feedback from an expert on the feasibility of these suggestions.
FFTFilterInstanceSTFT_WINDOW_SIZE,STFT_WINDOW_HALF,STFT_WINDOW_TWICEto class memberssetFftWindowSize(unsigned int fftSize)methodQuestion: are there other places in the code base where an FFT size of 256 is assumed?
EqFilterInstanceI suspect that modifying this in-place while maintaining backwards compatibility might be more trouble than its worth. Perhaps it would be better to create an
EqFilterV2Instanceor some such.doublein the range[0, 1]for the wet/dry mixsetEqBandsto set the bands for the EQgetEqBandsmethod to retrieve the bands used so users can retrieve the frequency center, Q-factor, and gain of each band. This is especially important for users who use the default bandsfftFilterChannelto use the defined frequency centers of the bands to determine how to adjust binsconsider:
setEqBandscould be the primary (only?) means of controlling the EQ state. Change the gain on one band, update them all. This is how I'd handle it in a higher-level language, but maybe the standards in C++ are different, particularly if there's a performance or other cost that makes this not a good idea.It might even be beneficial to have multiple EQ filter types, or at least some way of configuring the EQ filter, as there are different algorithms for mapping the EQ bands to the bins:
There are probably more. Each has its own benefits and drawbacks in quality and performance.
Beta Was this translation helpful? Give feedback.
All reactions