Aliasing in zero-crossing compressor?

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

From my experience of analog and digital compressors (just sold my uad-1 cards and plugins to buy the real items instead).... there is no way at the moment digital compressors will sound as good as their analog counterparts.

The Uad-1's were good if not the best in the virtual world for compression..... but after listening to a real 33609 and using real 1176's it's a world apart.

Just thought I'd throw in a non technical musical view on it.

But if anyone in the non dsp plugin development world could succeed at rivaling analog compression...it would be Aleksey Vaneev :)

Post

The best digital compressor/limiter/de-esser right now would be Weiss DS1-Mk2. It's hardware, it sounds like heaven, and it costs like hell. And yes, it more than rivals analog products.
I'm waiting for Algorithmix's new compressor which I believe will rock extremely hard based on the amazing Blue eq.

Post

Aleksey Vaneev wrote: Sure, linear-phase is the way to go, but it requires a bit of delay compensation which also takes CPU time while a min-phase filter with an equal response is smaller by a factor of 2, and has a Bessel group delay. Also you do not have to put the cutoff point exactly on Nyquist/2 - you may put it a bit higher so that pass-band is unaffected. A bit of aliasing near Nyquist won't hurt at all if we are talking about quick CPU calculations.
First: the delay will cost you one load per sample if you already have the delayed material in a buffer (which should be easy to arrange in this case). This single load will be completely irrelevant compared to the cost of convolving with any sort of FIR.

Second: I'm not completely convinced that Bessel group delay is going to help all that much (and certainly not at all if you aren't willing to delay the other signal), but previously you were suggesting cascaded single-poles which does not give you a Bessel filter (or even anything close).

Third: I would be interested in whatever references you can come up with for the "min-phase filter is smaller by a factor of 2" claim. That doesn't seem to make any sense. I'd also like to see a proof that an arbitrary minimum-phase FIR low-pass design will magically get a maximally flat group-delay (if "Bessel group delay" even makes sense for a FIR as the maximally flat group-delay condition is trivially satisfied by a true linear-phase filter).

Fourth: If you put the cutoff at exactly Nyquist/2 exactly every other sample in a windowed-sinc lowpass impulse will come out as exactly zero, and since multiplying by zero involves coming up with a zero as a result, this means you only have to convolve half the taps compared to the "not exactly at Nyquist/2" case.

Finally: I would rather put it a bit LOWER than Nyquist (though moving it at all will defeat the optimization that was my point 4), since most any decent window will spread it around anyway, and you'd prefer that the transition band (which will be rather wide for a short filter) not extend too far above the original Nyquist, and slight high-frequency loss can be compensated later anyway if necessary (I was previous only objecting to the stupid amounts of high-frequency attenuation you get from cascaded one-poles, especially considering the rather awful stop-band behavior). Cursory examination of published articles about audio oversampling seems to suggest that I am not alone. In the specific application of suggested polynomial evaluation method, any aliasing that manages to enter the passband, will get propagated down from the high-frequencies by the repeated multiplications rather quickly (remember you'll always get both sum and difference).

Post

mystran wrote:First: the delay will cost you one load per sample if you already have the delayed material in a buffer (which should be easy to arrange in this case). This single load will be completely irrelevant compared to the cost of convolving with any sort of FIR.
The problem with delay is that you have to keep a history buffer and use &mask to access any previous output, or store new output. Because of this &mask you have a higher CPU hit. You can change that to a 'double history' approach, but that will require two double store ops into memory.
mystran wrote:Second: I'm not completely convinced that Bessel group delay is going to help all that much (and certainly not at all if you aren't willing to delay the other signal), but previously you were suggesting cascaded single-poles which does not give you a Bessel filter (or even anything close).
You probably do not understand what I mean with Bessel group delay. It is group delay which is close to zero and is maximally flat from DC to the cutoff point. Of course, it is not going to be flat from DC to Nyquist, but at least it is smooth, without bumps near cutoff point. Min-phase transformation delivers that. http://en.wikipedia.org/wiki/Bessel_filter Of course you should strive to get a zero group delay near DC so that you are not getting into phase problems when summing the polynomial terms.
mystran wrote:Third: I would be interested in whatever references you can come up with for the "min-phase filter is smaller by a factor of 2" claim. That doesn't seem to make any sense. I'd also like to see a proof that an arbitrary minimum-phase FIR low-pass design will magically get a maximally flat group-delay (if "Bessel group delay" even makes sense for a FIR as the maximally flat group-delay condition is trivially satisfied by a true linear-phase filter).
Hah, you have to discover that yourself. I'm using that knowledge all the time, and it works (r8brain PRO is a commercially-viable example). Of course, linear-phase is linear-phase, no need to call it 'Bessel group delay'.
mystran wrote:Fourth: If you put the cutoff at exactly Nyquist/2 exactly every other sample in a windowed-sinc lowpass impulse will come out as exactly zero, and since multiplying by zero involves coming up with a zero as a result, this means you only have to convolve half the taps compared to the "not exactly at Nyquist/2" case.
Yes, indeed. Nyquist/2 should be easier on the CPU in the case of linear phase FIR filter.
mystran wrote:Finally: I would rather put it a bit LOWER than Nyquist (though moving it at all will defeat the optimization that was my point 4), since most any decent window will spread it around anyway, and you'd prefer that the transition band (which will be rather wide for a short filter) not extend too far above the original Nyquist, and slight high-frequency loss can be compensated later anyway if necessary (I was previous only objecting to the stupid amounts of high-frequency attenuation you get from cascaded one-poles, especially considering the rather awful stop-band behavior). Cursory examination of published articles about audio oversampling seems to suggest that I am not alone. In the specific application of suggested polynomial evaluation method, any aliasing that manages to enter the passband, will get propagated down from the high-frequencies by the repeated multiplications rather quickly (remember you'll always get both sum and difference).
You decide. I'm not insisting on using 1st order low-pass filters, but it's the easiest way around since x*x DOES NOT produce aliasing at 2x oversampling, and then you apply a low-pass filter again. In the end you'll have some aliasing well above 15kHz (at 44.1kHz sample rate). Do not forget that musical sounds have -3 dB/oct to -6 dB/oct slope, so their spectral power at higher frequencies is minimal and that translates to aliased components being square less than that. It's a good compromise.
Image

Post

Aleksey Vaneev wrote: You probably do not understand what I mean with Bessel group delay.
No. I don't, because it doesn't seem to match with the normal meaning (which you can find in the first sentence of the Wikipedia article you provided the link for).

Bessel filter is an approximation of linear-phase, defined by a maximally flat group delay. A linear-phase filter has absolutely flat group delay, but true linear-phase isn't possible (or practical) for a causal analog system, so you end up with the approximation. Ofcourse if we don't need flat group delay, we can design for some other criteria (say maximally flat passband which would give you a Butterworth-filter).

For a FIR filter, the maximally flat group delay condition is trivially satisfied by a linear-phase filter, and since linear-phase already satisfies the condition perfectly, anything else will necessarily have less flat group delay and will therefore not be maximally flat, which is why I don't see how the question of maximally flat group delay could possibly be meaningful for a FIR filter.

If on the other hand we ignore linear-phase filters, and only consider minimum-phase, then for a given linear-phase filter there is exactly one minimum-phase filter with the same amplitude response (ignoring any additional delays anyway). This gives us an even more absurd situation if we want to apply the concept of maximally flat group delay with a single candidate (though this concept seems quite popular in the financial world: define a segment so narrow that nobody else fits into it, then declare yourself as the market leader).

Finally, if you have an Nth order linear-phase filter, transforming that into a minimum-phase filter (flipping zeroes outside the unit-circle back inside) will give you an Nth order minimum-phase filter, and since the order of the filter doesn't change, neither will it's length. If you somehow manage to reduce the order, you either had zeroes at zero and/or infinity, or you won't get the equal (in the analytical sense anyway) amplitude response.

Post

Well, you have to understand what others say - not to expect they'll say it as you've read it in a textbook (in that case you'll just have to say them: I know it already, what's the purpose of you saying it?)

mystran, you have to practice min-phase transform before doing such conclusions. Linear-phase low-pass filter becomes Bessel-like after min-phase transform. You may derive it on practice or do some math - in either case the result conclusion will be same. I understand it as like Bessel filter has the same reasoning and mathematical basis as min-phase transform of linear-phase filter. It's all about optimization function's constraints in the end. Of course, min-phase becomes N/2 length: this fact can be used in a variety of situations where you need band rejection but do not need a linear-phase response.
Image

Post

Shy wrote:The best digital compressor/limiter/de-esser right now would be Weiss DS1-Mk2. It's hardware, it sounds like heaven, and it costs like hell. And yes, it more than rivals analog products.
I'm waiting for Algorithmix's new compressor which I believe will rock extremely hard based on the amazing Blue eq.
I'm sure it sounds awesome, but what I meant was vsti compressors. Is the FMR Really nice compressor a digital/analog hybrid? I'm sure I read somewhere that it is under digital control, and that unit can sound really nice.

I guess I drive my hardware comps quite hard and that's where analog is very forgiving if not pleasant in sound. But VSti technology is getting better and better for sure :)

Post

Aleksey Vaneev wrote: mystran, you have to practice min-phase transform before doing such conclusions. Linear-phase low-pass filter becomes Bessel-like after min-phase transform.
Could you define (with your own words, yet sufficiently formally that your intention become clear) what is it exactly that you consider "Bessel-like" about the resulting filter?
I understand it as like Bessel filter has the same reasoning and mathematical basis as min-phase transform of linear-phase filter.
Bessel filters have absolutely nothing to do with transforming filters from linear-phase to minimum-phase. You get a Bessel filter when you take a general low-pass (or all-pass, sometimes other) with a given cutoff, and then fix all the remaining degrees of freedom to maximize the flatness of the phase response. For a given order, there is exactly one Bessel lowpass.

If you want a similar basis for minimum-phase, there is indeed a similar optimization: here we minimize the group delay (for whatever amplitude response we happen to have designed).

Other than that, I don't see a connection whatsoever.
It's all about optimization function's constraints in the end. Of course, min-phase becomes N/2 length: this fact can be used in a variety of situations where you need band rejection but do not need a linear-phase response.
I guess you are confusing equal amplitude response with "very similar" amplitude response (which is what you'd normally get if you apply an optimization after the transformation), because otherwise what you are saying makes no sense. If you still disagree, then either point me to a reference (I can access most scientific journals) or provide a proof (sketch is enough, I can work the math myself, thank you very much).

Post

mystran wrote:I guess you are confusing equal amplitude response with "very similar" amplitude response (which is what you'd normally get if you apply an optimization after the transformation), because otherwise what you are saying makes no sense. If you still disagree, then either point me to a reference (I can access most scientific journals) or provide a proof (sketch is enough, I can work the math myself, thank you very much).
I'm not going to do that job for you. Please do it yourself. The response difference of linear-phase and min-phase filters is within 0.05 dB over the full spectrum. And of course the group delay is similar to Bessel filter (in whatever way you understand it - just plot it and see).

One tip for you about min-phase transform: it calculates cepstrum and so it loses half of the spectral information. Hope this gives you an idea why kernel length halves after this transform.
Image

Post

Aleksey Vaneev wrote: I'm not going to do that job for you. Please do it yourself. The response difference of linear-phase and min-phase filters is within 0.05 dB over the full spectrum. And of course the group delay is similar to Bessel filter (in whatever way you understand it - just plot it and see).
So now you agree that you don't get an equal response (equal being a formal term different from "witin 0.05dB error margin"). I find claim such as "transforming a filter into minimum-phase enables greater reduction of it's order while still keeping the response within a given error margin" perfectly acceptable, but claiming that the resulting response is equal to the original is completely non-sense. Granted you didn't use the formal term "equal" but since you also didn't mention any error-margins previously, I had to assume your use of the word "same" was just informal wording for "equal" and since I did use the term "equal" in my responses, I took it that you implicitly validate this assumption by continuing to argue.

Whether any of this makes any practical difference is another question completely, and the only reason I'm bothering to argue is that I hate few things more than ignorance of the formal aspect of mathematics. But since we were originally discussing about windowed sincs and a windowed sinc isn't necessarily an optimal (optimal being another formal term) design in any sense to begin with, why should have I assume that rather than discussing relative lengths of filters with equal response, we were actually discussing relative lengths of different filters which satisfy a given optimization criteria?

I'm not saying that I couldn't be wrong (and I love to be proved so, with "prove" being yet another formal term), or that there won't be a number of useful methods which I'm unaware of, but trying to argue mathematical concepts while ignoring the formal nature of mathematics, is IMHO useless.


Finally, about your suggestion to "practice", I have to take that as an insult, because you are implying that I am unable to see the difference between a skill which you can practice, and formal science where you might or might not be able to reach a solution (or proof), but skill will not have an effect on the existence of such a solution (or proof).

Post

mystran wrote:Granted you didn't use the formal term "equal" but since you also didn't mention any error-margins previously,
Do not feel victorious. I just do not remember which error margin I was getting. It could well be just +- 0.001 dB (that's log scale!) - actually, this is what I was saying here when I was checking the flaw of SRC benchmark http://www.nuendo.com/phpbb2/viewtopic.php?p=68091. Sorry to break your air castle. The transform is actually close to perfect match. It can't be perfect because floating point math has finite resolution (and you have to perform 4 FFT operations during transform).

I do not understand what you are arguing with. I've offered two solutions that resolve linear-phase filter's inconveniences. Show another one instead of arguing the given thing.
Image

Post

Aleksey Vaneev wrote:fabs(x) is a highly-aliased function
Can you explain, in detail, why this is? Anyone? Thanks.

Post

And today's re-animator award goes too... :D

Think about a saw wave that is perfectly aligned to a sample rate and uses it's full bandwidth. In that case the saw reset point will happen at an exact sample boundary. One sample will be +1 and the next -1 and it will not alias.
If you abs that saw you get a unipolar triangle... I forgot where I was going with this. I'm hung over. Kthxbye.

Post

Rock Hardbuns wrote:And today's re-animator award goes too... :D
Sorry I didn't start this in a new thread.
Think about a saw wave that is perfectly aligned to a sample rate and uses it's full bandwidth. In that case the saw reset point will happen at an exact sample boundary. One sample will be +1 and the next -1 and it will not alias.
If you abs that saw you get a unipolar triangle... I forgot where I was going with this. I'm hung over. Kthxbye.
I'm talking about the function itself, NOT applying the result back to the output. For example, using it to determine levels for negative sample values. I wanted to be sure some compilers, as an example, didn't change the value other than its sign by doing something funky. I realize there are other ways to change the sign of the floating point value.

Post

Please re-read the thread - I've discussed the polynomial replacement for fabs(). This also shows why it is a highly-aliased function. fabs() is like a sum of two diode half-wave rectifiers with an infinitely small transition regions each hence its harmonic content is also infinite, decaying with 6dB/oct slope (like hard-clipper).
Image

Post Reply

Return to “DSP and Plugin Development”