• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

PaperBoat

Active Member
Joined
Jun 19, 2022
Messages
219
Likes
36
I asked ChatGPT the following question:
Upsample before or after DSP to remove aliasing in audio?

ChatGPT
answered: To remove aliasing in audio, it is generally recommended to perform upsampling before digital signal processing (DSP).

Aliasing is a phenomenon that occurs when signals are sampled at a rate that is lower than the Nyquist rate, which is the minimum rate required to accurately represent the signal. When signals are undersampled, high-frequency components in the signal can fold back into the lower frequency range, resulting in aliasing distortion.

To remove aliasing in audio, it is necessary to apply a low-pass filter to the signal to remove the high-frequency components that cause aliasing. However, if the signal is undersampled, the high-frequency components may already be folded back into the lower frequency range, making it difficult to remove them with a low-pass filter.

By upsampling the signal before applying a low-pass filter, the high-frequency components can be moved further away from the Nyquist frequency, making it easier to remove them with a low-pass filter. This can help to reduce the amount of aliasing distortion in the signal and improve the overall quality of the audio.

Therefore, it is generally recommended to upsample the audio signal before applying DSP to remove aliasing distortion. However, it is important to use an appropriate upsampling rate and filter design to ensure that the high-frequency components are moved away from the Nyquist frequency and can be effectively removed with a low-pass filter.



Is ChatGPT right?
 
I asked ChatGPT the following question:
Upsample before or after DSP to remove aliasing in audio?
Very unclear description. DSP can be anything.
As long as it's all linear processing (EQ etc), no new frequencies are generated that could alias, so it doesn't matter where you upsample.
Nonlinear stuff like distortion/limiting creates new frequencies that might alias, so the general concept is to properly filter and upsample the signal before processing.
 
Is ChatGPT right?
Yes. There is no way to remove aliasing. After it happens there's no way to know if something is an alias or if it's part of the original signal.

Aliasing happens when the signal is more than half the sample rate (AKA the Nyquist limit). It can happen during analog-to-digital conversion or during down-sampling.

But... Every audio ADC has an anti-aliasing filter and every DSP programmer knows to low-pass before down-sampling so you "never" get (audible) audible aliasing. Sometimes it's measurable but the filtering knocks it WAY down in level.
 
Nonlinear stuff like distortion/limiting creates new frequencies that might alias, so the general concept is to properly filter and upsample the signal before processing.
I'm upsampling my audio signal in JRiver to 384kHz before applying some minimum phase DSP (Linear Fabfilter Pro Q3, Dynamic/Minimum phase Fabfilter Pro MB and no oversampling Fabfilter Pro L2) and sending the signal to my IFI Zen V2 (7.4C GTO filter firmware) to avoid dithering noise generation in the DAC. The DAC is connected with a pair of JBL 305p MKii monitor. I know the phase is getting altered but my goal is to achieve pre-ringing and distortion free sound. Is it a right approach?
 
Aliasing happens when the signal is more than half the sample rate (AKA the Nyquist limit). It can happen during analog-to-digital conversion or during down-sampling.
JBL 305p MKii has ADC built-in.
 
I found that confusing and technically lacking, flat-out wrong in a couple of places.
 
I'm upsampling my audio signal
Why? It's destroying the bit-perfect recording that you probably started with. Run your DAC in exclusive, bit-perfect mode instead.

dithering noise generation in the DAC
This is usually part of a recording, not a DAC. You're probably thinking of the reconstruction or anti-aliasing filter. The filter is just a simple low pass near nyquist, and it varies by the DAC designer's implementation. It's up to the music producer to add dither, and it usually isn't used by most professionals. It's literally just a very quiet audio track mixed in with the rest of the audio, though most software allows rendering/exporting with a dither of their choice or none at all. As long as it's not 100% synthesized, dither is not required. This is mostly due to how most analog recordings have a substantial noise floor compared to a -100 to 120dB dither. Noise and dither are essentially identical.

my goal is to achieve pre-ringing and distortion free sound
There really is no benefit to up sampling your bandlimited source audio. The transient's slope will be a maximum of 22.5KHz. EDIT: So, nothing above 22.5KHz will exist, even after resampling. Faster transients without "pre-ringing" are usually impossible for a transducer to produce without generating amplifier and driver distortion. Also, this means that you're trying to get a transient produced higher than 22.5KHz.

I get it. This is an audiophile "pro-tip" on many sites out there, so I understand the curiosity.

I hope this helps a bit. It's tough to wrap your mind around the nitty gritty of all of this without an engineering background.

1687793546505.png


Blue= source 16-bit - 44.1KHz upsampled by deltawave for comparison. Extremely slow oversampling method.
White=upsampled to 32bit - 384KHz - ez audio converter. Fast method similar to your software upscaling.
1687793615418.png


Some more info on the topic.
 
Last edited:
Why? It's destroying the bit-perfect recording that you probably started with. Run your DAC in exclusive, bit-perfect mode instead.


This is usually part of a recording, not a DAC. You're probably thinking of the reconstruction or anti-aliasing filter.

anti-imaging filter, I think you mean
 
I apologise for my weak understanding in this regard... But I can't resist myself to get a little bit more air (using Fabfilter Pro Q3)... tight bass (using Fabfilter Pro MB) and clip protection without loosing openness (using Fabfilter Pro L2) in my musics. That's all I want without introduce pre-ringing and distortion.
 
Last edited:
anti-imaging filter, I think you mean
No. I'm talking about anti-Aliasing in regards to the shannon-nyquist theorem.
Without a LPF at nyquist, you'd get notable harmonic distortion. This is what happens when some DAC designers (usually R2R) try to upsample with a NOS filter.
EDIT: Even better example of NOS filter on an R2R measuring terribly.

Is there anything else that ADCs are usually used for in speakers?
Integrated streaming with analog inputs. It's like an AVR with analog inputs, but only inside a speaker. I think most active designs do this, but I could be wrong. There are many ways to tackle an analog signal path to an integrated amp.
 
Last edited:
I apologise for my weak understanding in this regard... But I can't resist myself to get a little bit more air (using Fabfilter Pro Q3)... tight bass (using Fabfilter Pro MB) and clip protection without loosing openness (using Fabfilter Pro L2) in my musics. That's all I want without introduce pre-ringing and distortion.
Not a big deal. Do what makes you happy. I love to add a bit of EQ on some tracks. Lately I've been using the Stereo Tool VST to fix clipped audio though foobar2000. I don't hear much difference, but it makes me feel like something good is going on.
 
I'm upsampling my audio signal in JRiver to 384kHz before applying some minimum phase DSP (Linear Fabfilter Pro Q3, Dynamic/Minimum phase Fabfilter Pro MB and no oversampling Fabfilter Pro L2) and sending the signal to my IFI Zen V2 (7.4C GTO filter firmware) to avoid dithering noise generation in the DAC. The DAC is connected with a pair of JBL 305p MKii monitor. I know the phase is getting altered but my goal is to achieve pre-ringing and distortion free sound. Is it a right approach?
The upsampler then must be minimum-phase as well, keep that in mind. Some upsamplers can do minimum-phase filtering, some can't.
 
The upsampler then must be minimum-phase as well, keep that in mind. Some upsamplers can do minimum-phase filtering, some can't.
JRiver SOX resampler is linear and It's deal breaker for me.
 
No. I'm talking about anti-Aliasing in regards to the shannon-nyquist theorem.
Without a LPF at nyquist, you'd get notable harmonic distortion. This is what happens when some DAC designers (usually R2R) try to upsample with a NOS filter.
EDIT: Even better example of NOS filter on an R2R measuring terribly.


Integrated streaming with analog inputs. It's like an AVR with analog inputs, but only inside a speaker. I think most active designs do this, but I could be wrong. There are many ways to tackle an analog signal path to an integrated amp.
I think the confusion is "reconstruction or anti-aliasing filter." A reconstruction filter is an anti-imaging filter while anti-aliasing fits on the ADC end. Perhaps you meant both, but the way it read you appeared to be using two names for the same filter at the output of a DAC.
 
I have not used Fabfilter enough to know all the nitty gritty details of its use. I would think it will decide correctly when it needs to upsample a signal and then downsample it back to the original rate to do its processing. Unless the manuals or tutorials for it suggest you do upsampling, you probably are less likely to do audible harm by using its DSP for whatever EQ effects you wish while letting it decide how to get that DSP done. Pre-empively upsampling everything was once a needed thing for some processing, but that day has long passed for a good product like Fabfilter. As I recall you do get to choose linear or minimum phase in Fabfilter and which you choose will depend upon what you are doing. Just dump the upsampling on your part and life is simpler(and no less good).

It is my opinion that these super high sample rate DACs just encourage people to worry with something they shouldn't. If you are starting with 44.1 khz or 48 khz, you cannot put back what isn't there. If you are starting with 88.2 or 96 khz rates, there is not anything to worry about at all.
 
Back
Top Bottom