Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Downsampling to 44.1 - integer vs non-integer ratio (Read 4174 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Downsampling to 44.1 - integer vs non-integer ratio

Hello.

I am looking for some tips about downsampling material recorded in 48 or 96hz sample rate to target CD 44.1hz. My interface does not work with 88.2hz sampling rate (has only fixed 44.1, 48, 96 and 192). I read some mixed information about integer vs non integer ratio with downsampling. As I do not have a possibility to record in 88.2 integer downsampling to 44.1 is not possible. However I also read that modern downsampling use complex algoritms so the integer vs non-integer thing is no longer relevant
 - one quote I found :

Quote
 
Sampling rate is not simply dropping every other sample, etc. It's actuality done by taking the master clock rate (sampling rate like 88.2kS/s) and upsampling the data to over 30 MEGA samples per second. Once it is has been upsampled to that super high sampling rate, then it's downsampled to the appropriate sampling rate.


So - can we generally say that in modern DAWs (I am using Cakewalk by Bandlab)  it is safe to downsample from 48 or 96 to 44.1 and we should not have any problems/distortion etc. due to ratio of two sampling rates being non-integer?

Re: Downsampling to 44.1 - integer vs non-integer ratio

Reply #1
I don't know Cakewalk at all, but recall that back in the day, the "professional" digital audio format was 48 kHz (or later 96 kHz) and had to be downsampled to 44.1 for CD. Not an integer ratio.

If all you want is to be able to play it, you can use a player like foobar2000 which can do the resampling on-the-fly. It isn't that computationally intensive, and you can keep your 88.2 files without having to manage different files.
fb2k will let you set "quality" too, at the cost of CPU usage.

Re: Downsampling to 44.1 - integer vs non-integer ratio

Reply #2
If all you want is to be able to play it, you can use a player like foobar2000 which can do the resampling on-the-fly. It isn't that computationally intensive, and you can keep your 88.2 files without having to manage different files.
fb2k will let you set "quality" too, at the cost of CPU usage.

My concern was rather recording music on higher ratio and then downsampling after mixing or mastering to 44.1

Re: Downsampling to 44.1 - integer vs non-integer ratio

Reply #3
Unless your daw software is exceptionally bad it will make no difference.

Re: Downsampling to 44.1 - integer vs non-integer ratio

Reply #4
But - if that is the question as well - recording & ADC-ing at 48 vs 192 could make a difference, as to how aggressive an analogue anti-aliasing filter would have to be? 

Re: Downsampling to 44.1 - integer vs non-integer ratio

Reply #5
Unless your daw software is exceptionally bad it will make no difference.
I agree.  I've never heard any difference when re-sampling as long as it's "CD quality" or better.   And I sometimes use GoldWave which used to "measure bad" for resampling, but it never sounded bad to me (and it's been improved).

You should dither when you reduce the bit depth, but at 16-bits or better you can't hear dither (or the effects of dither) under normal listening conditions so it's not that critical.   (Also, that means the dither method isn't critical.)

Quote
as to how aggressive an analogue anti-aliasing filter would have to be?
I would just trust the programmer who wrote the re-sampling algorithm.    Unless he's incompetent it will be audibly fine.    If you start doing measurements, there will be trade-offs but as a software-user I just wouldn't worry about it.

Quote
As I do not have a possibility to record in 88.2 integer downsampling to 44.1 is not possible.
That's not important...
You can't just throw-away half the samples.   An anti-aliasing filter is ALWASY used when downsampling, and that's going to slightly-change EVERY sample, including the "remaining" samples.    And the exact-same algorithm will be used no matter the resampling ratio.

The "pro studio standard" is 24/96 so almost every digitally-recorded CD has been downsamled with a non-integer ratio.     And I wouldn't be surprised if older analog recordings are digitized at 24/96 before downsampling for CD and MP3.

P.S.
Digital audio processing isn't always mathematically perfect, or perfectly mathematically-reversable, but it's way-way-way better than human hearing (as long as the resolution is high-enough) so it's usually audibly-perfect, unless you are intentionally changing the sound with an effect.


Re: Downsampling to 44.1 - integer vs non-integer ratio

Reply #6
Quote
as to how aggressive an analogue anti-aliasing filter would have to be?
I would just trust the programmer who wrote the re-sampling algorithm.
"recording & ADC-ing" refers to the original sampling rate (thus applying an analog-domain anti-aliasing filter prior to sampling), not to subsequent resampling.
If the device records at 192, then it does not have to apply the same anti-aliasing filter.
Same goes if its "48 kHz" mode actually records at 192 and resamples on-the-fly.

Re: Downsampling to 44.1 - integer vs non-integer ratio

Reply #7
  If you start doing measurements, there will be trade-offs but as a software-user I just wouldn't worry about it.


Speaking of trade offs - I wonder if it is generally considered safer (in terms of minimizing potential aliasing and quantization noise) to record in higher sampling rates and downsample then record in 44.1 and take a risk of "steepnes" of the anti-aliasing filter? And there is also risk of intermodulation noise with sample rate higher than 44.1 and this noise, if i understand correctly, will remain after downsampling. So it looks like both ways have their dangers...

Re: Downsampling to 44.1 - integer vs non-integer ratio

Reply #8
You worry too much... ;)
"All" devices today have mixer configured for 48 kHz.
No matter what sampling rate you are using, it will always be resampled to 48 kHz.
Just make sure to leave at least 1 dB of headroom to prevent clipping and you are good to go. :)
gold plated toslink fan

Re: Downsampling to 44.1 - integer vs non-integer ratio

Reply #9
"All" consumer devices, that is. And some of them will have their mixer configured for 44.1 kHz, depending on what settings the user is running.

I don't think "All" professional devices will be lying about the sample rates they support, or that "all" music producers will be using consumer sludge for their work.

macOS on Apple Silicon will default to 44.1, and many Bluetooth headphones and earbuds will be fixed at 44.1 as well, depending on the device.

My HDR-180 set will do 44100 over analog, but the headphone jack they're plugged into can do up to 96 kHz / 24. I have not measured the output's noise level, as I have no trustworthy ADC to record it with. The only actual ADC I have on hand is my Ryzen desktop PC's integrated sound hardware, and then I'd be limited to the line input quality of the motherboard as a baseline.

My WH-1000XM4 headset is limited to 44.1 kHz, and only AAC from the Mac at its hard coded setting of 192 kbps VBR, min. 32, max. 256. Some stupid games will try to force the sound device into 48 kHz mode, which the OS somehow allows, but the sound device continues to play the stream at 44.1 kHz, so slowed down. The only way to recover from this misconfiguration is to disconnect and reconnect the headphones.

My AirPods Pro are hard configured to 48 kHz AAC, same bitrates as above from the OS. I have yet to experience any applications forcibly configuring them for 44.1 kHz, sped up audio.

My macOS audio player picks the current device default rate, rather than forcing a sample rate. It also resamples every file or range of file that has a unique sample rate to the target sample rate, transparently. It also uses extrapolation to try to line up the edges of every resampled range of audio, so it sounds mostly gapless. The only gaps it still has is periodic processing bugs that cause file transition glitches due to the incredible low latency of the sound output method versus my app's own buffering of decoded sample data. I really don't know how to improve this, short of just ripping out my own player and letting Apple handle all playback for me, and lose support for dozens of formats.

Re: Downsampling to 44.1 - integer vs non-integer ratio

Reply #10
Unless your daw software is exceptionally bad it will make no difference.
I agree if you insert "audible" before the last word.  I strongly suspect if you bit-compare the results of the resampler used by different DAW software packages you probably would find that it wasn't bit-identical but if you did a blind test you'd probably also find it wasn't audible.

Re: Downsampling to 44.1 - integer vs non-integer ratio

Reply #11
Integer ratio conversions can look better in some graphs or THD numbers... but with any decent converter the differences between integer and non-integer are very small, at very low, inaudible levels.

So, as long as you're using a decent converter, I wouldn't worry about it affecting the sound quality at all. But I would still check that the resampling is good. I wouldn't necessarily trust everything you can find in a DAW. At least some DAWs, not long ago, had sub-par performance.
Luckily, there are high quality resamplers available for free (SoX, R8brain, ...).

Oh and integer resampling is faster (uses less CPU). But this probably doesn't matter for what you're doing.

Re: Downsampling to 44.1 - integer vs non-integer ratio

Reply #12
Unless your daw software is exceptionally bad it will make no difference.
I agree if you insert "audible" before the last word.  I strongly suspect if you bit-compare the results of the resampler used by different DAW software packages you probably would find that it wasn't bit-identical but if you did a blind test you'd probably also find it wasn't audible.

None of them will be identical since these calculations are done on floating point values and there are many, many algorithms that can be used.  But yes, basically all of them should be good enough that the difference is some ultrasound well below the noise floor unless the software is just poorly made, especially for a DAW. 

Integer ratio conversions can look better in some graphs or THD numbers... but with any decent converter the differences between integer and non-integer are very small, at very low, inaudible levels.

...

Oh and integer resampling is faster (uses less CPU). But this probably doesn't matter for what you're doing.

FWIW, there are algorithms where this is true and there are ones where it is not.  Not a safe assumption in general.

Re: Downsampling to 44.1 - integer vs non-integer ratio

Reply #13
It's also possible that if you take the same code and compile it with different compiler optimizations or a different compiler version you'd end up with slight differences but probably not audible ones (this has happened with lossy codecs, for example)

 

Re: Downsampling to 44.1 - integer vs non-integer ratio

Reply #14
The same doesn't usually happen to lossy codecs if the implementation is purely integer, unless you change some stage of the processing to have different precision behavior, which can possibly happen, for example, with libMAD depending on which 64 bit multiply you configure it to use.

Re: Downsampling to 44.1 - integer vs non-integer ratio

Reply #15
I meant on the encoding side.  But I wasn't clear on that.

Re: Downsampling to 44.1 - integer vs non-integer ratio

Reply #16
That also depends on the codec. For instance, libFDKAAC, which is entirely integer math based.

Re: Downsampling to 44.1 - integer vs non-integer ratio

Reply #17
It's also likely if there's a different encode due to rounding differences in the encode, the decoded version would be non-identical in a likely inaudible way.

But at the same time, don't different decoders tend to create similarly different decoded files anyway?

Re: Downsampling to 44.1 - integer vs non-integer ratio

Reply #18
What I meant was that the encoder is likely to produce the same output given the same input, regardless of the compiler used. Most integer operations are guaranteed a given precision.

No guarantees that a lossy encode will produce anything even close to the original, and any decoder you use could produce different output depending on the compilers.

I was referring to a fixed precision encoder producing fairly consistent results (compressed file) from the same input, regardless of the machine architecture used to compile or run the encoder. A fixed precision decoder should also produce consistent PCM output from the same lossy input data, regardless of the machine running it. No guarantees about round trip accuracy, though.

Re: Downsampling to 44.1 - integer vs non-integer ratio

Reply #19
Cakewalk by Bandlab is basically a rebranded Cakewalk Sonar, a DAW developed by Twelve Tone Systems and subsequently owned by Roland, Gibson and Bandlab. SRC quality, if remains unchanged, is pretty good. Distortion level is below all known analog equipment.

Good resamplers can convert to and from prime number sample rates without any issue, not to mention 44.1k and 48k based rates.

X

Re: Downsampling to 44.1 - integer vs non-integer ratio

Reply #20
But - if that is the question as well - recording & ADC-ing at 48 vs 192 could make a difference, as to how aggressive an analogue anti-aliasing filter would have to be? 
Like DAC chips, most ADC chips are based on delta-sigma, which means the modulator sample rate is often in MHz range and in low bit-depth, like 5 bits or below. Analog filter is often not all that strong and does not change with different PCM sample rates. These ADCs heavily rely on digital filters, even when recording at the highest supported PCM rate (e.g. 192 to 768kHz), the digital filter is still not bypassed. With lower sample rates, more digital filter stages are being applied in a cascaded manner: 2x, 4x, 8x decimation.

The digital filters in higher sample rates are often not very accurate and could induce fair amount of aliasing when feeding the input using synthetic signal with a lot of high frequency content, but with things like microphone input high frequencies often fade into the modulator noise floor after dozens of kHz, as shown on many Hi-res recordings. Beyond 50 to 60kHz or so, modulator noise often dominates the spectrum, aliasing can no longer be identified.

Some examples of ADC digital filters:
https://www.audiosciencereview.com/forum/index.php?threads/motu-m4-audio-interface-review.15757/page-3#post-503953
https://www.audiosciencereview.com/forum/index.php?threads/topping-d30pro-review-balanced-dac.20259/post-668404