DSPRelated.com
Forums

basic compressor question

Started by Jeff Roberts July 18, 2005
"Jeff Roberts" <jeffr@radgametools.com> wrote in message 
news:_tKdnRbcqOnFv0HfRVn-gQ@speakeasy.net...
> OK, I'm asking my question poorly. Let me start over. > > A compressor doesn't have to have any adaptive-ness at all. A compressor > doesn't even imply that - that's only if you have an _adaptive_ compressor. > All the compression does in a compressor is move the samples closer together. > I know most compressors are adaptive, but I don't care about that. I don't > care about adapting to the signal! <grin>
That is incorrect. In the common audio terminology, there is no distinction between an "adaptive compressor" and a "non-adpative compressor". There is just a compressor and it is adaptive. The reason they make the samples "closer together" is by dynamically changing the gain over time. Perhaps what you are thinking about is a compression algorithm such as mu-law and A-law (http://searchnetworking.techtarget.com/sDefinition/0,,sid7_gci848008,00.html). These algorithms apply a fixed (non-adaptive) transfer function mapping an input value to an output value on a one-to-one basis. That is, for every input value, there is a corresponding output value which depends only on the current input value and nothing else. Or said another way, for every input value, there is a corresponding gain which depends only on that input value. This is also sometimes called compression, which I'm guessing is the source of your confusion. Although this uses the same name, the operation is very different from a compressor used as an audio processor. In the audio process of compression, the gain depends on both the current and past input values.
> What I'm trying to isolate is the difference between volume attenuation of a > block of sound and compression over a block of sound. > > In volume attenuation, you have a scalar from 0 to 1 (not 0 or 1, as someone > thought before), that you multiply each sample by. So, if you have 0.5 as > your volume scalar, then all the amplitudes drop in half, and your audio is 6 > db lower. So, new_sample = old_sample * volume_scalar. > > In a compressor, you have a gain scalar which is also applied across the > buffer, but this isn't a simple multiplication since you are attenuating > non-linearly. So, the formula would be something like new_sample = exp( > log(old_sample)*gain ), but I'm not sure. _That's_ what I'm curious about - > what is the actual compression operation, once you know the gain that you want > to use.
See that's where you are confused. The whole "magic" of a compressor is the way it finds out what gain to use. Once you know that, it really is just a simple multiply (which I guess looks like a volume attenuator to you). But what you are describing sounds like mu-law compression, which is indeed a non-linear process.
Jon Harris wrote:
> "Jeff Roberts" <jeffr@radgametools.com> wrote in message > news:_tKdnRbcqOnFv0HfRVn-gQ@speakeasy.net... > > OK, I'm asking my question poorly. Let me start over. > > > > A compressor doesn't have to have any adaptive-ness at all. A compressor > > doesn't even imply that - that's only if you have an _adaptive_ compressor. > > All the compression does in a compressor is move the samples closer together. > > I know most compressors are adaptive, but I don't care about that. I don't > > care about adapting to the signal! <grin> > > That is incorrect. In the common audio terminology, there is no distinction > between an "adaptive compressor" and a "non-adpative compressor". There is just > a compressor and it is adaptive. The reason they make the samples "closer > together" is by dynamically changing the gain over time.
What do you all mean by "adaptive" in the compressor context?
> Perhaps what you are thinking about is a compression algorithm such as mu-law > and A-law > (http://searchnetworking.techtarget.com/sDefinition/0,,sid7_gci848008,00.html). > These algorithms apply a fixed (non-adaptive) transfer function mapping an input > value to an output value on a one-to-one basis. That is, for every input value, > there is a corresponding output value which depends only on the current input > value and nothing else. Or said another way, for every input value, there is a > corresponding gain which depends only on that input value. This is also > sometimes called compression, which I'm guessing is the source of your > confusion. Although this uses the same name, the operation is very different > from a compressor used as an audio processor. In the audio process of > compression, the gain depends on both the current and past input values.
Well said, Jon. As a postscript, sometimes the gain also depends on the future input values. Regards, Andor
"Jeff Roberts" <jeffr@radgametools.com> wrote in message
news:ReSdndT6GZtyfEbfRVn-uw@speakeasy.net...
> So, if we ignore the adaptive portion of a compressor, what is the > difference between compression and just volume attenuation? Is it just
that
> the amount of attenuation per sample in a compressor is based on value of > the sample itself?
Yes. Except that it is not forcibly based on the value of the sample itself but often on a more complicated rule (law). Don't let the other answers distract you, those people don't remember the days when they were as unsure as you. Jhon
John Smith wrote:
   ...

> Don't let the other answers distract you, those people don't remember the > days when they were as unsure as you.
What's that intended to mean? Jeff isn't unsure, he simply doesn't yet see the difference between modifying the waveforms of individual cycles and modifying the envelope of a signal. His problem, if any, is that he's so sure his mistaken concept is real that he can't listen. That'll change eventually. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
"Andor" <an2or@mailcircuit.com> wrote in message 
news:1121772096.101318.241100@o13g2000cwo.googlegroups.com...
> Jon Harris wrote: >> "Jeff Roberts" <jeffr@radgametools.com> wrote in message >> news:_tKdnRbcqOnFv0HfRVn-gQ@speakeasy.net... >> > OK, I'm asking my question poorly. Let me start over. >> > >> > A compressor doesn't have to have any adaptive-ness at all. A compressor >> > doesn't even imply that - that's only if you have an _adaptive_ compressor. >> > All the compression does in a compressor is move the samples closer >> > together. >> > I know most compressors are adaptive, but I don't care about that. I don't >> > care about adapting to the signal! <grin> >> >> That is incorrect. In the common audio terminology, there is no distinction >> between an "adaptive compressor" and a "non-adpative compressor". There is >> just >> a compressor and it is adaptive. The reason they make the samples "closer >> together" is by dynamically changing the gain over time. > > What do you all mean by "adaptive" in the compressor context?
Good question. I was just using the term in an attempt to speak the OP's language. I think he means simply "time variant" and that it changes based on the input.
>> Perhaps what you are thinking about is a compression algorithm such as mu-law >> and A-law >> (http://searchnetworking.techtarget.com/sDefinition/0,,sid7_gci848008,00.html). >> These algorithms apply a fixed (non-adaptive) transfer function mapping an >> input >> value to an output value on a one-to-one basis. That is, for every input >> value, >> there is a corresponding output value which depends only on the current input >> value and nothing else. Or said another way, for every input value, there is >> a >> corresponding gain which depends only on that input value. This is also >> sometimes called compression, which I'm guessing is the source of your >> confusion. Although this uses the same name, the operation is very different >> from a compressor used as an audio processor. In the audio process of >> compression, the gain depends on both the current and past input values. > > Well said, Jon. As a postscript, sometimes the gain also depends on the > future input values.
True. Obviously this can prevent causality problems, but this is not an issue when working with off-line data and for real-time work are fixed by delaying the signal a small amount.
Andor wrote:
> What do you all mean by "adaptive" in the compressor context?
Here, it's just a way to use the OP's term and not muddy the water with redefinition. I read a paper about a truly adaptive speech compressor once, not intended to be produced. Attack and decay time constants are important compression parameters. That paper was about adjusting the attack time to make it just fast avoid severe clipping with a particular speaker. It was a research tool, used to determine the range of times appropriate for a number of speakers. ... Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Jerry wrote:

>Andor wrote: >> What do you all mean by "adaptive" in the compressor context? > Here, it's just a way to use the OP's term and not muddy the water with > redefinition.
That was my question: what does the OP mean by this term? Or rather, what do you (or Jon or Mark) think that the OP means by this term?
Andor wrote:
> Jerry wrote: > > >>Andor wrote: >> >>>What do you all mean by "adaptive" in the compressor context? >> >>Here, it's just a way to use the OP's term and not muddy the water with >>redefinition. > > > That was my question: what does the OP mean by this term? Or rather, > what do you (or Jon or Mark) think that the OP means by this term?
In my opinion, he's fixated on an unsound model, so his underlying meaning doesn't matter much. But if you want my guess, he thinks that a non-adaptive compressor determines the appropriate gain for a dubbing session, while an adaptive compressor does something to the sound samples that depends on the samples themselves. If he had a compression scheme that worked -- not A-law or cousins -- his definitions would be Jeff's term our term &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295; non-adaptive compressor: volume control adaptive compressor: compressor A non-adaptive compressor in my world is like a non-suction vacuum cleaner. (I have a nice non-suction carpet cleaner.) Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
"Jerry Avins" <jya@ieee.org> wrote in message 
news:L4KdnTW9DsQpsEDfRVn-hQ@rcn.net...
> Andor wrote: >> What do you all mean by "adaptive" in the compressor context? > > Here, it's just a way to use the OP's term and not muddy the water with > redefinition. I read a paper about a truly adaptive speech compressor once, > not intended to be produced. Attack and decay time constants are important > compression parameters. That paper was about adjusting the attack time to make > it just fast avoid severe clipping with a particular speaker. It was a > research tool, used to determine the range of times appropriate for a number > of speakers.
My company Symetrix used to make an analog compressor/limiter that had an "automatic" setting for the attack and release times. So I guess that it is kind of adaptive, though it is probably fairly simple since it is an analog product. It predated me, so I don't know how it worked. We no longer make or actively support it, so company policy is to put all available documentation on the 'net for self-support (including schematics): http://www.symetrixaudio.com/index.php?Show=0&Show1=0&Show2=0&Template=S&Product=118
Jon wrote:
> My company Symetrix used to make an analog compressor/limiter that had an > "automatic" setting for the attack and release times.
Thanks for linking that manual - that's a well designed box! I guess you discontinued it because of its analogue processing? Do you have anything similar using digital processing? Regards, Andor