Antialiasing low end?

Hi guys I’m trying to get my pitching audio file player to sound better, so I tried some stuff with interpolation techniques and downsampling, and that cuts off most of the aliasing on the high end, but I’m getting a bit confused on how aliasing actually works on the low end. Let’s say I have an audio file that contains a bunch of stuff in the 20 to 40 hertz region. When I pitch this down I get sort of a high ringing sound in the output which sounds similar to bitcrush, even though I’m interpolating etc. If I would let’s say pitch down an octave woudn’t that 20 hz tone just turn into a 10 hz tone which would also not cause aliasing? Where does the high end ring come from?

1 Like

really depends on the used algorhythm. I assume you use a timedomain PSOLA variant.
The most likely reason is that you’re using buffersizes smaller than the period of your bassnote…
If you want to pitch down a 20 hz tone, you have to at least “grab” 0.05*44100= 2205 samples, assuming 44k1 samplerate.
Otherwise your connect and smooth attempts will fail and create a buzz at every frame.
Your PSOLA algorhythm most likely can not detect whether the line is a slow moving bass line, or a high frequency. Only a longer buffer can fix that, freuqencies below the buffersize are generally not supported.

I’m just trying to pitch down a sample by playing it slower, I’m not talking about any form of time scaling here. @guitarpolson

ah ok.
did you test with a pure sine input?
normal musical bassnotes have all kind of HF content, which will reveal itself once the root note is inaudible because it has become so low.

It is more like a high ring that wasn’t there in the original content, it sounds like a bitcrush.

better check with SPAN (sepctrum anaylser from Voxengo). the high ring might allready have been there, but inaudibily high

I’m comparing to ableton at the moment which seems to filter it out then. Pitching up I’m getting a pretty similar quality now but pitching down ableton doesn’t have any of these artifacts.

noise near nyquist (22050) is very common. Just filter it out before pitching. I had this issue a few weeks ago: my audiointerface also makes noise there…

the closer you come to nyquist, the rougher the data is: there is no sines there, just pulse rows… that translates to bitcrushy sound once shifted to a lower playbackrate…
So you could actually upsample the whole thing, make real sines there, and then ptich it down…

upsample * 2
LP filter this at 22050 ( or a bit lower)
playback upsampled material at 0.25 speed will give you 0.5 speed of original without the nyquist distortion

I’m currently using lagrange interpolation to read fractional sample indices at X2 oversampling and then downsampling using PolyphaseIIR, shouldn’t that already filter out the highend, or do I need to add an extra lowpass. To be fair it doesn’t seem like the interpolation has alot of effect at the moment, but that’s probably because I still have this more noticeable artifact.

fractional samples is needed for fluid playbackrate, that is ok in any case.
I suggest upsampling, apply lowPass there and then straight to playback or downsampling… i am not familiar with polyphaseIIR, do you need that for just a playbackrate adjust?

The JUCE DSP module has an oversampling class that has this option for downsampling, which is supposed to be a halfband filter, so that should have removed it right?

well: yes.
But there is a second layer of noise: there is this theoretical level, and there is a practical level. meaning: my audiointerface e.g. creates real noise around nyquist… And that will not be filtered out by the halfband algorhytm unless you put the LP lower than nyquist, e.g. 17k

I could only trace this noise in SPAN… I thought my work sucked because of the noise, but it was the interface…

Maybe this also explains why playing really high pitches in ableton seem to have a lower gain.


in general: audio quality starts to suck when you cross the 0.5*nyquist border, over 11025 that is. anything you do over that border is suspicious…

This doesn’t seem to be the problem, even when I filter at 10khz and then pitch down the lower harmonics of the ringing artifact are still there for some reason… Maybe it’s the audio file reader that introduced distortion? I think we’re missing something here. It’s also not noise but harmonics on top of each other the lower I pitch the more there are.

have you checked higher frequencies in a waveform viewer? it kind of sounds like you have buffer rate interference. If the sound changes when you switch the buffersize in the host, then you know immediatletly that it is buffer rate interference.