Skip to main content

Topic: Resampler plugin (Read 303974 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • kumbbl
  • [*][*]
Resampler plugin
Reply #225
An example of 96 -> 44 resampling (from http://src.infinitewave.ca/ )

Without aliasing:


what are these very dark blue curves in the first picture?

  • xnor
  • [*][*][*][*][*]
  • Developer
Resampler plugin
Reply #226
what are these very dark blue curves in the first picture?


Arguably this is also aliasing but about -150 dB down in level (= stopband attenuation of the low pass filter) so it doesn't really matter.

Without aliasing the stopband of the low pass filter starts at or before half the sampling rate. With aliasing the stopband starts above half the sampling rate causing (wanted) aliasing at much higher levels. For example if the stopband starts at 24 kHz and Fs=44.1 kHz then content from 22.05 to 24 kHz will "mirror back" into the range 22.05 to 20.1 kHz.

edit: video to demonstrate the difference without vs. with aliasing
  • Last Edit: 07 February, 2012, 11:21:41 AM by xnor
"I hear it when I see it."

  • lvqcl
  • [*][*][*][*][*]
  • Developer
Resampler plugin
Reply #227
In short: resampling artifacts. And they are much quieter than soundcard noise floor.

(Also please remember that these graphs are just examples -- they weren't made with SoX actually)

  • SoNic67
  • [*][*][*]
Resampler plugin
Reply #228
Is this the latest version?

  • Alex90
  • [*]
Resampler plugin
Reply #229
Thanks for this great plugin, I really liked it.

I do resampling almost everything to 192kHz, my sound card which is not very high-end but mid-range one supports up to 192kHz,

1. What does the "Best" quality setting in your plugin mean? Is it the same as "Very High Quality" of the SoX?
2. Should I allow the aliasing or not?
3. Is it better to resample 44.1 (and 88.2, ...) to 176.4 & and resample 48 (and 96, ...) to 192? or it is very ok to do resampling everything to 192kHz?

Thank you so much,
  • Last Edit: 04 April, 2012, 04:31:12 AM by Alex90

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
Resampler plugin
Reply #230
You should never upsample anything unless your hardware absolutely requires it. Do you think it increases quality? It doesn’t.

  • Alex90
  • [*]
Resampler plugin
Reply #231
You should never upsample anything unless your hardware absolutely requires it. Do you think it increases quality? It doesn’t.


If I do not upsample on my own, the sound card will do it and I'm very sure it will be much more better to do this with computer and programs rather than the sound card itself, it's the very routine, almost all the sound cards, DACs, even the external ones, do this.

  • xnor
  • [*][*][*][*][*]
  • Developer
Resampler plugin
Reply #232
almost all the sound cards, DACs, even the external ones, do this.


I beg to differ.
"I hear it when I see it."

  • Alex90
  • [*]
Resampler plugin
Reply #233
So you mean there is no need to have any Resampler plugin active DSP in foobar? and let the sound card do the resampling?
So what is the usage of it?

  • xnor
  • [*][*][*][*][*]
  • Developer
Resampler plugin
Reply #234
It depends. If you use WASAPI exclusive or ASIO then no resampling is going on, but playback might fail if your sound card / audio interface doesn't support the sample rates of your tracks. If you use DirectSound or WASAPI shared then the audio engine will resample if the sample rates of the tracks don't match the configured format (fixed at 48 kHz in Win XP afaik). In this case you can use the resampler DSP plugin to do high quality resampling in the player instead of the audio engine. And then there's hardware that forces resampling e.g. to 48 kHz, in which case you can also use this plugin.
  • Last Edit: 04 April, 2012, 07:00:25 AM by xnor
"I hear it when I see it."

  • greynol
  • [*][*][*][*][*]
  • Global Moderator
Resampler plugin
Reply #235
If you use DirectSound or WASAPI shared then the audio engine will resample if the sample rates of the tracks don't match the configured format (fixed at 48 kHz in Win XP afaik).

I thought resampling in XP was only done when two sounds of different rates occur at the same time. I'm pretty sure what you've said about any single sound deviating from some fixed rate is incorrect.

EDIT: Italicized words added.
  • Last Edit: 04 April, 2012, 01:49:10 PM by greynol
13 February 2016: The world was blessed with the passing of a truly vile and wretched person.

Your eyes cannot hear.

  • xnor
  • [*][*][*][*][*]
  • Developer
Resampler plugin
Reply #236
I thought resampling was done when two sounds of different rates occur at the same time. I'm pretty sure what you've said about any single sound deviating from fixed rate is incorrect.

I'm pretty sure what I said is correct. A simple test: play a 44.1 kHz file with not other application playing sound and monitor cpu usage switching the configured format from 44.1 kHz to 192 kHz.
  • Last Edit: 04 April, 2012, 12:07:54 PM by xnor
"I hear it when I see it."

  • lvqcl
  • [*][*][*][*][*]
  • Developer
Resampler plugin
Reply #237
Are we talking about Windows XP kernel mixer or Vista/Win7 audio stack?

  • xnor
  • [*][*][*][*][*]
  • Developer
Resampler plugin
Reply #238
Vista/Win7 except for the fixed 48 kHz part (= Win XP).
"I hear it when I see it."

  • greynol
  • [*][*][*][*][*]
  • Global Moderator
Resampler plugin
Reply #239
I am specifically talking about XP and edited my post to reflect this.

xnor was not specific about the operating system except to imply that XP behaves the same way except with a fixed rate which isn't correct. If XP hadn't been mentioned I wouldn't have commented, though the operating system should still have been stated since XP's kmixer behaves differently.  That said, clearly I am just as culpable.
  • Last Edit: 04 April, 2012, 01:22:12 PM by greynol
13 February 2016: The world was blessed with the passing of a truly vile and wretched person.

Your eyes cannot hear.

  • lvqcl
  • [*][*][*][*][*]
  • Developer
Resampler plugin
Reply #240
Policy for Mixing Audio Streams and Setting the Output Sample Rate
Quote
When a client requests connection of an audio stream to a device, KMixer queries the device to determine whether it supports the incoming rate. If the device supports the incoming rate, KMixer passes the incoming stream to the device without SRC.

  • xnor
  • [*][*][*][*][*]
  • Developer
Resampler plugin
Reply #241
I am specifically talking about XP and edited my post to reflect this.

Oh.. sorry, ok.
"I hear it when I see it."

  • lvqcl
  • [*][*][*][*][*]
  • Developer
Resampler plugin
Reply #242
0.7.8 version.
Based on post-14.4.0 SoX code; updated algorithms => even faster performance.

  • SoNic67
  • [*][*][*]
Resampler plugin
Reply #243
Thanks man!
I am using an E-MU 1820 with ASIO and it requires to "load" a profile for every samplerate. Practically, it changes the internal quartz frequency. Which may be great for sound quality, but annoying nonetheless.
In foobar I am using your resampler to convert everything to 96kHz (except the 96K files) and I cannot hear a difference to the "native" 44.1kHz files. In this way I don't have to "load" any profiles to mathch the samplerate.
Why not 192kHz? Because any modern DAC will be slightly less performat (distortions, real resolution) at that sample rate than at 88.2/96kHz.

  • kumbbl
  • [*][*]
Resampler plugin
Reply #244
just to verify i understand the logic in the right way:

with normal (ie. not mod version): if i add a sox-resampler to the chain with setting target 44.1 then there will be always a resampling even if source has already 44.1 - right?

with mod version: if i add a mod-sox-resampler to the chain with setting target 44.1 and list ="44100" then all input files will be downsampled to 44100 if and only if they have a sample-rate > 44100

(basic assumption: i have only files with samplerates >= 44100)

Is this right or have i misunderstood something (why not passing through files unmodified also with the normal plugin-version when target sr == source sr??)?

Thanks for your help!
  • Last Edit: 07 April, 2012, 03:06:35 AM by kumbbl

  • lvqcl
  • [*][*][*][*][*]
  • Developer
Resampler plugin
Reply #245
No, these plugins won't do anything if output samplerate is equal to the target samplerate. Built-in PPHS works in the same way.

  • kumbbl
  • [*][*]
Resampler plugin
Reply #246
thanks for this clarification

  • Dario
  • [*][*][*]
Resampler plugin
Reply #247
lvqcl,

does the plug-in's "best" quality correspond to the –v switch of SoX?

And thank you for your magnificent work.

  • lvqcl
  • [*][*][*][*][*]
  • Developer
Resampler plugin
Reply #248
Yes, that's correct.

  • Sanc
  • [*]
Resampler plugin
Reply #249
Hey all. SoX looks like an awesome plugin. Already has helped me quite a bit as well as the words of wisdom here.

My sound card does not support 88.2khz and 176.4khz. I am currently using SoX to resample them to 96khz and 192khz respectively. I read here that dithering adds noise to the space in between the original frequencies and the upsampled to make it a more accurate upsampling.

Would you recommend that I turn dithering on for this or perhaps Anti Aliasing? If I was to use dithering, is there a way to only apply the effect to the frequencies that must be upsampled?

Thanks in advance.