linear phase oversampling

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

aciddose wrote:Sure, but if you apply a steep filter at 20k after the linear interpolation that makes up for the poor performance of the interpolation.
Are you winding me up?

First off a linear interpolator is just an FIR, same as a poly interpolator. Linear is just a triangualr window function. So you're saying use a shit FIR first and then use a hardcore IIR to fix the problems. Really?

Have you even considered what an IIR like that will cost? Try designing even a simple half band filter with such a narrow transition band. EG...

An 10th order chebychev, 88200 sample rate, cutoff 20k, 1db ripple, gives you 37db cut at 22050hz.

On top of that polyphase FIR scales linearly, IIR scales quadraticaly. If you are upsampling Nx an FIR will cost O(N), and IIR will be O(N^2), for the same frequency response. IE..

If you double the oversampling the FIR has twice as many branches, but still the same number of taps for each branch. With an IIR you have twice as many samples to process but you also half the cutoff and half the width of the transition band doubling the order of the filter required.

I have never "moved the goalposts", you have set them up in a position that makes sense for your point of view while remaining completely ignorant of others.
Ok you keep adding new qualifications, you now you agree linear is crap for upsampling but you qualify that by saying "oh but of course you would use steep filter afterwards to fix that".

Now this might be considered moving the goal posts, but this is exactly what I've been talking about all along. Consider a ramp waveform, for example. Try this yourself: measure the difference between inter-modulation distortion products produced by a "whole" waveform vs. one synthesized at audio rate then up-sampled with a "cheap" interpolation such as linear.
You are missing the point.

If you have a clean sawtooth all the way to infinity and you distort the hell out of it all you get is intermodulation products that line up on existing hamonics. As all of the input partials are multiples of the fundamental all the generated sidebands will be too.

If however you upsample your saw (excepting the special case where the fundamental is a factor of the sample rate) with a linear interpolator you now have a load of frequencies that are inhamonic to the original signal. And if you then apply a non linear process to that the sideband distortion it will produce will be all over the place. No longer nicely lined up with the original harmonic series.

That's why a single note driven hard sounds clear and strong and an Am9 chord sounds like a bag of cats getting put through an industrial blender.

If you leave those alias images around you are sticking weird inharmonic stuff through with the good stuff, and all you're gonna get out the other end is cat burger meat.

PS: Sorry just to clarify, intermodulation is fine, nowt wrong with stuff up in the inaudible range contributing, as long as it is meant to be there, if it's left over aliased crud from a crappy upsampling filter then it will sound like crap.
Chris Jones
www.sonigen.com

Post

The thing is though, the images do line up in the right conditions.

The IIR filter will be far more efficient than the FIR at the first stage, while later stages can use poorly performing FIRs to make up for stopband ripple and resulting images from the IIR.

My point all along has been that simple interpolations (you seem to distinguish different types for some reason?) will in most cases beat the performance of other more complex filters both computationally and in terms of results.

I'm satisfied that you've never used the techniques I'm describing.
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:The thing is though, the images do line up in the right conditions.
The only time they line up is if you have a clean harmonic series with a base frequency that is a factor of the sample rate, otherwise you're screwed, which means in all practical situations your screwed.

I'm actually surprised that you dont know this given your usual well informedness on most things.

The IIR filter will be far more efficient than the FIR at the first stage, while later stages can use poorly performing FIRs to make up for stopband ripple and resulting images from the IIR.
You want to decide on some specs / rules and see who comes up with the fastest upsampler?

My point all along has been that simple interpolations (you seem to distinguish different types for some reason?) will in most cases beat the performance of other more complex filters both computationally and in terms of results.

I'm satisfied that you've never used the techniques I'm describing.
You started out with "oh yes just use splines for upsampling that's easy". When I point out the problems with that you then say "oh yes of course you'd use a steep IIR after that". When I point out the problems with that you say "Oh yes of course it'd be multiple stages with XYZ in the later stages".

It's not really a spline upsampler anymore is it? I mean you have one spline stage and how many IIR and FIR stages? Why didnt you explain all this from the start?

I think you made an off the cuff statement without thinking it through and you've spent 3 pages trying to justify it by adding all these other qualifications. And now you have detailed the most retarded upsampling scheme I've ever heard of (later FIRs fixing the ripple in the intial IIR for example) and you are *ahem* satisfied that I've never use it?

You're right, but then I've also never glued a 5 items of cutlery together and tried to eat my diner with one hand tied behind my back.
Chris Jones
www.sonigen.com

Post

sonigen wrote:The only time they line up is if you have a clean harmonic series with a base frequency that is a factor of the sample rate, otherwise you're screwed, which means in all practical situations your screwed.

I'm actually surprised that you dont know this given your usual well informedness on most things.
I suppose you didn't just finish reading the descriptions I gave and the direct reference to the source in protracker.
sonigen wrote:and you are *ahem* satisfied that I've never use it
In fact now I'm satisfied you've never invested any effort into the study of this field at all, or kept up to date with papers published regularly since the mid 90s on the subject.

You are stuck in this one little area where it is critical to eliminate all even band-limited aliases regardless of what the actual application is. You also can't think of any more complex system than a single FIR filter, which you insist is optimal without considering the fact that there are countless different applications here, many of which involve entirely linear processes.

I will give you this: In the situation where you are limited to applying a single filter in a single stage, memory and computational costs are not critical and precision is provided in excess of the requirements for such a filter, where the application involves a direct up-sample of a band-limited signal consisting of potentially high harmonic content provided as a plain sample stream with no additional information available, where the process applied is a simple isolated non-linear process which will suffer from the effect of inter-modulation distortion; In this case it is likely best to apply a single FIR 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.

Post

aciddose wrote: I suppose you didn't just finish reading the descriptions I gave and the direct reference to the source in protracker.
I dont read every post everyone makes. *shrug*

I have read and replied to the posts you have directed at me.

In fact now I'm satisfied you've never invested any effort into the study of this field at all, or kept up to date with papers published regularly since the mid 90s on the subject.
LOL! Bitchy!

You are stuck in this one little area where it is critical to eliminate all even band-limited aliases regardless of what the actual application is. You also can't think of any more complex system than a single FIR filter, which you insist is optimal without considering the fact that there are countless different applications here, many of which involve entirely linear processes.
I've made it clear every time that I am talking about upsampling for non linear processing. Which 9 times out of 10 is the reason for upsampling

If you wanted to argue about something else you should have said so.

But FWIW if what your doing is linear you very likely dont need oversampling to begin with, but if you do then the aliases will fold back onto the originals, so you'll get a slightly altered frequency response, but no weird intermodulation noise.

See i do know something else!
I will give you this: In the situation where you are limited to applying a single filter in a single stage, memory and computational costs are not critical and precision is provided in excess of the requirements for such a filter, where the application involves a direct up-sample of a band-limited signal consisting of potentially high harmonic content provided as a plain sample stream with no additional information available, where the process applied is a simple isolated non-linear process which will suffer from the effect of inter-modulation distortion; In this case it is likely best to apply a single FIR filter.
Have you considered that you're just shit at writing polyphase FIR code?
Chris Jones
www.sonigen.com

Post

I would rather trust countless papers on the subject. FIR has become more efficient as an interpolation due to the wide support for SIMD intrinsics and its applicability to parallel processing.

Nevertheless, current papers on the subject reliably give hybrid systems as the most efficient possible.

I wanted to talk about "something else" all along. I've started every post by explaining that there are configurations in which simple filters will out perform lengthy ones. I have never said anything else. I have never said they are always better, that they are the best possible solution for any particular problem, or that lengthy FIR interpolations are necessarily incorrect solutions to any particular problem.

My intent all along has been very clear: There are a lot more cases for up-sampling where steep single filters are not required versus the cases that they are.

I'm not saying you're wrong, I'm defending my position which is the same position I have stuck to and will continue to stick to and it seems you disagree with.

I get the impression you've jumped into the thread without reading the discussion me and mystran already went through?

He said he feels a single FIR makes more sense than using a IIR 2x to ease the requirements for further stages. That can make sense in some cases but not others, it depends like everything on the specific requirements you have.

I said in certain cases using a simple polynomial interpolation will even be able to out perform a FIR or IIR+FIR hybrid or otherwise. This again depends upon the particular case and which polynomial interpolation is used and so on.

This statement seems to have set you off.
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:I would rather trust countless papers on the subject. FIR has become more efficient as an interpolation due to the wide support for SIMD intrinsics and its applicability to parallel processing.
I would rather trust my experience. It scales better, pipelines better, can be SIMD better, needs only one buffer that only has to be rotated once per input sample, no matter the level of upsampling. They are easier to design, easier to implement, and easier to leverage to different levels.

I've tried polyphase IIR, plain IIR, stages, all in one, they just never give what they promise. I even tried designing my own parallel allpasses with differential evolution in an effort to make IIRs that were more SIMD freindly. Always in asm / SSE.

Nevertheless, current papers on the subject reliably give hybrid systems as the most efficient possible.
Citations please.

I wanted to talk about "something else" all along. I've started every post by explaining that there are configurations in which simple filters will out perform lengthy ones. I have never said anything else. I have never said they are always better, that they are the best possible solution for any particular problem, or that lengthy FIR interpolations are necessarily incorrect solutions to any particular problem.
I mean you cant claim I'm fixated on non linear processing when you made no effort to say that you could be upsampling for linear processing.

I'm not saying you're wrong, I'm defending my position which is the same position I have stuck to and will continue to stick to and it seems you disagree with.
We cant both be right.

He said he feels a single FIR makes more sense than using a IIR 2x to ease the requirements for further stages. That can make sense in some cases but not others, it depends like everything on the specific requirements you have.
I agree with mystran, I think you can do better with a single FIR stage. At worst it'll cost about the same.

You save half the calculations by zero stuffing, and you will at least draw level because SSE/pipelining and less filter state bookkeeping.

I said in certain cases using a simple polynomial interpolation will even be able to out perform a FIR or IIR+FIR hybrid or otherwise. This again depends upon the particular case and which polynomial interpolation is used and so on.
If you're on a dsp where everything takes one cycle, maybe. With SIMD hmm i doubt it, with an out of order execution CPU, no way.

This statement seems to have set you off.
To be honest I thought I did ok, it only took 3 or 4 snide comments from you before I started poking back. :)
Chris Jones
www.sonigen.com

Post

sonigen wrote:
He said he feels a single FIR makes more sense than using a IIR 2x to ease the requirements for further stages. That can make sense in some cases but not others, it depends like everything on the specific requirements you have.
I agree with mystran, I think you can do better with a single FIR stage. At worst it'll cost about the same.
I didn't even suggest using IIR 2x as the first stage, as I thought this was a thread about linear phase oversampling.. and frankly I think it's a bit silly. I did mention doing the reverse, with true linear phase FIR at low-rate, then approximately linear-phase IIR for the higher rates, as you get a wide transition region for the IIR that way.. but really for the typical reasonably low oversampling factors, I don't see much point in any type of cascades; you might lose a few extra flops, but flops aren't very good performance metric anyway.

Post

mystran wrote: I didn't even suggest using IIR 2x as the first stage, as I thought this was a thread about linear phase oversampling.. and frankly I think it's a bit silly. I did mention doing the reverse, with true linear phase FIR at low-rate, then approximately linear-phase IIR for the higher rates, as you get a wide transition region for the IIR that way.. but really for the typical reasonably low oversampling factors, I don't see much point in any type of cascades; you might lose a few extra flops, but flops aren't very good performance metric anyway.
In my experience the main problem with IIR (and to some extent FIR) cascades is all the extra book keeping / memory shuffling. You have filter state for each stage, and you have to shuffle that state for each itteration, so for for 8x, you have 2x+4x+8x, that's 14 sets of state shufflings, plus whatever loads and stores between stages.

With polyphase FIR you can keep the state in SIMD registers for the entire process. And then you have 1 rotate, and store it back at the end. At least up to 24 taps anyway.
Chris Jones
www.sonigen.com

Post

First of all, I wanna thank you for this alive discussion about the topic of my interest, secondly I want to apologise, as the culprit with the latency was due to a bug in my oversampling code :oops: . So it turns out that what I was trying to archive was already there in my code, and is quite ordinary. I just forgot to adjust the delay line to be shorter by the factor of the oversampling.

I remembered back when i was writing the original code i thought to my self I somehow should be able to optimise out the stuffed zeros from the calculation. Turns out this is what the polyphase implementation does. great, now i can clearly understand how to optimise the up-sampling :) thanks to you for posting the links :)

I have another question thought. When downsampling with a polyphase structure. can't i just process every Nth sample with the original filter kernel and end up with the same amount of calculations instead of using the N branches? Or isn't this basically what happens anyways?

Cheers!

JM

Post Reply

Return to “DSP and Plugin Development”