The aliasing thread

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

Post

They are. They just don't appear in the good algorithms cuz they're filtered, as expected.
I thought the test was only about white notes, and since a MIDI file doesn't even seem to be provided, I judged by the screenshots.. Not that it matters, except that, by luck, the aliasing occurs for those notes I was missing.

Why isn't a MIDI file provided? Apparently the test for your own sampler is missing a note as well:

http://www.flstudio.com/gol/Test.jpg

where's the 7th? It seems to show that the 7th has a wrong pitch (I guess it's not and the test wasn't done properly)
Concerning linear, I hear how bad it sounds, how unpredictable it behaves when different resampling ratios are used and I think anyone who would care can easily spot it
for the record this sytrus test has no interpolation at all. Not even linear. Just to say that 'linear sucks' shouldn't be generalized, it all depends on the samplerate of your source sample data.
That PDF doc I mentionned also tells about using a big oversampling, and then linear interpolation. At some point, a lot of oversampling might look like a waste of CPU, BUT linear can be implemented so fast that you could end up with something fast. I mean, a sinc is easily A LOT slower than linear, so you could compare this to a 64x oversampling+linear.
Last edited by tony tony chopper on Wed Sep 22, 2004 7:20 pm, edited 1 time in total.

Post


Post

why does the last note seem to fade out with higher qualities? Doesn't it look like the same filter slope you mentionned? Mine being a little too high above nyquist, and yours a little too low? I know you're using a sinc, but the results are comparable.

Post

for the record this sytrus test has no interpolation at all. Not even linear. Just to say that 'linear sucks' shouldn't be generalized, it all depends on the samplerate of your source sample data.
That PDF doc I mentionned also tells about using a big oversampling, and then linear interpolation. At some point, a lot of oversampling might look like a waste of CPU, BUT linear can be implemented so fast that you could end up with something fast. I mean, a sinc is easily A LOT slower than linear, so you could compare this to a 64x oversampling+linear
Of course. Linear can be great at Gigahertz samplerate.

I mean "no-oversampling, linear interpolation".

-René

Post

why does the last note seem to fade out with higher qualities? Doesn't it look like the same filter slope you mentionned? Mine being a little too high above nyquist, and yours a little too low? I know you're using a sinc, but the results are comparable.
Because the test is old, and it was performed on SoundFonts. In SoundFonts, the voice filter (not the interpolation one, the one used for sweeps and stuff) is not deactivated, so you get some filter effect even when setting it to the maximum cents spread.

When using 'the sfz format' files that doesn't happen. Perhaps I should update the test results... someday.

-René

Post

so you get some filter effect even when setting it to the maximum cents spread
but what does this have to do with the different qualities shown?

I mean, from qualities 36 to 72, the highest note disappears, and the one before fades out.

Post

but what does this have to do with the different qualities shown?
Nothing, it's just to emulate the behavior of the EMUAPS. Different qualities result in different bandwidth compensation algorithms,

-René

Post

Nothing, it's just to emulate the behavior of the EMUAPS. Different qualities result in different bandwidth compensation algorithms
Are you really sure it's not the sinc itself? Because the one I use also fades the highest note out with more points.

I'm not even saying it's bad - it's above 19-20khz and we can't hear it. Even less important at 48khz. But what I'm saying is that, having those inaudible freqs fading out is as 'bad' or as 'good' as having new ones wrapping around those freqs.

Post

René, with your method, when you pitch up the sound, to keep a constant SNR you have to lower the cutoff frequency and reduce in proportion the transition band, increasing filter length, hence the CPU load ? So if you play a sound 5 or 6 octaves above its natural rate, it will take more CPU, right ?

-- Laurent

Post

Are you really sure it's not the sinc itself? Because the one I use also fades the highest note out with more points.
Here's the test performed on a straight wav file instead of a sf2:

http://www.rgcaudio.com/images/sfzformat-72.gif

As you can see, it has flat frequency response up to 20kHz, which was the design goal as I explained previously. The impulse is crafted to allow rollback above 20kHz.
René, with your method, when you pitch up the sound, to keep a constant SNR you have to lower the cutoff frequency and reduce in proportion the transition band, increasing filter length, hence the CPU load ? So if you play a sound 5 or 6 octaves above its natural rate, it will take more CPU, right ?
Not at all. The sinc size is constant, so is the convolution size and consequently the CPU usage.

Another non-mentioned benefits of this method are:

- It doesn't matter how much you pitch up the sound. Aliases will never return.
- It works at any samplerate, and it will always give you near-nyquist bandwidth. Here's a sweep from 0 Hz to 48kHz in a 96kHz wav file rendered:

http://www.rgcaudio.com/images/96k.gif

[edit] it does have a few disadvantages too, but I'll let someone else to mention those ;)

Give it a try Fire, sfz is freeware. Drop a 15kHz wav file in the GUI and start measuring!

http://www.rgcaudio.com/sfz.htm


-René

Post

René wrote:Give it a try Fire, sfz is freeware. Drop a 15kHz wav file in the GUI and start measuring!
The 15kHz sine wave shows alisasing coming from the spectrum high end of the original signal, but not the aliasing coming from the beginning of the low-passed zone (the transition bandwidth). This kind of test can be achieved with a signal filling the whole spectrum. My prefered one is a sawtooth wave at low frequency, because it is easy to distinguish aliased harmonics from the natural ones.

So I loaded SFZ with a sawtooth, 4096-sample period, 384 kHz sampling rate. I set the quality level to 72 (max), and played notes from C8 to G10, rendered at 44.1 kHz.

Here is the result:
Image[Spectrum] [RARed WAV]

Detail of the C8 note:
Image[Spectrum] [RARed WAV]

As you can see, the aliasing level is quite high ;)

Note: the test signal is a "naive" sawtooth, however the period being integer, the aliasing doesn't show, excepted by making a bit stronger the harmonics in the high frequencies. This can be verified in an FFT scope.

-- Laurent

Post

As you can see, the aliasing level is quite high
I'm afraid that your test is showing the aliasing existing in your sample :)

Think about it this way: this is how the spectrogram of a 15kHz, 18kHz and 20kHz naive sawtooth looks (a 15 seconds snippet, not a single-cycle):

http://www.rgcaudio.com/images/15-18-20 ... esized.gif

Note that we're talking about a resampler to play samples. So, the algorithm is acting on an -existing and previously bandlimited- sample, then we only have to measure the aliasing introduced by the player.

It is not a 'synthesizer sawtooth bandlimiting', where we know beforehand the equation of the waveform we're dealing with, so we can 'get rid' of unwanted harmonics. Note that even when your sample period is integer, it's integer for only the base note. And there's nothing wrong with what the resampler is doing when it transposes it: a discontinuity is a discontinuity at any samplerate :)

I suggest you to re-perform your test with an already bandlimited sawtooth, or with a simple multiple sine wave (adding many sine waves).

Also please note that uppitching a 4096-sample/384kHz cycle to about 4.5kHz in your spectrogram, a 48:1 uppitching process takes place.

That's over 5 octaves transposition, while all the tests we've been discussing are within the one-octave range.

-René

Post

Here's my result when running the 'multisine test' in sfz:

http://www.rgcaudio.com/images/1-5-10-15-20k.gif

The test was performed as follows:

1- Create a waveform which is a stack of 5 sine waves: 1kHz, 5kHz, 10kHz, 15kHz and 20kHz, all at same level. I used 5 seconds for the sample.

2- Play the waveforms up in semitone steps starting from untransposed (root note). I've rendered it for a four-octave transposition, which doubles the specified range for sfz.

3- Set sfz to 72, render to wav.

-René

Post

René wrote:I'm afraid that your test is showing the aliasing existing in your sample :)
With integer period, aliased harmonics of naive waveforms exactly cover the regular harmonics.

You can check, there is no visible aliasing (I mean unwanted tones between the true harmonics) on [this sample], which is the sample I used in my test, shortened for the web. If you need to plot quickly a spectrogram to see the content, check [this one], a 256-sample loop also generated with the Tone function in CEP. It's not a perfect sawtooth because the latest harmonics are a bit louder than a perfect one's, but the exact harmonic amplitudes are not important here for this test.
Think about it this way: this is how the spectrogram of a 15kHz, 18kHz and 20kHz naive sawtooth looks (a 15 seconds snippet, not a single-cycle)
Yes, I know how are acting act the Evil Naive Waveforms (tm), and once again, my sample test doesn't look like that.
Note that we're talking about a resampler to play samples. So, the algorithm is acting on an -existing and previously bandlimited- sample, then we only have to measure the aliasing introduced by the player.
Of course.
It is not a 'synthesizer sawtooth bandlimiting'
It is, with the above-mentioned specificities.
Note that even when your sample period is integer, it's integer for only the base note.
This is not a problem, because it loops perfectly. It's a true periodic signal, whereas naive waveforms whose period is fractional aren't.
That's over 5 octaves transposition, while all the tests we've been discussing are within the one-octave range.
I took this extreme example to show you the point I exposed previously: when you lower the cutoff of a FIR, you have to increase its size if you want to keep the same transition bandwidth/cutoff ratio, which is relevant in the downsampling process to achieve a constant quality.

-- Laurent

Post

I took this extreme example to show you the point I exposed previously: when you lower the cutoff of a FIR, you have to increase its size if you want to keep the same transition bandwidth/cutoff ratio, which is relevant in the downsampling process to achieve a constant quality.
The 'extreme test' tests the sfz player (not the sinc method) doing something it's just outside what's designed for.

Even playing the sample base note, a resampling of 8.x:1 is required (it's 384kHz sr), which is a three octave transposition. Then the test goes from G8 to G10, requiring five more octaves for a total of eight octave uppitching.

sfz does only precalculate impulses for two octaves, which is what the SoundFont spec asks for. Beyond that, it keeps using the last impulse.

Making the player run beyond that is plain easy, but as the impulses are precalculated this would result in some extra memory allocated for a completely uncommon use.

-René

Post Reply

Return to “Samplers, Sampling & Sample Libraries”