Skip to content
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

Spectrum Display Improvement #149

Open
Colerar opened this issue Mar 2, 2022 · 5 comments
Open

Spectrum Display Improvement #149

Colerar opened this issue Mar 2, 2022 · 5 comments

Comments

@Colerar
Copy link

Colerar commented Mar 2, 2022

  1. Different Spectrum Mapping, likes in Adobe Audition, from linear to logarithmic.

    In fact, there is a PR Spectrum display improvement #94, and it works well for me. Maybe this branch is no longer active :( so not merged

  2. Better Window Function - Wikipedia
    Based on Spectrum display improvement #94, there are still some issues.
    image
    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:
    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. 😢

@EleonoreMizo
Copy link
Contributor

  1. Currently, there is no specific windowing (aka rectangular window) in Aegisub. In 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.

@Colerar
Copy link
Author

Colerar commented Apr 14, 2022

If you can add one, I'll appreciate so much. :)

@EleonoreMizo
Copy link
Contributor

EleonoreMizo commented Apr 16, 2022

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.

aegisub-win-rectangular aegisub-win-blackman-harris
Rectangular (no window) | Blackman-Harris

@Colerar
Copy link
Author

Colerar commented Apr 16, 2022

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.

@Colerar
Copy link
Author

Colerar commented Apr 18, 2022

For example, in this case, low frequency and repetitive SFX (can be regraded as noise) make the spectrum out of reference value.

Rectangular window:

image

Blackman-Harris:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants