Oversampling to get rid of aliasing

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

aciddose wrote:I'm talking about filtering nth order discontinuities.

If you have a waveform without discontinuities a FIR filter can't be used to anti-alias it...
OK, you lost me...first of all, I'm familiar with BLEP and related techniques on discontinuities, coding minBlep I guess 15 years ago. I appreciate the nice explanation and code, and it will be a benefit to many, I'm sure. But this is moving away from the question I asked.

You said that you could generate any waveform imaginable "with FIR filters like minBLEP". I questioned that, and gave an example of a waveform with a few harmonics as an imaginable waveform. I didn't really understand your reply—you asked why that couldn't be done with FIR filters (rhetorically, it seemed), and noted that the waveform could be built up of sine waves (I think we all know that harmonics are sine waves, so this was not news). When I asked for further explanation of what you meant about creating any wave from FIRs...you give an excellent post on dealing with discontinuities.

I guess I still have the question of how FIR filters like minBlep can be used (efficiently, I presume) to create any waveform imaginable. Don't feel obligated to answer, and I'm not doing this to be argumentative, I'm just saying that I'm left with that question.

Thanks,

Nigel

PS—Perhaps by "any waveform imaginable", you meant "a wide variety of interesting and dynamic waveforms"? Either that or I'm missing something—that's basically what I'm trying to figure out from your posts.
My audio DSP blog: earlevel.com

Post

If you don't understand that a waveform with finite harmonics contains no discontinuities, I can't really explain any further. There is nothing to apply the FIR filter to in that case.

The waveform you gave as an example is a truly weird, out-there waveform. You'd only see such a thing in additive synthesis, which is best suited to produce it.

In which case if you want these finite harmonic waveforms, use additive.

For everything else you can apply FIR filters. Absolutely any imaginable waveform containing nth order discontinuities can have those discontinuities filtered by a FIR filter.

Ultimately any other waveform breaks down to a combination of the discontinuities and finite harmonics added on top. So, in those cases you need to do the same thing: use additive for those additional finite harmonics, use FIR for the discontinuities on the main part of the waveform.

So like I said, just redefine where I said "waveform" as "waveform with nth order discontinuities" and it solves the issue.

I didn't think of finite harmonic sums as a "waveform" at all, I'd call those finite harmonic sums.

You have to understand back where I explained before the waveform is sampled it exists as an abstract, just like in the table example I gave.

In the case of finite harmonics there is no abstract waveform. It isn't a waveform, it doesn't exist. It's a sum of finite harmonics.

Right? So much like we can't anti-alias sine (why? it has no harmonic) it doesn't make sense to anti-alias a sum of sines.
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.

Post

A really quick example to demonstrate that pure sin functions are "weird not-waveforms" is the fact even a flute produces an nth order discontinuous waveform. There is no source of pure finite harmonics in nature, it doesn't exist.

It's a "perfect" circle, absolutely perfect. So you have to understand that of all the other potential waveforms with nth order discontinuities this one is the only one without. (So 1/infinity.)

Now we can talk about things like orbits or oscillations, but here you must realize that the waveform is actually the result of a filter applied to an nth order discontinuity. An oscillation that exponentially decays is actually just a filter applied to an impulse, which can be synthesized with FIR anti-aliasing filters.

The part you can't synthesize this way is the filter except by combination. Or in other words the FIR filter you use would produce those oscillations, it would be the filter.

Without any discontinuity however (which doesn't exist in nature) we have no place to start from.

Sin() can not be synthesized because it contains no nth order discontinuity. If you jump from one phase to another suddenly, this contains every order nth up to infinite discontinuities. So sin() is the exception to the rule, as is any combination of sin() at different frequencies.

The same thing applies to log/exp curves. All these trig functions are like this. You can however approximate log/exp quite well with second or third order.
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.

Post

aciddose wrote:If you don't understand that a waveform with finite harmonics contains no discontinuities, I can't really explain any further.
Now this is just getting weird. I don't know if it's a language barrier or what. No, I'm not stupid, thanks.
My audio DSP blog: earlevel.com

Post

Do you understand that by "waveform" I mean "waveform containing nth order discontinuities" ?

While your example was a finite set of discrete sin() summed together.

FIR filters apply to one and not the other. No, you can't do finite harmonic sums with this method because it wouldn't make any sense.
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.

Post

OK, so I guess the tl;dr version is that you didn't really mean "You can make any waveform imaginable with FIR filters like blep." That's fine, I just wanted to clarify (my response: "I don't think you really mean "imaginable" here, do you?"), not take you to task for misstating your thoughts. I do appreciate your posts on the board, and read with interest. But please don't assume that the people you're chatting with are idiots.
My audio DSP blog: earlevel.com

Post

The reason I didn't go into a huge detailed explanation is that I thought people would understand "waveform" means "waveform with discontinuities" intuitively.

A sum of sine waves is not a "waveform" in the same sense at all. It's a mixture of many sin() rather than a single discontinuous shape. It breaks down to "any waveform imaginable except sin()".

So although you can come up with a large number of finite combinations of sin() and while you can at best approximate functions like log, exp and so forth these are very specific, finite sets. Yes, any finite combination of different frequencies of sin() is impossible to synthesize any other way.

The fact this is so obvious is the reason I didn't mention it.
Last edited by aciddose on Tue Aug 04, 2015 6:33 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.

Post

aciddose wrote:Do you understand that by "waveform" I mean "waveform containing nth order discontinuities" ?

While your example was a finite set of discrete sin() summed together.
Sure, I do understand that you mean that now, but that's the reason that I asked the question. And you didn't just say it once, so it wasn't easy for me to assume that you meant certain types of waveforms only when you said "any imaginable"—remember that this is after you told the board that wavetables were ancient technology and that with minBLEPs, "...a single table is used which is adaptable to any waveform desired."—one might assume that you were saying that any waveform you could do in a wavetable, you could do with minBLEP. So, I asked for clarification. I didn't need a lesson that harmonics can be created with sine waves (imagine that), that sines don't require anti-aliasing, and that finite harmonic series don't contain discontinuities.
My audio DSP blog: earlevel.com

Post

Yes, you can do any waveform with blep that can be stored in a table, because you can anti-alias the table itself.

The table contains a set of discontinuous points.

The options are to use integration of sinc impulses (your basic FIR filter) or to use zero-order hold and anti-alias the resulting discontinuous edges.

The naive wavetable however will produce a lot of aliasing and the only filter applied is generally a simple interpolation.

Ultimately you need to recognize the fact that a wavetable is an optimization of additive synthesis in the example case you gave. It works by sampling the sum of sin() functions into a discrete-time discontinuous format.

So again, this breaks down only to the fact that this function can't be generated in any other way. If people need sin() they can use an approximation to it... but now the real kicker.

All these approximations are nth order anyway and so can be anti-aliased using FIR filters.

Now my question: if you already know all this why are you asking questions?
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.

Post

aciddose wrote:Now my question: if you already know all this why are you asking questions?
This is just bizarre—again, maybe a language barrier. Originally, I asked about your assertion of "any imaginable waveform". Previously, you said minBLEP could create "any desired waveform" after comparing it with wavetable. Please don't pretend that it should be obvious to everyone that you meant only certain types of waveforms involving discontinuities.

So, what questions did I ask? Here:

Me: 'I don't think you really mean "imaginable" here, do you?' I gave an example of a simple waveform with just a few harmonics.

You: "Sure, why do you think you can't do that with FIR filters?"

Me: "...For instance, what are you talking about filtering?"

You: Many, many things...but ultimately you told me that there was no filtering necessary for my example, and it wasn't pertinent to the subject (I still don't understand, then, why your original response was, "why do you think you can't do that with FIR filters?", but I don't care anymore).

tl;dr: I asked two questions—if you really meant "any imaginable waveform", and the follow-up about to find what you meant when you meant by questioning why I seemed to think FIR filters weren't appropriate. You seem to be looking for justification as to why it was OK for you to act like I didn't know the most basic of DSP principles.
My audio DSP blog: earlevel.com

Post

Yes I did mean any imaginable waveform.

The problem is that something like a list of harmonics is not actually a waveform.

It's a list of numerical values!

No, you can't synthesize such a theoretical waveform, especially not a sum of sines of different frequencies with any method other than actually creating a sum of sines. Anything else would be more of a sin() function approximation!

The problem here is that you are thinking of this in a completely different way. I don't even understand what your frame is here, but I can tell you I'm 100% certain it's wrong.

As far as you comparing a sum of sines to a sampled sum of sines, this is just ridiculous. Yes you can use FIR filters on this sampled signal because it is discontinuous!
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.

Post

Just to be 100% clear:

With the waveform you proposed it is 100% possible to use the FIR filter method for anti-aliasing. Theoretically. According to the math.

What isn't possible is to actually produce an infinite order integral, or to actually apply an infinite number of every order of integral from zero to infinity. It is valid, it works, it just isn't actually practical or even possible.

It is however possible to anti-alias sin() to a limited order, it just becomes less efficient the higher order you go.

Whatever problem you're trying to point out with the statements I've made, it just seems you are confused. If there is any problem you can see it seems you are imagining it.

I wouldn't recommend more than third order because any waveform requiring greater than third order would probably be more practical to synthesize in some other way. That said, using second or third order approximation of a sine and anti-aliasing it with this method allows for sync, which isn't even possible using a wave-table.

Using the FIR method however sync of this very waveform can be accomplished with less aliasing than a typical wave-table based method would produce without sync.

Not only that but it is vastly more efficient unless your wave-tables use linear interpolation or are limited to exact frequencies.

It is also vastly more efficient than directly applying additive synthesis as each curve can be approximated reasonably well with second or third order curves and fully anti-aliased, one at a time. With additive you'd have more than one sin() approximation needing to be computed per sample and summed together.
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.

Post

aciddose wrote:Whatever problem you're trying to point out with the statements I've made, it just seems you are confused.
I only asked you a simple question for clarity—I took care to frame it in a simple, two-sentence post so as not to be misunderstood. You took it as an attack on your understanding of DSP. Sometimes a simple question is just a simple question.

I don't understand why you say that a waveform made of a few harmonic sines is not a real waveform, therefore it doesn't qualify for your "any imaginable waveform" or "any waveform you desire", yet go on to say how to synthesize it. I can't be the only one here who, in the context of generating musical waveforms for musical synth purposes, wondered about your assertion ("You can make any waveform imaginable with FIR filters like blep")—obviously, I was the only one that made the mistake of asking.

Yes, I'm confused—but not with the DSP, just you. Feel free to get in another shot, I'm done with this.
My audio DSP blog: earlevel.com

Post

earlevel wrote: OK, you lost me...first of all, I'm familiar with BLEP and related techniques on discontinuities, coding minBlep I guess 15 years ago. I appreciate the nice explanation and code, and it will be a benefit to many, I'm sure. But this is moving away from the question I asked.
How so? You asked the question, I answered, you said you don't see how FIR filters are applied, I gave an example.
earlevel wrote: I didn't really understand your reply—you asked why that couldn't be done with FIR filters (rhetorically, it seemed), and noted that the waveform could be built up of sine waves (I think we all know that harmonics are sine waves, so this was not news). When I asked for further explanation of what you meant about creating any wave from FIRs...you give an excellent post on dealing with discontinuities.

I guess I still have the question of how FIR filters like minBlep can be used (efficiently, I presume) to create any waveform imaginable. Don't feel obligated to answer, and I'm not doing this to be argumentative, I'm just saying that I'm left with that question.
So, here you've said you understand FIR filters:
earlevel wrote:I'm familiar with BLEP and related techniques on discontinuities, coding minBlep I guess 15 years ago ...
But then:
earlevel wrote: PS—Perhaps by "any waveform imaginable", you meant "a wide variety of interesting and dynamic waveforms"? Either that or I'm missing something—that's basically what I'm trying to figure out from your posts.
So you understand but don't understand? Which one is it?

What I don't understand is how you can't see that integration of sinc impulses is exactly the same as any nth order integral.

Likewise, creating zero order discontinuities and using BLEP FIR filters, linear sections and applying BLAMP FIR filters and so on up to any nth order is also identical.

If the waveform contains an nth order curve we can synthesize this, exactly as we synthesize the linear sections or otherwise and apply the nth order FIR filters to the discontinuities.

If you can see that, yet you can see some issue here (you seem to insist that this method does not therefore make it possible to synthesize any imaginable waveform with anti-aliasing) can you explain that to me? What is the issue?

In my opinion the key proof is that if you accept that a wave-table can synthesize any imaginable waveform with aliasing,

If you also accept that zero-order discontinuities in the sampled wave-table can be anti-aliased by convolution with a FIR filter (like blep, minblep and etc),

You must accept that any waveform can be anti-aliased with a FIR filter like minblep.

A (wavetable) = B (discontinuity) + C (aliasing),
B + F (convolution with FIR filter, -C) = D (filtered, aka anti-aliased),
then A + F = D.
Last edited by aciddose on Tue Aug 04, 2015 11:44 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.

Post

aciddose wrote:So you understand but don't understand? Which one is it?
You misrepresent everything I say, and now it seems intentional. Don't talk to me anymore about this.
My audio DSP blog: earlevel.com

Post Reply

Return to “DSP and Plugin Development”