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: Resampler plugin (Read 526657 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

Re: Resampler plugin

Reply #50
so...let me ask you this... in order to get the best "on paper" performance.. should we "allow aliasing" or no??

I am resampling everyhting to 192kHz.


Re: Resampler plugin

Reply #52
I made it myself with Adobe Audition: Generate -> Tones.

Base frequency: 11025 Hz;
Modulate by: 10900 Hz;
Modulation freq: 0.5 Hz
...
Flavor: Sine.

Re: Resampler plugin

Reply #53
Thank you very much!
🇺🇦 Glory to Ukraine!

Re: Resampler plugin

Reply #54
so...let me ask you this... in order to get the best "on paper" performance.. should we "allow aliasing" or no??

Sorry, I have no idea.

=====================================

As I mentioned before, f -> 2f -> 4f upsampling is much faster than direct f -> 4f. So I added fast 4x upsampling in the new (0.5.4.1) version.
(i.e. if you want to upsample from 44.1 to 176.4 kHz, the plugin first resamples to intermediate 88.2 kHz, and then from 88.2 to final 176.4)

Re: Resampler plugin

Reply #55
Hello lvqcl,

First of all thanks a lot for your component, it is one of the reasons I keep using foobar as it lets me do upsampling without sound degradation.

I used to always resample to 48k, as this is the maximum rate supported by my DAC.

But lately I realized that staying at 44.1k lets me hear very fine nuances more accurately. By comparison, upsampling from 44.1k to 48k smoothes sounds out (music 'flows' better, or is more 'liquid'). I understand some may prefer this -- at least I used to anyway.

So for now I would like to keep 44.1k or 48k untouched, but downsample higher rates to something supported by the DAC. Ideally, I would like to downsample 88.2 and 176.4 to 44.1 (downsample x2 or x4), and 96 and 192 to 48.

Do you think it would be possible to have a 'adaptive downsample' kind of mode, where you would specify a maximum target rate and the component would downsample x2/x4/x8... until the rate is below or equal to the target rate? In my case, I would use 48k as the target rate.

Cheers

Re: Resampler plugin

Reply #56
Yea thanks a lot lvqcl... Been doing a lot of reading and have found tons of good info but I do have a question that I cant seem to find the answer to...

To upsample by uneven ratios, say to go from 44.1 kHz to 96 kHz, what is the best way to go?  I read here somewhere that going from 44.1 to 48 causes artifacts around the 22kHz range, would this be minimized by going from 44.1 -> 88.2 -> 96 kHz?  I am experimenting right now with upsampling 44.1 -> 176400 Hz (using the new Up x4 option) -> 96 kHz and it seems to sound better than anything else I've tried...

Thanks for any help

Re: Resampler plugin

Reply #57
Do you think it would be possible to have a 'adaptive downsample' kind of mode, where you would specify a maximum target rate and the component would downsample x2/x4/x8... until the rate is below or equal to the target rate? In my case, I would use 48k as the target rate.

Maybe I'll make something similar, but now I don't have much free time.


I read here somewhere that going from 44.1 to 48 causes artifacts around the 22kHz range, would this be minimized by going from 44.1 -> 88.2 -> 96 kHz?

I doubt it.

Re: Resampler plugin

Reply #58
Modified version available now here: http://www.hydrogenaudio.org/forums/index....st&p=668463
Now it is possible to set a list of input frequencies that you don't want to resample.

Quick guide:

1. You set target samplerate to "48000" and typed "44100;88200;96000" in the list of frequencies.

Sound with sample rates 44100, 48000, 88200 and 96000 Hz will pass through the plugin, other will be resampled to 48000 Hz.

2. You set target samplerate to "[From the list]" and typed "44100;48000;96000" in the list of frequencies.

if samplerate = 44100, 48000 or 96000 Hz: pass through;
else if samplerate < 44100 Hz: resample to 44100;
else if samplerate < 48000 Hz: resample to 48000;
else: resample to 96000.

Note: you can add several instances of the resampler (with different settings) to the DSP chain and make more complex logic.
If you want to be sure that it works as expected, look at the console and you'll see the following message:
"SoX Resampler: Input rate = xxxxx, Output rate = yyyyy"

Re: Resampler plugin

Reply #59
Modified version allows you to set a list of input frequencies that will pass through the plugin, unmodified. Or it can choose proper output frequency from the list.

Great work lvqcl, this is really what I was interested in 

I am using the option to select 'from the list', and I have entered the frequencies supported by my DAC: 32000, 44100, 48000.

Now when I play a 44.1k track, plugin outputs at 44.1k (unchanged).
When I play a 48k track, plugin outputs at 48k (unchanged).
When I play a 88.2k (or 176.4 I guess) track, plugin outputs at 48k.
When I play a 96k or 192k track, plugin outputs at 48k (downsample x2/x4 I had hoped, but doesn't seem to be the case in the code).

I must make tests, but I guess I would prefer the plugin to downsample x2/x4 for 88.2/176.4, instead of using the maximum available, which is not always the better option sound-wise. Plus it would be more CPU efficient to resample by a power of two, as you said in an earlier post.

I will try to post results ASAP.

Anyway awesome job!

Re: Resampler plugin

Reply #60
Add 2 resamplers in your DSP chain

1st: target = 48k, list = "32000;44100;88200;176000".
2nd: target = 44.1k, list = "32000".

Re: Resampler plugin

Reply #61
Add 2 resamplers in your DSP chain

1st: target = 48k, list = "32000;44100;88200;176000".
2nd: target = 44.1k, list = "32000".

I assume you meant:

1st: target = 48k, list = "32000;44100;88200;176400".
2nd: target = 44.1k, list = "32000;48000".


Re: Resampler plugin

Reply #63
lvqcl,

first I would like to say thank you for the SoX Resampler.

One question: removing a plugin from the components folder foobar2000 usually asks whether its settings are to be kept or deleted, but not so for the SoX Resampler (both normal and modified version). Does my foobar behave normally?

Robertina.
This is HA. Not the Jerry Springer Show.

Re: Resampler plugin

Reply #64
One question: removing a plugin from the components folder foobar2000 usually asks whether its settings are to be kept or deleted, but not so for the SoX Resampler (both normal and modified version). Does my foobar behave normally?

That question only applies for components which store settings using configuration variables. This, like all properly coded DSP components, uses DSP presets to store settings for each DSP chain it's added to.

Re: Resampler plugin

Reply #65
Question answered, thank you, kode54.
This is HA. Not the Jerry Springer Show.

Re: Resampler plugin

Reply #66
...And you will see [DSP not found] line in the DSP settings. (or <ERROR> in fb2k 1.0 beta).

Re: Resampler plugin

Reply #67
Thank you, lvqcl.

And I love you new modified version, it is great.

Robertina.
This is HA. Not the Jerry Springer Show.


Re: Resampler plugin

Reply #69
I assume you meant:

1st: target = 48k, list = "32000;44100;88200;176400".
2nd: target = 44.1k, list = "32000;48000".


Of course. 



Wouldn't it be better just to include x2 downsampler and list = 44100;48000? This is what I included in my foobar - this way I can play 88.2kHz SACD at 44.1 and DVD-A/Vinyl 96kHz at 48. Thanks for this mod, this is just what I was looking for!

Re: Resampler plugin

Reply #70
Wouldn't it be better just to include x2 downsampler and list = 44100;48000?

This does not handle 176.4 and 192 kHz correctly, as they would be played at 88.2 and 96 kHz, respectively.

I think it would be more intuitive to apply the filter to selected frequencies, instead of excluding specific frequencies.

Re: Resampler plugin

Reply #71
Wouldn't it be better just to include x2 downsampler and list = 44100;48000?

This does not handle 176.4 and 192 kHz correctly, as they would be played at 88.2 and 96 kHz, respectively.

I think it would be more intuitive to apply the filter to selected frequencies, instead of excluding specific frequencies.


x2 and x4 downsampling is more efficient just look a few posts up. By excluding you can get away with this
Downsample x2 list = 44100, 48000, 176400, 192000
Downsample x4 list = 44100, 48000, 88200, 99600

But this is really splitting hairs! I have not seen a source with over 96kHz sampling rate and you can get away with only defining
Downsample x2 list = 44100, 48000 and get away with almost anything you throw at it.

This will only use optimized sampling and not a select frequency. Maybe the author of this plugin can comment more on x2/x4 vs specified sample rate? Of course I might be wrong and 96 downsampled x2 uses the same algorithm as specifying 48000.

Re: Resampler plugin

Reply #72
Of course I might be wrong and 96 downsampled x2 uses the same algorithm as specifying 48000.

Yes, that's true. IOW, if the input frequency is 96kHz, there's no difference between output freq. set to "48000" or "downsample x2".



Quote
I think it would be more intuitive to apply the filter to selected frequencies, instead of excluding specific frequencies.

Well, the idea was to exclude sample rates that soundcard support natively.

Re: Resampler plugin

Reply #73
Just a silly question for most of you in the development world...

I am using FLAC files. Will this resampler work with compressed files, or I can only do it in WAV?
If it has to be only WAV, is there any way I could use the resampler to convert the original file, first into 24bits/96khz and then compress it again and keep it that way, or it only resamples on the fly while playing it?

Thanks!

Re: Resampler plugin

Reply #74
I am using FLAC files. Will this resampler work with compressed files, or I can only do it in WAV?


This plugin (as almost any DSP plugin) works with any file that foobar2000 can read.