The aliasing thread

Sampler and Sampling discussion (techniques, tips and tricks, etc.)
Post Reply New Topic
RELATED
PRODUCTS

Post

If I'm not mistaken, SB Live uses 8 point SINC, and results _may_ be better than hermite + 2x oversampling in CPU and quality terms
I don't know much about this, but all I know is that the sinc that's in FL [thx arguru] only starts to be an improvement over the 6 point hermite [thx olli niemitalo] over a lot of points, like 32 or 64 I don't remember. I was clearly preferring the 6 point hermite (well, one of the hermite) over even a 16 point sinc during my tests.

I know the audigy uses 8 points, but are you sure it's a sinc?

Post

gol wrote:I know the audigy uses 8 points, but are you sure it's a sinc?
Creative Audigy 2 is using a "patented 8-point interpolation". Check it out at MAZ website

Post

I'm going out for lunch. Once I get back, I will run a very simple test with SFZ Draft and 72 quality modes. Run two instances, each one to its own channel. (LEFT and RIGHT of a Stereo WAV file) and both play that MIDI file, and a SAW waveform. Pitched around 1000hz. Now, get the resulting WAV file, invert the LEFT channel, MIX both (without any artifacs like filters or anything like that) and you get the diference from one DRAFT mode to the 72 HQ mode. This is what will show best the diferences from one synth to another.
I'm afraid that test would show absoultely nothing else than how a 1khz saw would sound. A saw wave has a decreasing frequency spectrum, so it won't be good for showcasing nor aliasing neither interpolation noise at all.

Finding a resampling algorithm means finding a solution for a problem like any other. There's no such a thing like a 'best' solution, as different solutions make different compromises and use a different amount of resources.

For instance, it would be very simple to say that 'using oversampling is the best'. However, it is very easy to forget that using oversampling requires a filter which in most implementations will introduce extra latency to the stream, as it's easy to see in any oversampled implementation. Some applications and users might tolerate it, but some others might not (like me). I for instance don't want a delay in a sampler. Noteven a 16-sample delay.

Also, oversampling generally involves storing the pre-oversampled version in memory, resulting in higher memory requirements.

Hermite, bicubic and all the 'naive' interpolation modes are not banlimited. They offer different results, and they might work fantastically for different people, specially the ones working at 48/96k. However, just play a crash cymbal in any sampler using hermite and listen to it. It sounds like k-rap to me. However, it might sound good for others. It's a matter of how good is good enough for you, and that's related to how well you hear.

So when evaluating a particular implementation, it's important to evaluate the whole result, including quality AND resources usage, and then decide about that implementation based on how the scheme fits in a particular need. Some user might say 'I don't care about CPU, I want the best when rendering', other might say 'I don't care about memory, I have 16Gb', other might say 'I don't care about quality, I just want it zero CPU'.


Now, something that hopefully everyone will agree with me is: linear interpolation does NOT offer good sound quality, and most samplers in George's list show the typical noise of linear interpolation.

Anyone can hear it. Even my deaf neighbor. And if anyone tries to convince you that it does sound well, look at him sideways. It's just plainly not true.


One might think that hugely multisampled libraries make the resampling unneeded, but that's not true. I own almost every sample library on earth, and if you examine most of them you'll see that every sample is retuned. You'll see 5, 10 or 40 cents manual retuning in every sample library. Even when they could use a high-quality offline resampler, reprint the wave file and set the dynamic tuning to zero, most vendors aren't doing that. One might think that 'a few cents' wouldn't be noticeable, but that's again a complete conceptual mistake: resampling from 44.1 to 48 is much worse than resampling from 44.1 to 88.2, for instance.

Also, if you use above libraries in 48k or 96k, then you're resampling every sample on-the-fly again.

I'm so surprised that George's graphics, which can be reproduced by anyone else, and which show a test sampler manufacturers have been doing for years, have offended some people. I'm even more surprised that some people 'do not believe' in them, as if they were crafted by black arts.

Do the graphics show how good the tested samplers sound?

No. They show how high is their interpolation noise and how much they alias, in the cases not using bandlimited interpolation.

But... isn't that the sound?

No, only part of the sound. There's no point in having zero interpolation noise if the thing squeaks when you turn the volume up, if it doesn't follow the specs in a sample format precisely, if the envelope generators click or if the pan knob is reversed. Sound is composed by the whole feature set of the sample player, and it might be VERY BAD even with a GREAT interpolation noise and aliasing figure.

So, how important is that part of the sound?

The answer is somewhere in between 'Zero. I don't care' and 'It's the most important feature of the player'. This is the reason why there's no such a thing as a 'standard' solution.

Complex? perhaps. However, the graphics are the truth, you like it or not :D

-René

Post

Great post Rene :lol: Master of the understatement :D
Music with dinner is an insult both to the cook and the violinist.

Post

Creative Audigy 2 is using a "patented 8-point interpolation".
yes, it just says 8 point
However, it is very easy to forget that using oversampling requires a filter which in most implementations will introduce extra latency to the stream, as it's easy to see in any oversampled implementation
check Sytrus - do you get any? Just check the 64x oversampling, render, and tell me if you get any delay.
Also, oversampling generally involves storing the pre-oversampled version in memory, resulting in higher memory requirements.
no, that's mip-mapping. By oversampling I just mean: process at n times the samplerate, then downsample n time.
linear interpolation does NOT offer good sound quality
it just depends on the 'size' of your samples. If you want to render a sinewave, and you're using a *huge* precomputed sine, you don't even need any interpolation. But ok this is not for a sampler.
I'm even more surprised that some people 'do not believe' in them, as if they were crafted by black arts.
It's more that they're a little biased. As I wrote, a sampler that's able to pitch over 2 octaves without any aliasing isn't better in any way, since it's not a criteria, unless you use soundbanks that contains samples pitched above +2 octaves (do you?).
For a synthesizer it'd be another story.

That's why I claim that 2 or 4x oversampling would be perfect, since a 4x oversampling would allow samples to be pitched [using a correct interpolator of course] up to +2 octaves without any artefact. For almost all soundbanks out there, a 2x oversampling and a 4 to 8 points interpolator would, I think, give perfect results.

Post

Yes, great post, René. I think that sawtooths and square waves make for fairly good test cases, though. I mean, all (or virtually all) harmonic sounds have decreasing energy in their higher harmonics, but with sawtooth tests 1) we (almost) all know what a good saw/square should sound like 2) while high frequency energy may be fairly low, there's still plenty of it and it doesn't take too long for a poorly interpolated sawtooth to sound like crap and 3) you can plot its spectrum/spectrogram and easily see where the aliasing distortion is. A cymbal might be better for listening tests, but I think sawtooths and square work pretty well if you're going to plot the results.

Post

I must note that I do develop sample libraries (due to recent circumstances I have been).

Not all sample libraries are pitch corrected, some of us actually take the time to do things correctly. Check out the lastlibs bass guitar, every note multisampled with no pitch corrections. It's only 1 cd even.

I think this is a point where I agree with something rene seemed to insinuate. This is only a problem when the sample developers are doing something very wrong.

Of course if you're using the sampler for other purposes than emulating an intrument, it's all fascinating... but Im in no way interested in that portion of the world. There's very little use pitching samples these days, it's the old mindset that's crept in to our new technologies. a multisampled guitar, for every note with a reasonable sustain is maybe 1gb? That's not beyond anyone's means thesedays. And there are people out there who make this stuff available very cheap because we enjoy the work, not the $$.

carry on

Post

Quote:
However, it is very easy to forget that using oversampling requires a filter which in most implementations will introduce extra latency to the stream, as it's easy to see in any oversampled implementation


check Sytrus - do you get any? Just check the 64x oversampling, render, and tell me if you get any delay.
Sorry, I haven't checked Sytrus. It plays 64x realtime? As you know, latency is only a problem realtime, not when rendering. In any case, I'm not talking about any particular sampler. I'm talking about all inplementations I've analyzed.
no, that's mip-mapping. By oversampling I just mean: process at n times the samplerate, then downsample n time.
I'm afraid you're confused. Oversampling is the process to rise the samplerate of a sample. There are two ways to do it: realtime (high CPU, same memory), or the most used which is pre-oversample (low CPU, higher memory).

it just depends on the 'size' of your samples. If you want to render a sinewave, and you're using a *huge* precomputed sine, you don't even need any interpolation. But ok this is not for a sampler.
Sorry to disagree. With ANY sample size and content it sounds ABSOLUTELY bad, though this is much more noticeable with orchestral instruments. Just set a good couple of studio monitors with a good soundboard and a silent environment and A/B it.

It's more that they're a little biased. As I wrote, a sampler that's able to pitch over 2 octaves without any aliasing isn't better in any way, since it's not a criteria, unless you use soundbanks that contains samples pitched above +2 octaves (do you?).
For a synthesizer it'd be another story.
It's not the graphics, it's how you look at the graphics, and what you can see.

The graphics show that many (most?) samplers create a horrid noise when transposing ONE semitone (not two octaves), and perhaps as much noise as they do when transposing two octaves. Transposing one semitone is a pretty standard task in any sampler and sample set.
That's why I claim that 2 or 4x oversampling would be perfect, since a 4x oversampling would allow samples to be pitched [using a correct interpolator of course] up to +2 octaves without any artefact. For almost all soundbanks out there, a 2x oversampling and a 4 to 8 points interpolator would, I think, give perfect results.
There's two different concepts going on I believe: interpolation noise, and bandlimiting.

4x oversampling will lower the interpolation noise for any interpolator, and it will allow transposing +2 octaves without artifacts as you well say.

However, the interpolation noise obtained by a well-crafted convolution interpolator might be a hundred times lower than linear interpolation on 4x.

Noticeable? Depends on material, equipment and... ears.

-René

Post

Yes, great post, René. I think that sawtooths and square waves make for fairly good test cases, though. I mean, all (or virtually all) harmonic sounds have decreasing energy in their higher harmonics, but with sawtooth tests 1) we (almost) all know what a good saw/square should sound like 2) while high frequency energy may be fairly low, there's still plenty of it and it doesn't take too long for a poorly interpolated sawtooth to sound like crap and 3) you can plot its spectrum/spectrogram and easily see where the aliasing distortion is. A cymbal might be better for listening tests, but I think sawtooths and square work pretty well if you're going to plot the results.
For plots, I suggest sines and sweeps. For listening tests, I suggest using material in every frequency range.

I mentioned Hermite as it's the one used in at least one kommercial sampler. Hermite, Lagrange, bicubic and most other non-bandlimited interpolation modes have the effect of generating higher noise for higher sample frequencies. So you can make a great sampler for bass players using them :D

Djeez, I've been checking past pages in this thread, incredible amount of friction. I just wanted to plot another example of what I meant in my previous post.

By far, the sampler implementation I admire most (apart from our own :D) is the one in Jeskola XS-1.

It's smart, well done and it does a great job in finding a sweet-spot in cpu/quality trade. Oskari once unveiled how it works at #musicdsp, brilliant.

As it was designed for a SoundFont player, it doesn't have to play 96kHz samples. However, other samplers might need it. sfz+ for instance, will play samples of any samplerate. This is a comparison of a sweep sine up to 48kHz, and a two-octave transpose in each:

http://www.rgcaudio.com/images/sfz+xs1-2.gif
http://www.rgcaudio.com/images/sfz+xs1-3.gif

Does this mean sfz+ has a better resampling unit? No. It means the test pushed XS-1 beyond design limits. However, this is conclusive for 96kHz samples. Isn't it all subjective? :D

-René

Post

Sorry, I haven't checked Sytrus. It plays 64x realtime?
it can, if you have the CPU for. Realtime or rendered (I don't do any compensation for it when rendering), you won't get any latency (and I don't see why you would - I'm downsampling)
I'm afraid you're confused. Oversampling is the process to rise the samplerate of a sample
it's also common to call 'oversampling' the 'oversampling/downsampling' combo you do to process something at a higher samplerate.
Since here the sampler is only generating, it should be 'downsampling', but we'd confusing with the resampling this thread is about.
Pre-oversampling is certainly more called mip-mapping, it's what all 3D cards do for ages (and now on top of mip-mapping that gets rid of moirage, they also all do oversampling to reduce that 'other aliasing').
With ANY sample size and content it sounds ABSOLUTELY bad, though this is much more noticeable with orchestral instruments
Just precompute like, 16000 samples of a single sine cycle. You can peek in it and make a perfect oscillator without any interpolation, there are really enough samples for that.
But as I wrote, this is more for a synthesizer, not sampler (although nothing would prevent you to load such a huge shape in a sampler).
However, the interpolation noise obtained by a well-crafted convolution interpolator might be a hundred times lower than linear interpolation on 4x
I'm pretty satisfied with the 6-point hermite used in FL

Post

Noticeable? Depends on material, equipment and... ears
anyway, for that other aliasing, there's no perfect interpolator. Unless you take ALL of the samples into account to interpolate just 1.

Post

it can, if you have the CPU for. Realtime or rendered (I don't do any compensation for it when rendering), you won't get any latency (and I don't see why you would - I'm downsampling)
Does sytrus play external samples? perhaps you're analyzing the problem from a synthesizer point of view, where you can create the 'original sample' pretty much as you like. In that case, you're downsampling (decimating actually) only.

However, for a sampler you need to do both: upsampling, then downsampling. That's the only way to move a sample to an arbitrary samplerate. The problem here is much more complex.

http://www.dspguru.com/info/faqs/mrfaq.htm


While downsampling, it is required to pre-filter the contents to avoid harmonic content beyond the new samplerate nyquist limit. That's generally performed by an symmetric impulse fir filter, and that's where the latency comes from.


Just precompute like, 16000 samples of a single sine cycle. You can peek in it and make a perfect oscillator without any interpolation, there are really enough samples for that.
That's pre-oversampling :)
As you said, that's only for a synth. It wouldn't be practical to precompute 16000 samples of -each cycle- of a 300Mb Bass sample.
anyway, for that other aliasing, there's no perfect interpolator. Unless you take ALL of the samples into account to interpolate just 1.
As long as the interpolation noise goes below the output's bit resolution, we can consider it perfect.

For 24-bit, having a -144dB interpolation noise makes a perfect resampler. While we don't have 32-bit converters, we're done :D

-René

Post

Does sytrus play external samples? perhaps you're analyzing the problem from a synthesizer point of view, where you can create the 'original sample' pretty much as you like. In that case, you're downsampling (decimating actually) only
I'm resampling just like a sampler would do, then downsampling. I don't see why this would introduce latency(?)

If it was a sampler (and it is, it's just not allowing alien samples), I'd just resample (call it oversample if you want, since it'll effectively oversample most of the time) using a 6-point hermite. From there I have the sample already resampled and running at n times the samplerate. Now I just downsample n times. Only oversampling that occured is the sampler's own resampling.
While downsampling, it is required to pre-filter the contents to avoid harmonic content beyond the new samplerate nyquist limit. That's generally performed by an symmetric impulse fir filter, and that's where the latency comes from
just give a try to sytrus.. and tell me if you get any latency. You will get something like 2 samples for a 64x oversampling. Or check the fruity waveshaper - it oversamples AND downsamples.
(and don't ask me how it works, I didn't write the resampler - but don't tell me it doesn't work)

Post

I'm resampling just like a sampler would do, then downsampling. I don't see why this would introduce latency(?)
The answer to this is in my previous post: when downsampling, you need to use a low-pass steep filter, generally a fir filter.

If it was a sampler (and it is, it's just not allowing alien samples), I'd just resample (call it oversample if you want, since it'll effectively oversample most of the time) using a 6-point hermite. From there I have the sample already resampled and running at n times the samplerate. Now I just downsample n times. Only oversampling that occured is the sampler's own resampling.
To start, with that method if you were allowing external samples, then you would need n times the storage required by the original sample. Assuming you will upsample it on load, the loading operation would also take way longer than the 'standard'.

Then you would still need a fir filter to downsample it, as the oversampled sample is at Nx the standard samplerate.

Then you would have certainly some delay.

Doesn't sound like anything you could use in a real-world sampler to me. But perhaps it's just me.

[edit] 6-point != 6x :D

-René
Last edited by René on Wed Sep 15, 2004 6:01 pm, edited 2 times in total.

Post

just give a try to sytrus.. and tell me if you get any latency. You will get something like 2 samples for a 64x oversampling. Or check the fruity waveshaper - it oversamples AND downsamples.
(and don't ask me how it works, I didn't write the resampler - but don't tell me it doesn't work)
Checking Sytrus is pointless, as if I can't load an external sample into it I couldn't know what's the interpolation noise figure. I understand that the Fruity Waveshaper allows processing an external sample? I will check it out if so.

-René

Post Reply

Return to “Samplers, Sampling & Sample Libraries”