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 489115 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Re: Resampler plugin

Reply #425
-v: Quality = Best
-M: Phase response = 0% (minimum)
-a: Allow aliasing/imaging = on


what about the Passband setting to match/achieve the graph for -vMa ?

Re: Resampler plugin

Reply #426
default value (95%).

Re: Resampler plugin

Reply #427
With this UI, is it possible to achieve the following Sox setting:
-vMa



What does this picture show? Amplitudes?
Does this figure mean that the -vMa setting has no pre-ringing and the lowest post-ringing compared to the other settings in this figure?
If yes, I thought linear phase filter has the lowest pre- and post-ringing.

Re: Resampler plugin

Reply #428
What does this picture show? Amplitudes?
Does this figure mean that the -vMa setting has no pre-ringing and the lowest post-ringing compared to the other settings in this figure?
If yes, I thought linear phase filter has the lowest pre- and post-ringing.


To keep it simple, the picture shows resampling a 44.1 kHz signal to 96 kHz.

The length of the impulse response ("ringing") increases with the steepness of the filter. By allowing aliasing (-a) the filter is less steep reducing its length.
Minimum phase (-M) has no pre-ringing. It has a nonlinear phase shift, however. I wouldn't say it has the lowest post-ringing though. It decays quicker but also starts at a higher amplitude.

Linear phase is symmetrical. Look at -v. If you add -a it will be shorter.
"I hear it when I see it."

Re: Resampler plugin

Reply #429
I need to downsample some music files. The files I am downsampling are all 24-bit, with varying frequency rates of 192 khz to 88.2 khz. My target device is an iPod Classic which has a maximum file handling capability of 24-bit/48khz. I am using the Sox Resampler plugin v.0.8.3 and Foobar2000 v1.3.7.

I have read the SOX FAQ and various threads about SOX resampling. I need a confirmation that my settings are going to give me the best results. Here are my settings:

Target samplerate: 48000 hz
Quality: Best
Passband: 95%
Allow aliasing/imaging: NO (unchecked)
Phase response: 0%

Do these seem correct? My main concerns are the alaising/imaging and the phase response setttings. It is my understanding that both of these are best used in upsampling, but not for downsampling.

Also, is there any effective difference in downsampling all higher frequencies to 48 khz, or would it be better to have the target samplerate be evenly divisible -- 192/96 = 48 khz; 176.4/88.2 = 44.1 khz?


Re: Resampler plugin

Reply #430
Personally I can't hear any differences when downsampling to 48kHz with any combination of the settings. You may try to do some ABX tests with opposite settings which you desired first.

For the "divisible sample rate" myth, it is only true for resamplers using simple algorithms (such as linear interpolation) or when the resampler allows very low quality settings. For the foobar SoX plugin, even the lowest setting will outperform some very expensive standalone DACs, not to mention handheld consumer electronics. One exception is that your iPod may perform differently in 48khz and 44khz, but it's the problem of the playback device, not SoX.

The foobar SoX plugin even has an advantage over the standalone one that it won't clip float inputs over 0dBFS:
http://www.hydrogenaud.io/forums/index.php...amp;mode=linear

Of course, I am not using "very expensive standalone DACs", I only judge the quality from synthetic tests. But again, if in doubt, do some ABX tests with your ears.

PS: to those who want to abuse a resampler, resample to a prime number, and resample to a sample rate which is close to the original, like 48000>48313, for PPHS there will be a long delay before the conversion starts, for Adobe Audition 1.5 there will be visible aliasing when close to nyquist even when using high quality, but in SoX, I can't observe any abnormalities.

Re: Resampler plugin

Reply #431
Apologies and please feel free to move this question to a more appropriate forum (or tell me to) ...

Does the "Rough frequency" result from the SoX stat function help a resampler newbie with making decisions about parameters?

I donated and obtained a download of The Open Goldberg Project.  As a result I have a number of 24bit x 96K samples/sec FLAC files.  After the fact I realized that my Squeezebox Classic maxes out at 24 x 48K.  Rather than have LMS resample with SoX on-the-fly each time I play, it seems more efficient to do it once.  I also sync a copy of my music onto my laptop for use at work, buy my storage space on the (oldish) laptop is limited.  So I'm considering just having fb2k create a playing/travel copy at 16bit x 44100.

Based on reading this thread and the SoX documentation, I thought I'd be wanting options equivalent to: -v -I -a ... Very high quality (one-time and offline, why not), intermediate phase (small pre-ringing to reduce post-ringing somewhat), and aliasing above the pass-band allowed (for the reduction "by almost half" of ringing artifacts).

Then I ran a stat pass across the tracks and confused myself.  Rough frequency is reported ranging from 16.9KHz through 18.6KHz.  This strikes me as surprisingly high for piano, C8 is 4186 Hz or something close, so that would seem like energy in a high-order overtone; but there are all the hammer strike, inharmonicity, Railsback curve/temperament things that once knew more about (courtesy of an engineering elective on musical instrument materials and design) but haven't kept resident in the brain over the decades.  Or am I seeing some artifact of high sample-rate recording and mastering?

Anyhow, is this datum of any value in deciding on resampling parameters?  Does it tell me I should be using the steep/higher bandwidth filter setting and accepting more ringing to preserve the high-frequency content?  Or that I should not allow aliasing?

I haven't been able to find anything that explains how SoX is computing Rough frequency or how to make use of it; any advice appreciated!

Re: Resampler plugin

Reply #432
No, it doesn't.

Rough frequency is calculated like this:
RMS(diff(x)) / RMS(x) * sampling rate / (2*pi) where x is the input signal


It's just an average. With music it would give you a rough idea to what frequency the signal energy averages to.

Says nothing about audibility of resampler filters.
"I hear it when I see it."

Re: Resampler plugin

Reply #433
Hello, first of all thanks for the plugin.
I have done a search in the Thread and could not find this answer: what is the difference between the normal version and the src version (the one which in the download thread is on the right, with file name foo_dsp_resampler_0.8.3_src.rar)?

Thanks

Re: Resampler plugin

Reply #434
That would be the source code to the component, which isn't terribly useful unless you want to compile it yourself, or examine how it works.

Re: Resampler plugin

Reply #435
Thanks.
Btw, as you are admin, what about putting a "thanks" button to thank people without having to write a post for that? To keep threads shorter. Not necessarily a Reputation system like in Head-Fi. Just thanks.
Anyway. Thanks  :))

Re: Resampler plugin

Reply #436
Does anybody know if the sox foobar plugin in best quality setting is equivalent to mmpeg soxr in 28 precision setting , ie both using double precision accuracy , same bandpass , same phase response (default linear)?

Re: Resampler plugin

Reply #437
I've had this installed for a while but am just getting around to getting it set up properly.  Hopefully I'm where I want to be, if someone who is really familiar with this plug-in can confirm or tell me why I'm not I'd really appreciate it.  Ideally I want everything upsampled by an even number to the maximum rate my sound card will support.  I have two active Resampler SoX(mod) active DSPs.  The first has a target rate of 192000 and does not resample 192000;176400;88200;44100;22050;11025.  The second has a target rate of 176400 and does not resample 192000;176400;96000;48000;32000;24000;16000;8000.  Seems like this ought to do it, but I haven't figured out how to see the actual rate being sent via ASIO to the sound card.

I've looked through the thread and see where you can specify arguments for certain parameters, but I don't know where or how you would use them.  Help?

Thanks.

Re: Resampler plugin

Reply #438
I've been using this great plugin for a while and have a feature request or two:

  • Bypass mode - a toggle button that makes the DSP active or not, great for A/B comparison as well as removing it from the DSP chain without loosing settings
  • Presets - the ability to save the parameters for quick recall for both A/B comparison and for persistence if the DSP is removed from the active list and reinstated

Thanks for any consideration you may give these requests.

Re: Resampler plugin

Reply #439
2. foobar2000 allows to save and restore presets of a whole DSP chain, and it should be enough. No need for per-plugin save/restore.

1. I don't plan to add UI to this plugin. But you can create your own buttons that activate your own DSP presets.

Re: Resampler plugin

Reply #440
Thanks for the quick reply.  I'll look into saving DSP chains, I haven't used DSPs before now.

I was figuring the UI used to configure the DSP would be the location for the bypass button. 

I'd be starting from zero to figure out how to create a button to activate a preset in a DSP.  Or a button to do anything else for that matter. 

Re: Resampler plugin

Reply #441
Hi,

Very nice plugin but when I use it I experience digital clipping (both audible and on level meters of my soundcard) when FB2K is set at 0dB (but @ -1dB it's ok).

Is there any option to avoid this ?

My settings : best quality, 91% bandpass, 25% phase. Plugin is used for 2x upsampling from 44.1k or 48k content.
I use ASIO output (ASIO2 plugin). ResamplerSox plugin is the only one DSP.

Regards,
AF.

Re: Resampler plugin

Reply #442
Normally the only ways to deal with the clipping is lowering the gain or using the Advanced Limiter after SoX, but I think the problem here is Sox outputs 32-bit integers instead of "infinite resolution" 32-bit floating point sample values (greater than 1.0 or less than -1.0), so SoX clips before the Advanced Limiter has a chance to work.

This plugin should be modified to output 32-bit floats for maximum precision that avoids premature clipping.  Please. :)


Re: Resampler plugin

Reply #444
Yes, this plugin uses floating point math.

Probably arnaudf experiences clipping in ASIO2 plugin or ASIO driver. Adding Advanced Limiter should prevent this.

Re: Resampler plugin

Reply #445
Hi,

I don't think so.
If I don't use SoX resampler plugin the track has no clipping.

Re: Resampler plugin

Reply #446
Hi,

I don't think so.
If I don't use SoX resampler plugin the track has no clipping.

Anytime you run certains kinds of signal processing there's always a chance of clipping occurring if the headroom isn't adequate.  The spikes are related to the type of signal processing occurring.  In this case time domain and filtering.  And any filtering (both analog & digital) has the chance of introducing spikes that can clip into the audio stream as much as any changes to the time domain of any signal being processed, if there isn't much headroom available.

Adjust the volume level before resampling to give more headroom if clipping is an issue or use a floating point format file format and make the appropriate adjustments before requantization to an integer format.

 

Re: Resampler plugin

Reply #447
Hi,

I don't catch you... sorry
It is stated that Sox Fb2K use floating math, so what could it become integers ?
Also, I don't write back resampled content to any file.

With Sox : the path is FB2K chunks ==> Sox ==> ASIO2 plugin (and there is clipping) ==> soundcard (so yes DSP can alter sample amplitude)
Without Sox : the path is FB2K chunks ==> ASIO2 plugin (and there is no clipping) ==> soundcard
In both case volume settings is @0dB.

But if Sox is a DSP, it is also a resampler which can lead some samples to clip, but also has options to avoid this (-G, --norm) at least in its commandline version.

Re: Resampler plugin

Reply #448
SoX is a command-line program that contains many DSP algorithms, not just resampling.
About options:
Code: [Select]
-G, --guard              Use temporary files to guard against clipping
--norm                   Guard (see --guard) & normalise
foobar2000 DSP cannot have such options, it cannot buffer the whole song and write it to a temporary buffer.

Re: Resampler plugin

Reply #449
Hi,

I don't catch you... sorry
It is stated that Sox Fb2K use floating math, so what could it become integers ?
Also, I don't write back resampled content to any file.

With Sox : the path is FB2K chunks ==> Sox ==> ASIO2 plugin (and there is clipping) ==> soundcard (so yes DSP can alter sample amplitude)
Without Sox : the path is FB2K chunks ==> ASIO2 plugin (and there is no clipping) ==> soundcard
In both case volume settings is @0dB.

But if Sox is a DSP, it is also a resampler which can lead some samples to clip, but also has options to avoid this (-G, --norm) at least in its commandline version.


It becomes integers when it's sent to the sound card.  When you use WASAPI or ASIO you bypass Direct Sound's built-in limiter.

A few simple solutions with one being is to just use ReplayGain as you do have a few options to play with here (i.e. preamp for both With RG and Without RG, album, track, etc.), no additional components required because it's built in or another DSP in the chain that can alter the volume before the SOX Resampler.