Oversampling compression - necessary for mild/clean compression?
- KVRAF
- 12615 posts since 7 Dec, 2004
have you written a limiter? i assure you, you can load mine and apply a zero attack and get zero distortion. not just nearly zero, i mean really zero! absolutely zero.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
-
tony tony chopper tony tony chopper https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=3103
- KVRAF
- 3561 posts since 20 Jun, 2002
& what is the waveform looking like then?
DOLPH WILL PWNZ0R J00r LAWZ!!!!
- KVRAF
- 12615 posts since 7 Dec, 2004
i shouldn't have said absolutely zero, i can't do the impossible.
it would look like a sine with the attack followed by a single "clipped" sample, assuming you've used zero attack, then the sine again. after the high-level period ends it would release.
if you've used a non-zero attack the gain equation i posted would apply. you'd get the -40db harmonic, -60, -80, -100 each sample. that would be due to the over-shoot, assuming you hard-clip at the threshold. (i prefer just to allow the tiny overshoots..)

this was with zero attack time.
there is a half-phase there before things settle out. then they get nudged a little each cycle in those 20db steps until the accuracy reaches float's maximum at 25 bits.
this is mostly due to the phase of the sine wave. there would be no distortion if the input were a perfect pulse wave or dc, or if the change happened to occur during the sine's peak. that's really unlikely, so while it's theoretically possible to have zero distortion there will be a certain amount no matter what.
that could be dealt with by complicated multi-layered look-ahead, but my experiments haven't shown that it's really worth it.
grab the plugin and try. once you test it it'll be obvious how it's possible. it's one simple feature. not so simple actually, i haven't 100% perfected it.
it would look like a sine with the attack followed by a single "clipped" sample, assuming you've used zero attack, then the sine again. after the high-level period ends it would release.
if you've used a non-zero attack the gain equation i posted would apply. you'd get the -40db harmonic, -60, -80, -100 each sample. that would be due to the over-shoot, assuming you hard-clip at the threshold. (i prefer just to allow the tiny overshoots..)

this was with zero attack time.
there is a half-phase there before things settle out. then they get nudged a little each cycle in those 20db steps until the accuracy reaches float's maximum at 25 bits.
this is mostly due to the phase of the sine wave. there would be no distortion if the input were a perfect pulse wave or dc, or if the change happened to occur during the sine's peak. that's really unlikely, so while it's theoretically possible to have zero distortion there will be a certain amount no matter what.
that could be dealt with by complicated multi-layered look-ahead, but my experiments haven't shown that it's really worth it.
grab the plugin and try. once you test it it'll be obvious how it's possible. it's one simple feature. not so simple actually, i haven't 100% perfected it.
Last edited by aciddose on Sun Apr 29, 2012 6:54 pm, edited 1 time in total.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
-
tony tony chopper tony tony chopper https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=3103
- KVRAF
- 3561 posts since 20 Jun, 2002
if it's not looking like on the graph, then it's not a zero (or near) attack..
or you're defining your attack time as an attack speed or a variable time.
or you're defining your attack time as an attack speed or a variable time.
DOLPH WILL PWNZ0R J00r LAWZ!!!!
- KVRAF
- 12615 posts since 7 Dec, 2004
the time is zero.
basically it does this:
follower = input;
really download the plugin and try it. you'll see how it works. it's really ridiculously obvious once you see it.
oh, the boost in the image i posted is +6db by the way. i tweaked the levels to be just below the threshold. it's by hand so there is a very small change there.
the level change doesn't matter. the same result will occur (exact same output! same identical numbers) no matter how much gain change occurs. could be +900db.
basically it does this:
follower = input;
really download the plugin and try it. you'll see how it works. it's really ridiculously obvious once you see it.
oh, the boost in the image i posted is +6db by the way. i tweaked the levels to be just below the threshold. it's by hand so there is a very small change there.
the level change doesn't matter. the same result will occur (exact same output! same identical numbers) no matter how much gain change occurs. could be +900db.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
-
tony tony chopper tony tony chopper https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=3103
- KVRAF
- 3561 posts since 20 Jun, 2002
but on your graph it's a very high sine.. of course here the 2 samples are big relative to that sine's phase. Now on a low one?
DOLPH WILL PWNZ0R J00r LAWZ!!!!
- KVRAF
- 12615 posts since 7 Dec, 2004
on a low one it becomes really difficult to see anything because the attack is so quick. i used the high sine because it makes the distortion way more clear.
identical result. during the attack with zero attack time, the clipping occurs:

with a non-zero attack and look-ahead the distortion is moved into the time before the change occurs. i used a lot more than two samples. gives you a better idea of what's happening anyway:

you can predict the attack phase and eliminate the 'clipping' for the zero attack but no matter what you do you're going to just be moving things around. some ways are less audible than others. all involve some kind of look-ahead like you said.
it doesn't require continuous distortion though. have you figured out the feature's name yet?
identical result. during the attack with zero attack time, the clipping occurs:

with a non-zero attack and look-ahead the distortion is moved into the time before the change occurs. i used a lot more than two samples. gives you a better idea of what's happening anyway:

you can predict the attack phase and eliminate the 'clipping' for the zero attack but no matter what you do you're going to just be moving things around. some ways are less audible than others. all involve some kind of look-ahead like you said.
it doesn't require continuous distortion though. have you figured out the feature's name yet?
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
-
tony tony chopper tony tony chopper https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=3103
- KVRAF
- 3561 posts since 20 Jun, 2002
why would you still get that abrupt jump with a longer attack?with a non-zero attack and look-ahead the distortion is moved into the time before the change occurs. i used a lot more than two samples
DOLPH WILL PWNZ0R J00r LAWZ!!!!
- KVRAF
- 12615 posts since 7 Dec, 2004
because there's an abrupt jump in the input.
notice it's exactly 1/2 the level. that's because it's a 6db jump. with a bigger jump, it would take up a larger percentage.
if there were no jump you'd be expecting that if you compressed a saw-wave there would also be no jump. where would it go?
notice it's exactly 1/2 the level. that's because it's a 6db jump. with a bigger jump, it would take up a larger percentage.
if there were no jump you'd be expecting that if you compressed a saw-wave there would also be no jump. where would it go?
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
- KVRAF
- 8476 posts since 12 Feb, 2006 from Helsinki, Finland
OMG WTF you smoking?!? Can I have some of that?
Seriously though: if an event is narrow in time-domain then it's wide in spectral domain. Such events are commonly perceived as clicks. There's very little you can do about them except (1) try to mask them so people don't notice or (2) spread them in time-domain to get the spectra out of the hearing-range.
Now, if you've still somehow managed to violate that basic principle and indeed invented a method for generating short time-limited events without wide-band spectrum (commonly known as clicks), then I'm sure the guys in the theoretical physics department would have plenty of applications for your discovery.
Seriously though: if an event is narrow in time-domain then it's wide in spectral domain. Such events are commonly perceived as clicks. There's very little you can do about them except (1) try to mask them so people don't notice or (2) spread them in time-domain to get the spectra out of the hearing-range.
Now, if you've still somehow managed to violate that basic principle and indeed invented a method for generating short time-limited events without wide-band spectrum (commonly known as clicks), then I'm sure the guys in the theoretical physics department would have plenty of applications for your discovery.
- KVRAF
- 12615 posts since 7 Dec, 2004
who are you talking to?
if you're replying to last page's post of mine, my point was that i don't consider clipping to really count as a click.
the only thing you could say is a click that wasn't part of the original signal is the attack phase of the input.
if you had an attack before compression, the slope will be magnified if the compensation hasn't kicked in yet. so as long as the slope remains below the threshold that'll generate a click.
a little clipped section isn't much like a click though. it is, but it's second order already and usually the level is low.
(it just doesn't seem intuitive to me at all to consider that the attack of the signal is not already a part of the signal though. the act of magnifying it i consider to be magnification, not the addition of a previously non-existent click. it's like saying amplifying a signal will add noise when you're actually just amplifying noise which is part of the signal. it isn't actually adding anything, only magnifying the already existing part. although fine, i will give in and agree that you could consider it a click if it makes a sound like "click". i just don't see the point in even discussing it as it's impossible to eliminate. like i said about a saw-wave. it's a compressor, not a filter!)
if you're replying to last page's post of mine, my point was that i don't consider clipping to really count as a click.
the only thing you could say is a click that wasn't part of the original signal is the attack phase of the input.
if you had an attack before compression, the slope will be magnified if the compensation hasn't kicked in yet. so as long as the slope remains below the threshold that'll generate a click.
a little clipped section isn't much like a click though. it is, but it's second order already and usually the level is low.
(it just doesn't seem intuitive to me at all to consider that the attack of the signal is not already a part of the signal though. the act of magnifying it i consider to be magnification, not the addition of a previously non-existent click. it's like saying amplifying a signal will add noise when you're actually just amplifying noise which is part of the signal. it isn't actually adding anything, only magnifying the already existing part. although fine, i will give in and agree that you could consider it a click if it makes a sound like "click". i just don't see the point in even discussing it as it's impossible to eliminate. like i said about a saw-wave. it's a compressor, not a filter!)
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
-
- KVRAF
- 7577 posts since 17 Feb, 2005
The clip can be moved to the edge of the wave via a filter, so the crest is no longer flat, but the discontinuity mystran pointed out will still be present. Clip or not doesn't matter essentially, I think that's the point everyone is trying to make.
-
tony tony chopper tony tony chopper https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=3103
- KVRAF
- 3561 posts since 20 Jun, 2002
the filter of what? the envelope? & the freqs of what?Oversampling must be done for filter in compressor. Otherwise you loose those frequences above 6k.
DOLPH WILL PWNZ0R J00r LAWZ!!!!
