I am trying to understand the math in compressor.cpp. It isn't hard and I think I understand Compressor's settings much better now.
However there is a dependency on the sizes of buffers in the crucial function Follow. What determines that size?
Understanding compressor.cpp
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
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
-
kozikowski
- Forum Staff
- Posts: 69357
- Joined: Thu Aug 02, 2007 5:57 pm
- Operating System: macOS 10.13 High Sierra
Re: Understanding compressor.cpp
You may be hampered significantly by the fact that developers don't appear on the forum. Gale may know how to post to the developers areas. Koz
Re: Understanding compressor.cpp
The size of the buffers are determined by the largest block size of the selected audio, but it is not critical to the compression algorithm because the two buffers are used in circular fashion, rotated as necessary.
See also: http://www.cs.cmu.edu/~rbd/doc/nyquist/ ... l#index286
See also: http://www.cs.cmu.edu/~rbd/doc/nyquist/ ... l#index286
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Understanding compressor.cpp
Where do the developers hang out? Nabble?
Re: Understanding compressor.cpp
I get it that lookahead in the Nyquist function corresponds to the length of two buffers. But telling me that buffer length is the "block size" doesn't explain it to me. That is not some natural, user visible setting, is it? I'd like to know a typical number.
Nyquist's follow is limited by lookahead when it must correct for a sudden spike -- and it may compromise by defining an envelope that respects the attack and decay times but fails to ride above the peak of the signal. I understand the same can happen with Compressor.
The block size also enters into the determination of the initial value of the envelope -- some comment says this corrects for a sudden spike near the beginning. However, I suspect this has an undesirable effect when I use compressor.
Typically I have the acx standard 1/2 second of silence, then "Chapter 1" or whatever, a pause, and narration. I find that "Chap" is too little amplified and the room noise before it is not raised as much as noise elsewhere.
I think the initial envelope value should not equal the peak found in the first buffer, but rather be less according to the time of the peak and the attack rate, so that the envelope can rise to meet that peak.
Nyquist's follow is limited by lookahead when it must correct for a sudden spike -- and it may compromise by defining an envelope that respects the attack and decay times but fails to ride above the peak of the signal. I understand the same can happen with Compressor.
The block size also enters into the determination of the initial value of the envelope -- some comment says this corrects for a sudden spike near the beginning. However, I suspect this has an undesirable effect when I use compressor.
Typically I have the acx standard 1/2 second of silence, then "Chapter 1" or whatever, a pause, and narration. I find that "Chap" is too little amplified and the room noise before it is not raised as much as noise elsewhere.
I think the initial envelope value should not equal the peak found in the first buffer, but rather be less according to the time of the peak and the attack rate, so that the envelope can rise to meet that peak.