Internals of Equalization

Effects, Recipes, Interfacing with other software, etc.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Piotr Grochowski
Posts: 364
Joined: Fri Jun 23, 2017 12:45 pm
Operating System: Windows 10

Internals of Equalization

Post by Piotr Grochowski » Sat Aug 04, 2018 4:34 pm

My guess is that Equalization works like this:

1. Do inverse fast fourier transform on the frequency response.
2. Window it with an unknown windowing function.
3. Convolute with every sample.

But what windowing function does it use? Here are some examples:

1. Rectangle
2. Triangle
3. Parzen
4. Sine
5. Hann
6. Hann squared
7. Hamming
8. Hamming squared
9. Hamming^2.5
10. Dolph–Chebyshev

It would be nice to allow various windowing functions. One might be curious what would be the quality of Equalization with Dolph–Chebyshev window.

steve
Site Admin
Posts: 81652
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Internals of Equalization

Post by steve » Mon Aug 06, 2018 9:38 pm

9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Piotr Grochowski
Posts: 364
Joined: Fri Jun 23, 2017 12:45 pm
Operating System: Windows 10

Re: Internals of Equalization

Post by Piotr Grochowski » Wed Aug 08, 2018 10:22 am

I'm not a freakin' programmer.

steve
Site Admin
Posts: 81652
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Internals of Equalization

Post by steve » Wed Aug 08, 2018 10:44 am

You don't need to be a freakin programmer to read the comments at the top of the file.
\class EffectEqualization
\brief An Effect that modifies volume in different frequency bands.

Performs filtering, using an FFT to do a FIR filter.
It lets the user draw an arbitrary envelope (using the same
envelope editing code that is used to edit the track's
amplitude envelope).

Also allows the curve to be specified with a series of 'graphic EQ'
sliders.

The filter is applied using overlap/add of Hanning windows.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Piotr Grochowski
Posts: 364
Joined: Fri Jun 23, 2017 12:45 pm
Operating System: Windows 10

Re: Internals of Equalization

Post by Piotr Grochowski » Wed Aug 08, 2018 7:31 pm

steve wrote:
Wed Aug 08, 2018 10:44 am
You don't need to be a freakin programmer to read the comments at the top of the file.
\class EffectEqualization
\brief An Effect that modifies volume in different frequency bands.

Performs filtering, using an FFT to do a FIR filter.
It lets the user draw an arbitrary envelope (using the same
envelope editing code that is used to edit the track's
amplitude envelope).

Also allows the curve to be specified with a series of 'graphic EQ'
sliders.

The filter is applied using overlap/add of Hanning windows.
So it uses Hann windows repeated every half of window size, then filters in FFT to the user defined frequency response before combining the Hanns?

What if you use one of these windows to reduce spectral leakage? It contains some promising cosine sum windows:

2–term:
  • Hanning has -31dB peak sidelobe and -18dB decay per octave. It's currently used.
  • Hamming has -43dB peak sidelobe and -6dB decay per octave.
3–term:
  • Error has -47dB peak sidelobe and -30dB decay per octave.
  • Error has -64dB peak sidelobe and -18dB decay per octave.
  • Error has -71dB peak sidelobe and -6dB decay per octave.
4–term:
  • Error has -61dB peak sidelobe and -42dB decay per octave.
  • Error has -83dB peak sidelobe and -30dB decay per octave.
  • Error has -93dB peak sidelobe and -18dB decay per octave.
  • Blackman–Nuttall has -98dB peak sidelobe and -6dB decay per octave.

steve
Site Admin
Posts: 81652
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Internals of Equalization

Post by steve » Thu Aug 09, 2018 8:08 am

The choice of Window function is in most cases, a compromise between different properties, such as the frequency resolution, dynamic range, SNR losses, computational efficiency ...
More information about window functions on Wikipedia: https://en.wikipedia.org/wiki/Window_function
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Piotr Grochowski
Posts: 364
Joined: Fri Jun 23, 2017 12:45 pm
Operating System: Windows 10

Re: Internals of Equalization

Post by Piotr Grochowski » Thu Aug 09, 2018 8:14 am

steve wrote:
Thu Aug 09, 2018 8:08 am
The choice of Window function is in most cases, a compromise between different properties, such as the frequency resolution, dynamic range, SNR losses, computational efficiency ...
More information about window functions on Wikipedia: https://en.wikipedia.org/wiki/Window_function
Indeed. But have you tested replacing Hanning in Equalizer with another window function to test quality?

steve
Site Admin
Posts: 81652
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Internals of Equalization

Post by steve » Thu Aug 09, 2018 11:56 am

Piotr Grochowski wrote:
Thu Aug 09, 2018 8:14 am
But have you tested replacing Hanning in Equalizer with another window function to test quality?
I haven't personally done so, and I have no interest in doing so as I don't see any evidence to suggest that there is a problem to fix.
The source code is available, so you are free to experiment if you wish to do so.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Piotr Grochowski
Posts: 364
Joined: Fri Jun 23, 2017 12:45 pm
Operating System: Windows 10

Re: Internals of Equalization

Post by Piotr Grochowski » Thu Aug 09, 2018 1:20 pm

steve wrote:
Thu Aug 09, 2018 11:56 am
The source code is available, so you are free to experiment if you wish to do so.
Are you sure I can run the source code in Android?

steve
Site Admin
Posts: 81652
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Internals of Equalization

Post by steve » Thu Aug 09, 2018 2:16 pm

Are you just trying to waste my time?
I did not say anything about Android.

It is possible to run C++ on Android, but Audacity code will not run on Android without a lot of modifications because Audacity has many dependencies that are not available on Android.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply