Open Colerar opened 2 years ago
AudioSpectrumRenderer::FillBlock()
, it should have been located between ConvertToFloat()
and fftw_execute()
. Given the goal of this spectrogram I’m not sure this is really required, but I could add one. However I’m not sure that what we see in the first screenshot is the result of a lack of window—maybe.If you can add one, I'll appreciate so much. :)
I implemented a Blackman-Harris window, but I won’t make a pull request for it because this is a clear regression from a productivity point of view. The reason is simple: with a rectangular window, the main lobe of a frequency component is very sharp (and the side lobes quite high but this is not a problem here), whereas the main lobe of a more sophisticated window is much wider, and it looks blurry when displayed. So voiced components are less obvious to detect visually.
Rectangular (no window) | Blackman-Harris
Thanks for your contribution again.
I partly agree with you. Blackman-Harris windows looks a bit blurry. But it improves the SNR. If a source audio has a lot of noise, Blackman-Harris may be a better choice.
You can add an option if you want, let user to decide. Options are better than nothing.
For example, in this case, low frequency and repetitive SFX (can be regraded as noise) make the spectrum out of reference value.
Rectangular window:
Blackman-Harris:
Look at the underlined part, it seems strange. As far as I know, the performance above is similar to
Hamming
window funtion, screenshot in Adobe Audition -Hamming
window function:FFmpeg provides varieties of window functions, see FFmpeg filters - showfreqs. For reference, Adobe Audition uses Blackman-Harris (i.e.
bharris
) as the default.:) The two enhancement requests are in order to improve efficiency. I lack cpp development experience so I can only raise a issue instead of PR. 😢