Hydrogenaudio Forums

Hosted Forums => foobar2000 => 3rd Party Plugins - (fb2k) => Topic started by: lvqcl on 2008-11-19 02:45:54

Title: Resampler plugin
Post by: lvqcl on 2008-11-19 02:45:54
Good quality and fast resampler based on code from SoX `rate` effect.

If you want to know what settings are best:
1. Read SoX FAQ (http://sox.sourceforge.net/Docs/FAQ), "What are the best 'rate' settings to resample a file and retain the highest quality?"
2. This post: http://www.hydrogenaudio.org/forums/index....st&p=626176 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=67376&view=findpost&p=626176) (an excerpt from SoX help)
3. Feel free to experiment and decide what's best for you.

Changelog:

0.8.7:
- fixed a bug introduced in 0.8.4 that may result in crashes.
- recompiled with MSVS 2019 (16.2.0) and SDK-2019-06-30.

0.8.6:
- fixed a bug introduced in 0.8.5 when "Target samplerate" was set to "Upsample" or "Downsample".

0.8.5: maintenance release
- minor code cleanup;
- minor update of project files;
- update FFmpeg FFT code.
No bugfixes / speed increase / new features; 'mod' versions were not updated.

0.8.4:
- minor fixes;
- changed default quality from 'Normal' to 'Best';
- added signal extrapolation to reduce a possibility of clicks during track change;
- recompiled with latest SDK (2018-10-11). Works with foobar2000 1.4.x; users of 1.3.x need to download and install MSVC redist (here (https://aka.ms/vs/15/release/VC_redist.x86.exe)).

Old versions and old changelog are available here (http://www.hydrogenaudio.org/forums/index.php?showtopic=67373)
Title: Resampler plugin
Post by: patul on 2008-11-19 05:41:03
Downloading now & will try soon. I use SSRC however. Do you have any detailed comparison between your SoX based resampler vs PPHS, SSRC??

Thanks
Title: Resampler plugin
Post by: AFAIK on 2008-11-19 12:19:48
well... somebody made this test


http://src.infinitewave.ca/ (http://src.infinitewave.ca/)
Title: Resampler plugin
Post by: ExUser on 2008-11-19 15:00:53
Now does this resampler use the "High" or "Very High" setting?

Thanks for the component, by the way.
Title: Resampler plugin
Post by: AFAIK on 2008-11-19 17:46:30
I think i found a bug


when using in dsp chain and play a 22050Hz file, the playback time displayed in foobar is slower than it should be
and it sometimes even stall at 0:00

there might be something wrong...


btw. i love this component
Title: Resampler plugin
Post by: lvqcl on 2008-11-19 18:11:26
Now does this resampler use the "High" or "Very High" setting?

Thanks for the component, by the way.

Sorry, I don't fully understand your question. 
SoX effect named "rate" has 5 quality presets: quick, low, medium, high, very high.
Code: [Select]
    |      Quality   Band-  Rej dB   Typical Use       |
    |                width                             |
    |-q     quick     n/a   ?30 @    playback on       |
    |                        Fs/4    ancient hardware  |
    |-l      low      80%    100     playback on old   |
    |                                hardware          |
    |-m    medium     95%    100     audio playback    |
    |-h     high      95%    125     16-bit mastering  |
    |                                (use with dither) |
    |-v   very high   95%    175     24-bit mastering  |

Also, 'quick' and 'low' quality levels doesn't allow to override options like aliasing, steep filter and phase response. So I disabled them. I don't think that foobar users play music on ancient or old hardware 
Title: Resampler plugin
Post by: lvqcl on 2008-11-19 18:22:23
when using in dsp chain and play a 22050Hz file, the playback time displayed in foobar is slower than it should be
and it sometimes even stall at 0:00

Thanks, I'll investigate this.
Title: Resampler plugin
Post by: ExUser on 2008-11-19 18:48:12
Please ignore my earlier comment. I missed the configuration somehow. This looks great!
Title: Resampler plugin
Post by: vigylant on 2008-11-19 21:28:48
well... somebody made this test
http://src.infinitewave.ca/ (http://src.infinitewave.ca/)

The SSRC is better than this component, right?
Because if you select Passband/Transition, you can see that the SSRC is more similar to the "ideal filter".
Title: Resampler plugin
Post by: lvqcl on 2008-11-19 22:27:56
The SSRC is better than this component, right?
Because if you select Passband/Transition, you can see that the SSRC is more similar to the "ideal filter".

I'm afraid that it isn't so simple. Look at:

http://www.hydrogenaudio.org/forums/index....ost&p=81050 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=8177&view=findpost&p=81050)

http://www.hydrogenaudio.org/forums/index....ost&p=29125 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=2957&view=findpost&p=29125)

But I don't know of the audibility of ringing at Nyquist limit.


I think i found a bug


when using in dsp chain and play a 22050Hz file, the playback time displayed in foobar is slower than it should be
and it sometimes even stall at 0:00

there might be something wrong...


btw. i love this component

Bug confirmed and (I hope ) fixed. Updated version is available. Thanks!
Title: Resampler plugin
Post by: vigylant on 2008-11-19 22:45:56
Hmm, ok, i take it this one is better then
But im wondering: What should i use for samplerate conversion? (From 44100 to 96000)
My soundcard (Onkyo SE-90PCI, highend stereo soundcard, VIA Envy24 chip) or this plugin, any idea which one is better?

Probably hard/impossible to tell without actually testing my soundcard
Title: Resampler plugin
Post by: bandpass on 2008-11-20 06:38:21
The SSRC is better than this component, right?
Because if you select Passband/Transition, you can see that the SSRC is more similar to the "ideal filter".

I'm afraid that it isn't so simple. Look at:

http://www.hydrogenaudio.org/forums/index....ost&p=81050 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=8177&view=findpost&p=81050)

http://www.hydrogenaudio.org/forums/index....ost&p=29125 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=2957&view=findpost&p=29125)


lvqcl, good work with the port, and good pointers to some well informed posts. 

vigylant, the bandwidth of the SoX SRC is configurable up to 99.7% which pretty much matches that of SSRC (standard).  But be aware, that the closer you get to the nyquist, the more artifacts you get; look closely at the transition graphs for the Shibatch SRC and you'll see that (esp. for the hp version) the transition lies to the right of the ideal filter's -- i.e. aliasing is occurring.

  -bandpass
Title: Resampler plugin
Post by: jaro1 on 2008-11-23 00:22:55
I had carefully compared this SRC, based on SOX 14.2.0 with other foobar resamplers and it is sonically the best resampler out there, IMHO of course. On this SRC I appreciate very low artifacts, frequency responce, good transition and very low noise floor.
Then I found this, maybe well known side yet (http://src.infinitewave.ca), which basically confirmed my experience. SOX with VHQ settings is according to this side for me in pair with iZ RX Advanced (High steepness), which is in some parameters maybe very slightly better, but has also a little higher noise floor, which is on sweep test result picture quite visible and therefore maybe for highend headphones or speakers also audible.
So many many thanks to the author for hard work and time for creating and uploading this free soft, which will certainly improve listening experience for people with low/medium quality sound cards/int. chips. To author, I intercede for future development of this great plug-in to make it even better, btw I didn't find any bugs in this version yet.
So thank you very very much again
Title: Resampler plugin
Post by: ExUser on 2008-11-23 00:46:19
@jaro1: I am not convinced that you did, indeed, hear a difference. The quantifiable differences between PPHS and this resampler are below the threshold of human hearing. Please re-read our terms of service, paying attention to point 8.

That is not to diminish the efforts of the developer of this component. I am now using it myself for high quality work, due to the objective differences. Subjectively, however, I am not convinced it is possible to discern between PPHS and the SoX resampler. The site you cited primarily concerns itself with inaudible qualities.
Title: Resampler plugin
Post by: hidn on 2008-11-23 13:37:40
question which I must ask. He as well as PPHS Ultra?
Title: Resampler plugin
Post by: jaro1 on 2008-11-23 19:05:29
@jaro1: I am not convinced that you did, indeed, hear a difference. The quantifiable differences between PPHS and this resampler are below the threshold of human hearing. Please re-read our terms of service, paying attention to point 8.

That is not to diminish the efforts of the developer of this component. I am now using it myself for high quality work, due to the objective differences. Subjectively, however, I am not convinced it is possible to discern between PPHS and the SoX resampler. The site you cited primarily concerns itself with inaudible qualities.


Because of very short time I could not write all circumstances of listening tests I'done, now I can only add, that I wasn't alone, there were three of us, loudspeakers-B&W Sig. Diamond; headphones - AKG K701.
But according to service terms you are absolutely right, but I wanted because of time shortness write something about our SUBJECTIVE observations and at least say thanks to the author, sorry for forum rules breaking and also for my bad english.
Title: Resampler plugin
Post by: Jorgo on 2008-11-23 19:23:47
This seems to be a very good resampler. From my limited understanding, it rivals the SSRC resampler but uses less CPU.

A visual comparison can be seen at
http://sox.sourceforge.net/SoX/Resampling (http://sox.sourceforge.net/SoX/Resampling)
http://sox.sourceforge.net/rate-44k1-96k.png (http://sox.sourceforge.net/rate-44k1-96k.png)

The example of VERY HIGH (-v) looks almost the same as the Secret Rabbit result with -c0 and
Secret Rabbit -c1 looks very close to MEDIUM with 90% bandwidth (-mb 90). Other than that, I don't know enough to be able to interpret the impulse response per se.

Here are some more pointers from the SOX manual:

Quality         Band-width     Rej dB   Typical Use
-q   quick    n/a                   ~=30 @ Fs/4    playback on ancient hardware
-l   low           80%                   100           playback on old hardware
-m   medium   95%                   100           audio playback
-h   high           95%                   125           16-bit mastering (use with dither)
-v   very high    95%                   175           24-bit mastering
Title: Resampler plugin
Post by: hidn on 2008-11-24 06:09:24
someone who can compile and lay out icl version?
Title: Resampler plugin
Post by: lvqcl on 2008-11-27 19:16:43
Version 0.3.0 is out. It seems that resampling routines are not thread-safe, so I changed them a little.

By the way, I think that "Resampler based on SoX 'rate' effect" is a bit awkward name. Any ideas how to name this plugin more elegantly?
Title: Resampler plugin
Post by: ExUser on 2008-11-28 01:33:41
SoX Resampler.

Resampler (SoX) in the DSP list.
Title: Resampler plugin
Post by: .halverhahn on 2008-12-31 12:36:26
Thank You for transfering this great resampler to f2k! 
Title: Resampler plugin
Post by: Jorgo on 2009-03-09 21:34:34
0.4.0... uh, what? Please don't rename stuff so it gets broken in the DSP setup... the names should be kept between updates.
Title: Resampler plugin
Post by: lvqcl on 2009-03-09 22:03:38
0.4.0... uh, what? Please don't rename stuff so it gets broken in the DSP setup... the names should be kept between updates.


0.4.0 version is in alpha stage 
Title: Resampler plugin
Post by: jaro1 on 2009-03-10 10:00:44
Hi, I know it's a little offtopic, but I wanted to ask lvqcl  to something, because I suppose he knows SOX internal routines quiet good yet.
Would it be possible in the future make a plugin, which implements SOX deemphasis filter? (deemph: ISO 908 CD de-emphasis (shelving) IIR filter)

Till now I use for it wav impuls responses with FB2Ks Convolver plugin, but this isn't a right choice according to this german page:
http://www.radonmaster.de/robernd/tAFILTER.html (http://www.radonmaster.de/robernd/tAFILTER.html)  (thanks to author and Surfi for the link)
On this side there are packed wav signals, with explanation, for testing different deemphasis filters ( there is also filter of old SOX version, which results very badly, it altered also stereo image... )
Filter from recent SOX version is perfect, but solution with Convolver plugin (whatever impulse I use) alters a signal after closser look in Audition quiet a lot from what it should do, although frequencygoing could be very close and therefore after listening undistinguishable. 

For me is use of Convolver plugin, at least for this purpose, a little unpractical and ultimately inaccurate, so therefore this idea. By the way, it may or may not be a problem, but I think SOX deemph filter has 32bit internal precision, which is, on the other side, for this kind of operation absolutely necessary.

Once more, sorry for offtopic and thanks for your opinion.
Title: Resampler plugin
Post by: lvqcl on 2009-03-10 16:56:29
Hi, I know it's a little offtopic, but I wanted to ask lvqcl  to something, because I suppose he knows SOX internal routines quiet good yet.

I think bandpass knows them much more 

Filter from recent SOX version is perfect, but solution with Convolver plugin (whatever impulse I use) alters a signal after closser look in Audition quiet a lot from what it should do, although frequencygoing could be very close and therefore after listening undistinguishable.

Seems strange for me. Try to use this impulse: deemph_SoX.wav (http://www.hydrogenaudio.org/forums/index.php?act=attach&type=post&id=7353)

For me is use of Convolver plugin, at least for this purpose, a little unpractical and ultimately inaccurate, so therefore this idea. By the way, it may or may not be a problem, but I think SOX deemph filter has 32bit internal precision, which is, on the other side, for this kind of operation absolutely necessary.

I tested SoX and Convolver with my impulse: difference between them is about -130 dB. So convolver is quite accurate.
And don't use "Auto level adjust" option.
Title: Resampler plugin
Post by: bandpass on 2009-03-10 22:02:57
Hi, I know it's a little offtopic, but I wanted to ask lvqcl  to something, because I suppose he knows SOX internal routines quiet good yet.

I think bandpass knows them much more 


It's just a simple (but accurate) biquad; coefficients in the freqz line below.  So if there's already a foobar biquad plug-in, just plug-in  the numbers.

  -bandpass

% GNU Octave file (may also work with MATLAB® )
Fs=44100;minF=10;maxF=Fs/2;
sweepF=logspace(log10(minF),log10(maxF),200);
[h,w]=freqz([0.460351 -0.284408 0.0338888],[1 -1.05429 0.264123],sweepF,Fs);
semilogx(w,20*log10(h))
title('SoX effect: deemph gain=-9.477 frequency=5283 slope=0.4845 (rate=44100)')
xlabel('Frequency (Hz)')
ylabel('Amplitude Response (dB)')
axis([minF maxF -35 25])
grid on
disp('Hit return to continue')
pause


Title: Resampler plugin
Post by: jaro1 on 2009-03-11 08:33:34
Thanks to both lvqcl, bandpass for your comments, it was very helpfull for me.
Title: Resampler plugin
Post by: bandpass on 2009-03-11 14:11:57
Just a thought: to be on the safe side, here are the coefs printed out for double precision (single precision can sometimes cause problems with IIRs):

[4.603507788631885e-01 -2.844082119124985e-01 3.388877229118695e-02]
[1 -1.054291462785692e+00 2.641228020275685e-01]

  -bandpass
Title: Resampler plugin
Post by: a3aan on 2009-03-11 19:21:33
May I suggest a configuration option to only resample sample rates that are not supported by the (ASIO) audio card in use? Perhaps ideally just by doubling the rate until a supported rate is found?

Cheers,
Adriaan.
Title: Resampler plugin
Post by: kode54 on 2009-03-11 20:49:27
May I suggest a configuration option to only resample sample rates that are not supported by the (ASIO) audio card in use? Perhaps ideally just by doubling the rate until a supported rate is found?

Cheers,
Adriaan.


Sounds like something that can be done with a separate DSP filter and the resampler_entry (resampler.h) class could be useful. An ideal solution would have a configurable list of supported sample rates, then upsample to the nearest supported rate as necessary.
Title: Resampler plugin
Post by: lvqcl on 2009-03-12 17:28:44
May I suggest a configuration option to only resample sample rates that are not supported by the (ASIO) audio card in use? Perhaps ideally just by doubling the rate until a supported rate is found?

I thought about it, but ~99% of files in my music library have sample rate 44.1 kHz, so if I were to use ASIO, I'd stick with resampling all to 44 
I'll think about adding this feature.
Title: Resampler plugin
Post by: a3aan on 2009-03-12 20:56:26
Thanks a lot for considering. I'm ready to help with some testing .

Are you saying that if I choose 44.1 kHz as a target rate then 44.1 kHz files are being sent to the card untouched? Sorry if I'm ignorant here.

May I suggest a configuration option to only resample sample rates that are not supported by the (ASIO) audio card in use? Perhaps ideally just by doubling the rate until a supported rate is found?

I thought about it, but ~99% of files in my music library have sample rate 44.1 kHz, so if I were to use ASIO, I'd stick with resampling all to 44 
I'll think about adding this feature.

Title: Resampler plugin
Post by: lvqcl on 2009-03-12 21:35:11
Quote
Are you saying that if I choose 44.1 kHz as a target rate then 44.1 kHz files are being sent to the card untouched?

Sure. PPHS and SSRC do the same, though.
Title: Resampler plugin
Post by: punkrockdude on 2009-03-15 00:35:43
I wonder what are the difference and therefore ten different plugins to choose from? Regards
Title: Resampler plugin
Post by: lvqcl on 2009-04-05 16:21:38
I wonder what are the difference and therefore ten different plugins to choose from? Regards

Sorry, didn't mention your question. They are all essentially the same. Foobar2000 prior to 0.9.6.4 didn't allow to put the same DSP plugin into its DSP chain twice, so as a workaround (and for testing purposes!) I made 10 resampler dlls.
Title: Resampler plugin
Post by: lvqcl on 2009-04-05 16:28:06
Sounds like something that can be done with a separate DSP filter and the resampler_entry (resampler.h) class could be useful. An ideal solution would have a configurable list of supported sample rates, then upsample to the nearest supported rate as necessary.

What's the purpose of resampler_entry class?
(for example, when is_conversion_supported() or get_priority() functions can be useful?)
Title: Resampler plugin
Post by: Yirkha on 2009-04-05 17:31:54
[font= "Courier New"]is_conversion_supported()[/font] - some resamplers are able to convert only between certain sample rates (e.g. 44100 and 48000), so call that if you want to know before trying to instantiate it.
[font= "Courier New"]get_priority()[/font] - to differentiate resamplers with poor quality (but fast operation, e.g. for playback) and resamplers with high quality (but maybe even sub-realtime speed, e.g. for conversion).
Title: Resampler plugin
Post by: lvqcl on 2009-04-05 18:35:15
Thanks, but what if my component doesn't have them?  I took foo_dsp_tutorial source code and used it as an example of how my component can be written. So I didn't implement anything related to resampler_entry class.

SSRC resampler has a class derived from resampler_entry but these 2 functions are never called.  Are they intended for 3rd party components and not for fb2k itself?
Title: Resampler plugin
Post by: Yirkha on 2009-04-05 18:56:18
[font= "Courier New"]dsp[/font] is a generic DSP service.

[font= "Courier New"]resampler_entry[/font] service is a special interface for resampler DSPs, so that when someone wants to resample audio data (not necessarily during/for playback), he can use one of the existing resamplers easily, providing just source and destination sample rate. That's not possible with plain DSP, because the preset format is private and configuration is set in user interface.

If foobar2000 core don't seem to be calling those two methods, it doesn't matter. It just means that the interface has been made flexible, they can naturally be useful in some scenarios (see my previous post).
Title: Resampler plugin
Post by: lvqcl on 2009-04-05 19:18:33
Thanks again. I will use resampler_entry class (and WTL, too  ) in future versions.
Title: Resampler plugin
Post by: Mix3dmessagez on 2009-04-06 10:51:16
Uploaded here (http://www.hydrogenaudio.org/forums/index.php?showtopic=67373)

Good quality, fast resampler (~2 times faster than PPHS Ultra, although ~2.5 times slower than regular PPHS). Minimum / intermediate / linear phase.
Any comments?


Hey everyone, I upsample music with noise sharpening at 56 percent and utilize the advanced limiter to prevent clipping..

I replaced the built in foobar resampler with this one, and upsample to 48000...

I see options for a type of phase response, also steep filter and allow aliasing...

My question is, what does those settings do?I'm going for the highest quality crispest sound here, can anyone suggest settings or direct me to where i can find out more?
Title: Resampler plugin
Post by: Mr.Duck on 2009-04-06 13:16:31
Thanks, lvqcl. A really excelent plugin. Must be the best resampler available for foobar. Thanks to SoX as well of course! Excelent job.
Title: Resampler plugin
Post by: lvqcl on 2009-04-06 15:34:18
Quote
My question is, what does those settings do?


http://sox.sourceforge.net/Docs/FAQ (http://sox.sourceforge.net/Docs/FAQ)  --  "What are the best 'rate' settings to resample a file and retain the highest quality?"
Title: Resampler plugin
Post by: Mix3dmessagez on 2009-04-06 17:42:51
Quote
My question is, what does those settings do?


http://sox.sourceforge.net/Docs/FAQ (http://sox.sourceforge.net/Docs/FAQ)  --  "What are the best 'rate' settings to resample a file and retain the highest quality?"



Thank you, that was very helpful, but my other questions I didn't see on the website; What is 'Allow Aliasing', and 'Steep Filter'?
Title: Resampler plugin
Post by: lvqcl on 2009-04-06 18:29:04
From help file of standalone SoX program (ver. 14.4.0):

Code: [Select]
              The simple quality selection described above  provides  settings
              that satisfy the needs of the vast majority of resampling tasks.
              Occasionally, however, it may  be  desirable  to  fine-tune  the
              resampler's  filter  response;  this can be achieved using over‐
              ride options, as detailed in the following table:

              -M/-I/-L     Phase response = minimum/intermediate/linear
              -s           Steep filter (band-width = 99%)
              -a           Allow aliasing/imaging above the pass-band
              -b 74-99.7   Any band-width %
              -p 0-100     Any phase response (0 = minimum, 25 = intermediate,
                           50 = linear, 100 = maximum)

              All resamplers use filters  that  can  sometimes  create  `echo'
              (a.k.a.   `ringing')  artefacts  with  transient signals such as
              those that occur with `finger snaps' or other highly  percussive
              sounds.   Such  artefacts  are much more noticeable to the human
              ear if they occur before the transient (`pre-echo') than if they
              occur  after  it (`post-echo').  Note that frequency of any such
              artefacts is related to the smaller of the original and new sam‐
              pling rates but that if this is at least 44.1kHz, then the arte‐
              facts will lie outside the range of human hearing.

              A phase response setting may be used to control the distribution
              of  any  transient  echo  between `pre' and `post': with minimum
              phase, there is no pre-echo but the longest post-echo; with lin‐
              ear  phase,  pre  and  post echo are in equal amounts (in signal
              terms, but not audibility terms); the intermediate phase setting
              attempts to find the best compromise by selecting a small length
              (and level) of pre-echo and a medium lengthed post-echo.

              Minimum, intermediate, or  linear  phase  response  is  selected
              using  the  -M, -I, or -L option; a custom phase response can be
              created with the -p option.  Note that phase  responses  between
              `linear' and `maximum' (greater than 50) are rarely useful.

              A resampler's band-width setting determines how much of the fre‐
              quency content of the original signal (w.r.t. the original  sam‐
              ple rate when up-sampling, or the new sample rate when down-sam‐
              pling) is preserved during conversion.  The term `pass-band'  is
              used  to  refer  to  all  frequencies up to the band-width point
              (e.g. for 44.1kHz sampling rate, and a resampling band-width  of
              95%,  the  pass-band  represents  frequencies from 0Hz (D.C.) to
              circa 21kHz).  Increasing the resampler's band-width results  in
              a  slower  conversion  and can increase transient echo artefacts
              (and vice versa).

              The -s `steep filter' option changes resampling band-width  from
              the default 95% (based on the 3dB point), to 99%.  The -b option
              allows the band-width to be  set  to  any  value  in  the  range
              74-99.7  %, but note that band-width values greater than 99% are
              not recommended for normal use as they can cause excessive tran‐
              sient echo.

              If the -a option is given, then aliasing/imaging above the pass-
              band is allowed.  For example, with 44.1kHz sampling rate, and a
              resampling  band-width of 95%, this means that frequency content
              above 21kHz can be distorted; however, since this is  above  the
              pass-band  (i.e.   above the highest frequency of interest/audi‐
              bility), this may not be a problem.  The  benefits  of  allowing
              aliasing/imaging  are  reduced  processing time, and reduced (by
              almost half) transient echo artefacts.
Title: Resampler plugin
Post by: Mix3dmessagez on 2009-04-06 18:45:07

Thank you for your great support, one last question, is my setup for it good?

I use 4800hz, very best quality, disabled steep filter and allow aliasing, with a  linear phaser option, is this optimal for aac music files?

other dsp's i use...

noise sharpening 34%
advanced limiter
Title: Resampler plugin
Post by: lvqcl on 2009-04-06 18:51:16
Quote
Thank you for your great support, one last question, is my setup for it good?

I use 4800hz, very best quality, disabled steep filter and allow aliasing, with a linear phaser option, is this optimal for aac music files?


Yes. (I think you mean 48000 Hz?)
Title: Resampler plugin
Post by: esa372 on 2009-06-01 21:11:57
I just found this thread...

Thanks, lvqcl - It's just what i needed.

Title: Resampler plugin
Post by: Steve Forte Rio on 2009-07-09 20:20:04
I do not understand.... What about "allow aliasing"? How does it affects the quality for 44.1=>48kHz resampling??? And what phase response may I use for better sound???
Title: Resampler plugin
Post by: lvqcl on 2009-07-10 16:36:02
Quote
I do not understand.... What about "allow aliasing"?

A picture is worth a thousand words: (http://en.wikipedia.org/wiki/A_picture_is_worth_a_thousand_words)

Original test signal (44.1 kHz):
(http://img212.imageshack.us/img212/6200/42123751.png)

Resampled to 48 kHz (bandwith = 90%, aliasing = no):
(http://img38.imageshack.us/img38/9945/17058725.png)

Resampled to 48 kHz (bandwith = 90%, aliasing = yes):
(http://img197.imageshack.us/img197/5310/29536743.png)

(I used bandwith = 90% instead of default value (95%) to make pics more illustrative)


Quote
And what phase response may I use for better sound???

I'm sure you can find some info about linear-phase vs. minimum-phase filters here on HA.

But 44.1kHz -> 48kHz conversion introduces artifacts in ~22kHz region. So chances are high that you won't hear any difference between different settings.
Title: Resampler plugin
Post by: ncdrawl on 2009-07-11 08:12:25
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.
Title: Resampler plugin
Post by: Steve Forte Rio on 2009-07-16 20:49:49
Original test signal (44.1 kHz)

can you give me a link to this test signal???
Title: Resampler plugin
Post by: lvqcl on 2009-07-18 07:26:39
I made it myself with Adobe Audition: Generate -> Tones.

Base frequency: 11025 Hz;
Modulate by: 10900 Hz;
Modulation freq: 0.5 Hz
...
Flavor: Sine.
Title: Resampler plugin
Post by: Steve Forte Rio on 2009-07-18 10:15:46
Thank you very much!
Title: Resampler plugin
Post by: lvqcl on 2009-07-29 01:19:23
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)
Title: Resampler plugin
Post by: lxofith on 2009-08-19 22:08:49
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
Title: Resampler plugin
Post by: theilladelph on 2009-08-22 12:01:44
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
Title: Resampler plugin
Post by: lvqcl on 2009-08-22 12:13:22
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.
Title: Resampler plugin
Post by: lvqcl on 2009-11-19 17:40:49
Modified version available now here: http://www.hydrogenaudio.org/forums/index....st&p=668463 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=67373&view=findpost&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"
Title: Resampler plugin
Post by: lxofith on 2009-11-19 20:04:07
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!
Title: Resampler plugin
Post by: lvqcl on 2009-11-19 22:02:47
Add 2 resamplers in your DSP chain

1st: target = 48k, list = "32000;44100;88200;176000".
2nd: target = 44.1k, list = "32000".
Title: Resampler plugin
Post by: lxofith on 2009-11-20 17:44:12
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".
Title: Resampler plugin
Post by: lvqcl on 2009-11-20 21:52:56
I assume you meant:

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


Of course. 
Title: Resampler plugin
Post by: Robertina on 2009-11-21 04:51:11
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.
Title: Resampler plugin
Post by: kode54 on 2009-11-21 06:39:29
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.
Title: Resampler plugin
Post by: Robertina on 2009-11-21 10:03:03
Question answered, thank you, kode54.
Title: Resampler plugin
Post by: lvqcl on 2009-11-21 12:12:30
...And you will see [DSP not found] line in the DSP settings. (or <ERROR> in fb2k 1.0 beta).
Title: Resampler plugin
Post by: Robertina on 2009-11-21 12:17:01
Thank you, lvqcl.

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

Robertina.
Title: Resampler plugin
Post by: a3aan on 2009-11-21 15:39:20
Modified version available now here: http://www.hydrogenaudio.org/forums/index....st&p=668463 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=67373&view=findpost&p=668463)


Great. Thanks a lot.
Title: Resampler plugin
Post by: Olev on 2009-11-24 20:07:14
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!
Title: Resampler plugin
Post by: lxofith on 2009-11-24 20:23:08
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.
Title: Resampler plugin
Post by: Olev on 2009-11-24 21:08:49
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.
Title: Resampler plugin
Post by: lvqcl on 2009-11-24 23:40:17
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.
Title: Resampler plugin
Post by: gecus on 2009-12-02 16:31:04
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!
Title: Resampler plugin
Post by: lvqcl on 2009-12-02 17:07:15
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.
Title: Resampler plugin
Post by: gecus on 2009-12-04 22:44:20
Thanks lvqcl. Another question, how can I learn to use your program. I have downloaded your component and installed it in Foobar...now, I have no idea how to make it work. Are there any posts out there explainig how to use it? I am not a developper as most of the people in this Forum.
I would like to convert my current 16bits/44.1khz files into 24bits/96khz or higher sampling.
How could I learn how to use your tool?

Thanks again!
Title: Resampler plugin
Post by: gecus on 2009-12-04 23:20:09
Thanks lvqcl. Another question, how can I learn to use your program. I have downloaded your component and installed it in Foobar...now, I have no idea how to make it work. Are there any posts out there explainig how to use it? I am not a developper as most of the people in this Forum.
I would like to convert my current 16bits/44.1khz files into 24bits/96khz or higher sampling.

In Foobar, File-->Preferences-->DSP Manager--> I activated Resampler (SoX) --> Configuration/Resampler Settings:

Target Samplerate: 96000 Hz / Quality: Very High

Passband: the default is 95%
I allowed alliasing for faster response...?
Phase response: Linear

My ssystem also allows up to 192Khz...would this be better?

Would this make sense?

Do I set up the 24 bits on the Output data format: 24 bits and that's all?


Thanks again! And sorry to everybody if my questions sound too obvious...
Title: Resampler plugin
Post by: lvqcl on 2009-12-04 23:29:53
I hope you understand that 24/96 files will have the same quality than original 16/44?

But if you want to do so, just use foobar2000 converter (http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Converter): add SoX resampler into DSP chain and configure it as you wish.

If you don't know how to use converter... my english is quite limited and I think I cannot describe this to you in detail. Maybe it's better to ask someone else about converter.
Title: Resampler plugin
Post by: Infinito on 2009-12-20 01:38:17
Allow aliassing or not?
:\ i dont know what is better
Title: Resampler plugin
Post by: Herbeck on 2009-12-25 05:10:15
Hi Ivqcl,

Would it be possible to add a mode that bypassed the filter completely?
(I would like to try some up and down sampling with my own filters)


All the best

Herbeck
Title: Resampler plugin
Post by: lvqcl on 2009-12-25 15:26:41
Would it be possible to add a mode that bypassed the filter completely?
(I would like to try some up and down sampling with my own filters)

Just remove the plugin from DSP chain. Or set output samplerate equal to input samplerate.
Title: Resampler plugin
Post by: Herbeck on 2009-12-26 05:52:59
Would it be possible to add a mode that bypassed the filter completely?
(I would like to try some up and down sampling with my own filters)

Just remove the plugin from DSP chain. Or set output samplerate equal to input samplerate.

 

I want to change the sample rate but without the low pass filter.
I know this is an odd request, and the sound will be awful.
But I would like to try some ideas with another low pass filter.

Herbeck
Title: Resampler plugin
Post by: lvqcl on 2009-12-26 15:29:28
You see, lowpass filter is integrated into SoX routines that I use, and I don't fully understand all those algorithms. I'd rather not touch them.

You can try foo_dsp_src9 with "ZOH Interpolator" and 2x/3x/4x/... upsampling.
Title: Resampler plugin
Post by: Herbeck on 2009-12-27 03:54:21
Hi Ivqcl,

I have already tried it, but it messes up the bitrates and have a little slope on the passband.
But otherwise it is the kind of SRC I am locking for.

So if you know someone who can disable the low pass filter in sox,
or have another idea how to solve this, please let me know.


Many thanks

Herbeck
Title: Resampler plugin
Post by: kode54 on 2009-12-27 07:58:57
I don't get the point of disabling the low pass filter. It should only be filtering to the Nyquist frequency for the target sample rate you choose. Plus, it's not like an upsampling filter can magically introduce high frequency content above the Nyquist frequency for your source sample rate. Anything above that would be aliasing.
Title: Resampler plugin
Post by: lvqcl on 2009-12-27 11:02:37
That's how foo_dsp_src9 works for 2x up- and downsampling. (44.1 -> 88.2 and 44.1 -> 22.05 kHz).

Original signal:

(http://img697.imageshack.us/img697/2577/sweep44.png)

Upsampled signal:

(http://img63.imageshack.us/img63/4937/sweep4488.png)

Downsampled signal:

(http://img63.imageshack.us/img63/1709/sweep4422.png)

Is this what you want?
Title: Resampler plugin
Post by: Herbeck on 2009-12-27 13:05:34
Hi Ivqcl,

Thank you for trying to help me with this odd request.
But the foo_dsp_src9 is not good enough for what I am trying to do.

If you do a simple test with foo_dsp_src9 and upsample a 44.1 file to 88.2 and then back to 44.1.
Then you will find that the converted file is smaller than the original file.
Like I said it messes up the bitrate.

And the slope on the passband you can see in this SRC Comparison (http://src.infinitewave.ca/)

Sox is very good for a freeware, but I use iZotope 64-bit SRC for up and down sampling.
The filter in a SRC is what make the big deferens between different SRC's.
The low pass filter I want to try is a linear phase filter but with less preringing than the one in Sox and iZotope.

I am not even close to have the knowledge to make my own SRC.
So what I am looking for is a good SRC without the lowpass filter.
And then let the SRC do the math so I can add the low pass filter manually.


Thanks again and all the best

Herbeck
Title: Resampler plugin
Post by: lvqcl on 2009-12-27 13:44:45
Quote
I am not even close to have the knowledge to make my own SRC.


For N x upsampling without filter, all you need is to insert (N-1) null samples after each input sample.
Title: Resampler plugin
Post by: Herbeck on 2009-12-27 15:15:24
Yes, but I also need to be able to convert from lets say 192Khz to 44.1Khz,
and to make a program of it with an easy workflow.
By the way that is what I like so much with your Sox plug, the easy workflow.

I am simply not a programmer.

If you can help me with this, I am willing to donate some money, because I really want to
try this filter that I wrote about on a SRC.

Don't take me wrong, I'm not rich, I'm talking about a symbolic sum to show my appreciation.


Herbeck

Title: Resampler plugin
Post by: lvqcl on 2009-12-27 19:07:38
I'm not a programmer too, I just know C++ a little. 

Try this simple plugin. It adds 2 entries to DSP: "2x upsample w/o lpf" and "2x downsample w/o lpf".
Title: Resampler plugin
Post by: Herbeck on 2009-12-28 07:58:36
Hi Ivqcl,

If you use your "2x upsample w/o lpf" and look at the upsampled file at a sample level,
you will se that every second sample is missing, and the volume is half of the original file.

But it looks really cool I've never seen anything like it. 

I think upsampling is pretty strait forward compared to downsampling.
Pretty much what you have done in "2x upsample w/o lpf", but without the gaps between the samples.
I've had the impression that down sampling is more complicated.

But I don't know, and I've been wrong before.

Hebeck
Title: Resampler plugin
Post by: Herbeck on 2009-12-28 11:27:26
Or maybe this is exactly how it should look like before the low pass filter is added.
Like I said, I've been wrong before.

but I had to add two of the upsampled files to get the original file volume before I added the filter.
And of course the gaps between the samples were gone after I added the filter.

If there were no gaps the "2x upsample w/o lpf" would have added something that wasn't there
from the beginning.

But it looked so weird I thought some thing is wrong.

I'm a little busy for a couple of days, but I'll be doing some test as soon as I can.



Thank you again Ivqcl !!!!


Herbeck

Title: Resampler plugin
Post by: Herbeck on 2010-01-03 11:26:07
"Sample rate conversion process often adjusts peak structure of the original program material"  -Aleksey Vaneev

This is what the "2x upsample w/o lpf" is lacking.

However, I was able to do some tests thanks to your little plugin, and it looks promising.
So now I'm eager to find out if it's possible to bypass the lowpass filter in Sox.

I've seen you mention a member that calls him/herself "Bandpass".
Do you think "Bandpass" would be able to help me with this issue.


In other words, can Bandpass bypass the lowpass? 


All the best

Herbeck
Title: Resampler plugin
Post by: lvqcl on 2010-01-03 12:12:33
"Sample rate conversion process often adjusts peak structure of the original program material"  -Aleksey Vaneev

This is what the "2x upsample w/o lpf" is lacking.

That's because it doesn't have lowpass filter 

I've seen you mention a member that calls him/herself "Bandpass".
Do you think "Bandpass" would be able to help me with this issue.


In other words, can Bandpass bypass the lowpass?

I doubt it, but you can ask him directly: his profile (http://www.hydrogenaudio.org/forums/index.php?showuser=56644)
Title: Resampler plugin
Post by: chuuey on 2010-01-14 10:03:08
thanks for the sse2 version
Title: Resampler plugin
Post by: a3aan on 2010-01-14 11:14:50
SSE2 version is available (see the 1st post). It works ca. Up to 10% faster than the default one.


Great!  Mod version from a few posts up in the pipeline?

Adriaan.
Title: Resampler plugin
Post by: PostOfficeBuddy on 2010-04-08 06:46:04
I just wanted to say thanks for this. You rock lvqcl.
Title: Resampler plugin
Post by: h34rtb1t on 2010-05-18 20:47:45
Well done and thank you for your effort.
Title: Resampler plugin
Post by: h34rtb1t on 2010-05-20 10:19:30
Would you please add one more configuration setting, which do upsample 4x for [0, 48]kHz and 2x for (48, 96]kHz source.

Thanks.
Title: Resampler plugin
Post by: lvqcl on 2010-05-20 14:15:29
Would you please add one more configuration setting, which do upsample 4x for [0, 48]kHz and 2x for (48, 96]kHz source.

Thanks.


You can do this with SoX_resampler_mod (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=67373&view=findpost&p=668463).

Just add 2 resamplers to DSP chain. First makes 4x upsampling and passes 64000,88200,96000 unmodified. Second makes 2x upsampling and passes 128000,176400,192000 unmodified.
Title: Resampler plugin
Post by: h34rtb1t on 2010-05-24 17:10:21
Would you please add one more configuration setting, which do upsample 4x for [0, 48]kHz and 2x for (48, 96]kHz source.

Thanks.


You can do this with SoX_resampler_mod (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=67373&view=findpost&p=668463).

Just add 2 resamplers to DSP chain. First makes 4x upsampling and passes 64000,88200,96000 unmodified. Second makes 2x upsampling and passes 128000,176400,192000 unmodified.


Oh, I see. Great tip!

But, could you please provide the binary of modded version of 0.5.4.1+SSE2?
Title: Resampler plugin
Post by: a3aan on 2010-05-29 11:24:09
SoX resampler (+mod) 0.5.4.2:
..

Thanks!
Title: Resampler plugin
Post by: hidn on 2010-06-08 14:23:54
It is possible to do x64 bit version of plugin? 
Title: Resampler plugin
Post by: kode54 on 2010-06-08 15:02:26
It is possible to do x64 bit version of plugin? 

Yes, as soon as there's an x64 version of foobar2000.
Title: Resampler plugin
Post by: lvqcl on 2010-06-08 15:03:28
It is possible to do x64 bit version of plugin? 


Yes. All you need is 64-bit version of foobar2000.
Title: Resampler plugin
Post by: hidn on 2010-06-08 19:09:11
well. request useless. 'll just wait for the mass transition to x64 
Title: Resampler plugin
Post by: j_b on 2010-06-09 16:07:42
Try this simple plugin. It adds 2 entries to DSP: "2x upsample w/o lpf" and "2x downsample w/o lpf".


Please consider adding “2x upsample with linear interpolation” to foo_dsp_resamp.
Title: Resampler plugin
Post by: lvqcl on 2010-06-09 16:36:12
Quote
Please consider adding “2x upsample with linear interpolation” to foo_dsp_resamp.

Why do you want it? 
Title: Resampler plugin
Post by: ArtS21 on 2010-06-18 16:15:02
You can do this with SoX_resampler_mod (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=67373&view=findpost&p=668463).

Just add 2 resamplers to DSP chain. First makes 4x upsampling and passes 64000,88200,96000 unmodified. Second makes 2x upsampling and passes 128000,176400,192000 unmodified.

I'm confused  Mod allows upsampling only up to 48000. How come you write about 64000,88200,96000, etc?
Title: Resampler plugin
Post by: lvqcl on 2010-06-18 19:06:20
Quote
Mod allows upsampling only up to 48000.


You can choose target samplerate. Works here flawlessly.
Title: Resampler plugin
Post by: rastan on 2010-07-17 19:51:05
I recently modded my X-fi Prelude with removing 24mhz crystal and connecting an external clock generator with same value due to jitter. After this mod, I managed with failure of playback 44.1k files. Since that I don't know how fix this via another hardware mod, i went to resample during playback all my archive (most 44.1khz flac) to a value which X-Fi chip natively supports it (aka 48/96khz). Then I find Sox resampler here.

I wonder that is there any comparision between X-Fi's native resampler vs. Sox even I know that Sox resampler one of the best out there.

Thanks to lvpcl and Sox team for this great fb2k component anyway..
Title: Resampler plugin
Post by: khaos974 on 2010-07-31 12:33:35
In the 0.5.4.2, what is the difference between the mod and the mod2 versions?
Title: Resampler plugin
Post by: lvqcl on 2010-07-31 12:44:00
mod: It doesn't resample the frequencies that you enter in the text field.

mod2: It resamples only the frequencies that you enter in the field.
Title: Resampler plugin
Post by: Sandrine on 2010-08-29 00:45:08
Thanks for the new version! Please consider releasing processor optimized versions for mod and mod2.
Title: Resampler plugin
Post by: kode54 on 2010-08-29 01:01:18
That really depends on the resampler library itself. I don't think many compilers will just automatically parallelize/vectorize the entire process and magically make things faster.
Title: Resampler plugin
Post by: Alex B on 2010-09-10 12:26:12
I just downloaded the v. 0.5.4.3.

I have a K10 (a Phenom II). Should I use K8 or Dual Core or should I try to run my own tests?

The packaging is now different. The mod package is separate and it does not contain optimized versions. Are the mod versions "MSVS generic" ? The v. 0.5.4.2 included SSE2 mods.
Title: Resampler plugin
Post by: lvqcl on 2010-09-10 15:55:34
I just downloaded the v. 0.5.4.3.

I have a K10 (a Phenom II). Should I use K8 or Dual Core or should I try to run my own tests?

"Core2" is for Intel Core2 Duo/Quad processors. So I suppose that you should use K8.

Anyway, the performance increase is very little (about 10% or even less), that's why
The packaging is now different. The mod package is separate and it does not contain optimized versions.


Are the mod versions "MSVS generic" ?

Yes.
Title: Resampler plugin
Post by: Alex B on 2010-09-10 16:14:07
Thanks.

I did a quick test. I converted 25 short wav tracks (~350 MB) from 44.1. to 48k. I ran the test set five times in a row with each different compile. The sample rate conversion settings were default. Foobar used all four CPU cores.

Here are the results:
Code: [Select]
Generic
Total encoding time: 0:22.578, 93.30x realtime
Total encoding time: 0:23.625, 89.17x realtime
Total encoding time: 0:22.140, 95.15x realtime
Total encoding time: 0:22.718, 92.73x realtime
Total encoding time: 0:22.844, 92.22x realtime

Atom
Total encoding time: 0:22.765, 92.54x realtime
Total encoding time: 0:23.594, 89.28x realtime
Total encoding time: 0:22.875, 92.09x realtime
Total encoding time: 0:23.656, 89.05x realtime
Total encoding time: 0:22.922, 91.90x realtime

Core 2
Total encoding time: 0:22.375, 94.15x realtime
Total encoding time: 0:22.813, 92.34x realtime
Total encoding time: 0:22.937, 91.84x realtime
Total encoding time: 0:22.719, 92.72x realtime
Total encoding time: 0:23.203, 90.79x realtime

K8
Total encoding time: 0:23.578, 89.34x realtime
Total encoding time: 0:24.218, 86.98x realtime
Total encoding time: 0:22.734, 92.66x realtime
Total encoding time: 0:22.657, 92.98x realtime
Total encoding time: 0:23.781, 88.58x realtime

Mod
Total encoding time: 0:24.125, 87.32x realtime
Total encoding time: 0:23.891, 88.17x realtime
Total encoding time: 0:24.141, 87.26x realtime
Total encoding time: 0:23.140, 91.04x realtime
Total encoding time: 0:22.734, 92.66x realtime
I can't make any conclusions. The results are too varied.
Title: Resampler plugin
Post by: lvqcl on 2010-09-10 17:15:37
You can use foo_benchmark (http://www.foobar2000.org/components/view/foo_benchmark) for tests. Just use 32-bit float WAV file as an input.

For 16-bit input files, foo_hdcd and foo_input_dts.dll will also be called. This will slightly decrease actual speed.
Title: Resampler plugin
Post by: kode54 on 2010-09-10 19:14:21
For 16-bit input files, foo_hdcd and foo_input_dts.dll will also be called. This will slightly decrease actual speed.

Only for the first 5 seconds or so worth of data, unless there's anything to decode. I suppose this still has a noticeable effect on benchmarks.
Title: Resampler plugin
Post by: lvqcl on 2010-09-10 19:31:11
wav "decoding" speed w/o foo_hdcd and foo_input_dts:
32-bit: 6000x realtime
16-bit: 10000x realtime

with both foo_hdcd and foo_input_dts:
32-bit: 6000x realtime
16-bit: 2800x realtime


Well, it seems that this difference (10000 vs. 2800) is negligible when resampling speed is only ~90x realtime.
Title: Resampler plugin
Post by: Steve Forte Rio on 2010-09-14 21:13:47
About new sse3 test version...

Core i3 530 @ 2.94 GHz

foobar2000 1.1 Decoding Speed Test (source: 16 bit 44.1 kHz PCM, 5 passes, buffer entire file into memory, high priority, DSP: SoX 48000 Hz Very High, 95% bandpass, linear phase)

Generic 0.5.4.3 version:

Quote
Total length: 34:51.733
Info Read time: 0:00.000
Opening time: 0:00.102
Decoding time: 0:34.626
60.409x realtime


0.5.4.3 Core 2 version:

Quote
Total length: 34:51.733
Info Read time: 0:00.000
Opening time: 0:00.052
Decoding time: 0:30.648
68.251x realtime


SSE3 test version:

Quote
Total length: 34:51.733
Info Read time: 0:00.000
Opening time: 0:00.118
Decoding time: 0:23.868
87.638x realtime


Title: Resampler plugin
Post by: lvqcl on 2010-09-14 21:36:28
Thanks for testing.
Title: Resampler plugin
Post by: jaro1 on 2010-10-05 11:10:35
The version 0.5.4.3 was for all types of processor (atom, core2, K8) SSE2 version, so there are also other processor specific optimizations there, right?
Will there also be  procesor specific version with SSE3 instructions enabled? Version 0.5.5, which is SSE3, is common for all procesor types. (but maybe i am completely false). Difference between v. 0.5.4.3 (K8) - definitelly faster as generic - and 0.5.5 is negligible on Athlon 64.
Thanks to lvqcl for further improvements of his component.
Title: Resampler plugin
Post by: lvqcl on 2010-10-08 17:49:41
http://www.hydrogenaudio.org/forums/index....st&p=722827 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=67373&view=findpost&p=722827)
Title: Resampler plugin
Post by: bry909 on 2010-10-14 19:53:43
I maybe being an idiot - it has been known - but I can't configure the SoX component in the 'Convert...' dialogue box in f2k v1.1
I can use the component in real time and I must say I'm really impressed with the quality from 24b96k to 16b44k... really impressed.

I'm running f2k v1.1 on win7 Pro (x64), could this be a reason I can't configure the component.


Cheers
Title: Resampler plugin
Post by: lvqcl on 2010-10-14 20:24:16
What happens when you press "Configure selected" button?
Title: Resampler plugin
Post by: bry909 on 2010-10-14 20:34:19
What happens when you press "Configure selected" button?

Guess what, It was me being an idiot. A little further digging around led to me realising I need to use the 'DSP Chain Preset'.
I successfully converted a file from 96KHz to 44.1KHz. The bit depth didn't change however from 24bit to 16bit. Is that because I used 'Very High' setting?

BTW... the 'configured selected' button is always greyed out.
Title: Resampler plugin
Post by: lvqcl on 2010-10-14 20:59:03
Quote
The bit depth didn't change however from 24bit to 16bit. Is that because I used 'Very High' setting?

No. Click on Output format link in main converter window and set output bit depth to 16.


Quote
BTW... the 'configured selected' button is always greyed out.

Select "SoX Resampler" entry in Active DSPs list and this button should be enabled.
Title: Resampler plugin
Post by: bry909 on 2010-10-14 21:05:19
Sorry, it still stays greyed out. I've used the DSP chain option and it worked like a treat that way though.


Great stuff, thanks for getting SoX onto windows.
Title: Resampler plugin
Post by: thierryj on 2010-12-03 19:46:26
Thank you for your resampler, it has increased the quality but it also adds a small "click" at the beginning.

Configuration : Foobar 1.1.1 with resampler 0.5.5 mod (target resample rate: 176400)
Pc with Intel i5 , USB output in KS with Hiface and V-DAC

Can you do something ?

Thanks in advance
Title: Resampler plugin
Post by: lvqcl on 2010-12-15 16:24:44
Cannot reproduce the issue. Does the 'click' exist with PPHS or other resamplers?
Title: Resampler plugin
Post by: thierryj on 2010-12-20 18:16:56
Cannot reproduce the issue. Does the 'click' exist with PPHS or other resamplers?

Yes, but I also noticed recently that the same exists with any DSP plugin. This is probably due to the way Foobar manages the plugins in my particular configuration with the Hiface in Kernel Streaming but I am not expert enough to draw any conclusion. Could be also Hiface's fault.

Have you tried also with a Hiface ?
Title: Resampler plugin
Post by: thuan on 2010-12-21 02:46:54
Not everyone has a Hiface, try switching back to DirectSound to see if you still have that particular problem. Also are you using the new VST bridge?
Title: Resampler plugin
Post by: Surfi on 2011-01-26 16:15:49
::

Which one should I use (0.5.4.4 or 0.5.5) for INTEL SSE2 Pentium 4 non-HyperThreading processor?


Greetings ...

::
Title: Resampler plugin
Post by: lvqcl on 2011-01-26 17:19:59
0.5.5 requires SSE3 so you don't have choice
Title: Resampler plugin
Post by: Surfi on 2011-01-26 17:28:03
::

So the bold should be "requires".

Thanks a lot!   

::
Title: Resampler plugin
Post by: KurtHeather on 2011-01-27 17:15:20
So the new foobar2000 resampler should work fine on AMD Athlon PCs ?

Does it clash with any version of Windows?
Title: Resampler plugin
Post by: lvqcl on 2011-01-28 19:24:10
0.5.4.4 works on any CPU, 0.5.5 requires SSE3 (so it works on almost all modern CPUs).

And of course it doesn't have any particular OS requirements.
Title: Resampler plugin
Post by: bison on 2011-01-29 22:38:59
Thank you for this great sounding plugin!

In this thread, one slight drawback was pointed out, it's that it seems to attenuate the bass response a bit: http://www.head-fi.org/forum/thread/467853...r-sox-resampler (http://www.head-fi.org/forum/thread/467853/foobar-sox-resampler)

Any thoughts on that matter please? Because I tend to agree.
Title: Resampler plugin
Post by: lvqcl on 2011-01-29 23:15:03
Wow, what a thread! 

Quote
PROS:
-Slightly smoother treble, and definitely less grainy
-Clearer low-level details and easier to hear ambience of the recording
-Larger soundstage (because of the above point)
-Blacker background
-Better dynamics

CONS:
-Slightly less bass

Quote
the better focus, clearer vocals, deeper soundstage, better imaging, ambience details retrieval and a sense of "faster" sound and musical flow. but i noticed the sound significantly lost on the weight, cello and violins immediately struck me as too thin sounding and unnatural.


Well, for 44.1 => 96kHz upsampling  the frequency response of SoX resampler is almost flat for 0...20.5 kHz (default settings). So it doesn't attenuate low frequencies.


BTW, version 0.5.6 is out.
Title: Resampler plugin
Post by: bison on 2011-01-29 23:23:22
Thanks for the swift reply! Yes, I know that sounds weird, but I'd dare saying that the deep bass appears to be less percussive. I've tried it on some old school hip hop, and the TR808 kick drums seem less percussive indeed. But that was with 0.55, I'll try again tomorrow with fresh ears using 0.56.
Title: Resampler plugin
Post by: Alex B on 2011-01-30 10:13:25
Fresh ears may or may not help. Unless you are doing a blind test you may hear differences that do not exist. If you expect to hear a difference your brain can fabricate it. You must perform a blind test to avoid that. This has been nicely demonstrated in Ethan Winer's "Audio Myths Workshop" video from the 2009 AES conference: http://www.youtube.com/watch?v=BYTlN6wjcvQ (http://www.youtube.com/watch?v=BYTlN6wjcvQ)

The audio device may produce a different frequency response when its HW is set to a different sample rate, but usually these differences are not big enough to be audible. However, to completely eliminate the possible effect of the HW working differently with different sample rates you can prepare and compare audio samples that have the same final sample rate.

For instance, if you are resampling from 44.1 to 96 KHz, a good test would be to resample a 44.1 KHz audio sample to 96 KHz once and compare it with a sample that has been resampled three times: 44.1 -> 96 -> 44.1 -> 96 KHz. If resampling causes an audible difference, the difference should more pronounced in the latter sample. You can include a resampler in the DSP options when you convert files with foobar.

Create the two resampled audio files. Compare them with foobar's ABX comparator (http://www.foobar2000.org/components/view/foo_abx). If you can detect a difference in a blind ABX test post the test log here and a short clip of the original unresampled audio file (max. 30 s) to the uploads forum.
Title: Resampler plugin
Post by: bison on 2011-01-30 11:36:12
yeah, thanks for the instructions!

but tbh, the THD in the trebles is too high, and the low end bass sounds less percussive and dull. It still sounds much better than PPHS, this one sounds horrid.

I fully agree with the guys on head-fi, it's very nice for 1h then it gets odd. Upsampling doesn't come for free, never did, never will.
Title: Resampler plugin
Post by: Nowings69 on 2011-01-30 12:52:09
What is the difference of MOD2 and MOD1?

PPHS(ultra)
Speed (x realtime): 26.301

SSRC X
Speed (x realtime): 30.351

MOD 1
Speed (x realtime): 67.376

MOD 2
Speed (x realtime): 366.118






Title: Resampler plugin
Post by: lvqcl on 2011-01-30 13:06:24
That's because mod2 didn't resample anything.

http://www.hydrogenaudio.org/forums/index....st&p=716362 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=67376&view=findpost&p=716362)
Title: Resampler plugin
Post by: Nowings69 on 2011-01-30 13:18:11
That's because mod2 didn't resample anything.

http://www.hydrogenaudio.org/forums/index....st&p=716362 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=67376&view=findpost&p=716362)


Woo,I got it. Thanks

5 passes
mod 1
Speed (x realtime): 69.673

mod 2
Speed (x realtime): 71.649

Title: Resampler plugin
Post by: Alex B on 2011-01-30 13:29:56
yeah, thanks for the instructions!

but tbh, the THD in the trebles is too high, and the low end bass sounds less percussive and dull. It still sounds much better than PPHS, this one sounds horrid.

I fully agree with the guys on head-fi, it's very nice for 1h then it gets odd. Upsampling doesn't come for free, never did, never will.

Please watch the video in my link and try the ABX test.

In my experience the mentioned resamplers do not audibly alter the audio quality when they resample from one sample rate to a higher sample rate. A while ago I measured some upsampled test files. With the default settings SoX produced a lot less ringing and other artifacts than PPHS at about 20 kHz, but even the distortion that PPHS produced was likely to be completely inaudible because of the very high frequency. PPHS has been designed to be fine for playback purposes. If you can prove otherwise, please post your ABX logs and test samples.

I just did a quick test. I compared two "Sox" samples. The first one was upsampled once from 44.1 to 96 kHz (using the 24-bit output mode to avoid any increased noise floor) and the second sample was upsampled four times: 44.1 -> 48 -> 64 -> 88.2 -> 96 kHz (all 24-bit).

I couldn't hear any difference in an ABX test. I also measured the difference signal of these two files with Adobe Audition. Its maximum amplitude was -129 dB below 0 dBFS at about the 19.5 - 21.5 kHz frequency range. I.e. much below anything that can be audible. The lower frequencies were even quieter. I can upload the samples if anyone wants to try them.

In general, upsampling is useful only in certain cases when a particular hardware device does not perform well (or not at all) at a certain sample rate.

(Of course you may have other good reasons to resample than audio quality. You may have a receiver that supports only certain sample rates, you may want to mix various audio streams that are of different sample rates, etc.)
Title: Resampler plugin
Post by: lvqcl on 2011-02-05 12:10:38
Version 0.6.0 was released.
Title: Resampler plugin
Post by: RonnieBr on 2011-02-11 16:55:20
Hi lvcql,

Thanks for all your work on this plugin. 

My media PC is connected to a Meridian audio processor and I currently use your plugin to upsample all my lossless CD rips to 88.2kHz in the hope that minimizes the effects of any jitter in the SPDIF connection between my soundcard and the processor.

Meridian and some other high-end companies like Ayre claim that their new upsampling "apodizing" filters can help sound quality by minimizing pre-echo.  Unfortunately, my older Meridian processor doesn't implement these new upsampling filters.

Someone on the Meridian forums has been trying to reproduce a filter which has an impulse response like the Meridian filter using a SOX plugin for their squeezebox server, see: http://www.meridianunplugged.com/ubbthread...5273#Post125273 (http://www.meridianunplugged.com/ubbthreads/ubbthreads.php?ubb=showflat&Number=125273#Post125273)

Unfortunately, the SOX filter which has an impulse response which looks closest to the Meridian one has a passband parameter of 87.5% which is lower than the GUI for your plugin allows.  From reading the thread on the Meridian forums it looks like setting a low passband on these filters helps shape how fast the post-echo tails off.

Is there any possibility you could extend the minimum allowed passband in your plugin down to 85% so that I could try some of the low passband combinations mentioned in the link?

Thanks.

-Ronnie
Title: Resampler plugin
Post by: WarZard-X on 2011-02-11 18:03:27
Thank you for this great sounding plugin!

In this thread, one slight drawback was pointed out, it's that it seems to attenuate the bass response a bit: http://www.head-fi.org/forum/thread/467853...r-sox-resampler (http://www.head-fi.org/forum/thread/467853/foobar-sox-resampler)

Any thoughts on that matter please? Because I tend to agree.

When I switched to Sox, I noticed the same. Somehow a slightly weaker bass and mids were more prominent.
It's the Phase response. It has to do with pre-echo/post-echo, that changes the sound of the audio. (Sorry, my english is to bad to explain this in detail.)
With Phase response to 25% (intermediate), I've got my usual sound back. Nice bass and highs. You may try some Phase response values between 10% - 40%. Maybe it sounds better on your system.

Sox manual:
A phase response setting may be used to control the distribution
of  any  transient  echo  between ‘pre’ and ‘post’: with minimum
phase, there is no pre-echo but the longest post-echo; with lin-
ear  phase,  pre  and  post echo are in equal amounts (in signal
terms, but not audibility terms); the intermediate phase setting
attempts to find the best compromise by selecting a small length
(and level) of pre-echo and a medium lengthed post-echo.
Title: Resampler plugin
Post by: lvqcl on 2011-02-11 19:25:51
Is there any possibility you could extend the minimum allowed passband in your plugin down to 85% so that I could try some of the low passband combinations mentioned in the link?


Well, if you think it's useful...

http://www.hydrogenaudio.org/forums/index....st&p=732180 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=67373&view=findpost&p=732180)
Title: Resampler plugin
Post by: RonnieBr on 2011-02-11 19:43:06
Well, if you think it's useful...

http://www.hydrogenaudio.org/forums/index....st&p=732180 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=67373&view=findpost&p=732180)


Thanks lvqcl - that's what I call fast work 

It will be interesting to try out what VirusKiller on the Meridian forum has been trying on the squeezebox.

I'll post to the Meridian forum and let them know there's a new version.

Thanks again.

-Ronnie
Title: Resampler plugin
Post by: WarZard-X on 2011-02-14 12:51:50
Is there a reason to update to version 0.6.0? Changelog? Version 0.5.4.4 works perfect on my System.
Title: Resampler plugin
Post by: lvqcl on 2011-02-14 16:13:08
Changelog is in the post #2 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=67373&view=findpost&p=601510) in the upload thread.

0.5.6 (and 0.6.0) are noticeably faster, at least on Intel Core 2 and Core i.
Title: Resampler plugin
Post by: jaro1 on 2011-02-14 16:34:14
Quote
Well, if you think it's useful...

http://www.hydrogenaudio.org/forums/index....st&p=732180 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=67373&view=findpost&p=732180)


I thought 99% passband is a limit for sox resampling algorithm, it could reach without aliasing. Now it seems its possible to go even higher... 
Title: Resampler plugin
Post by: lvqcl on 2011-02-14 17:13:08
From sox.pdf:
Quote
The −b option allows the band-width to be set to any value in the range
74−99.7 %, but note that band-width values greater than 99% are not recommended for normal use
as they can cause excessive transient echo
Title: Resampler plugin
Post by: jaro1 on 2011-02-14 20:58:20
Thanks for explanation. So you can add that 0.2% yet..
Title: Resampler plugin
Post by: Wombat on 2011-02-14 21:48:35
Meridian and some other high-end companies like Ayre claim that their new upsampling "apodizing" filters can help sound quality by minimizing pre-echo.  Unfortunately, my older Meridian processor doesn't implement these new upsampling filters.

Someone on the Meridian forums has been trying to reproduce a filter which has an impulse response like the Meridian filter using a SOX plugin for their squeezebox server, see: http://www.meridianunplugged.com/ubbthread...5273#Post125273 (http://www.meridianunplugged.com/ubbthreads/ubbthreads.php?ubb=showflat&Number=125273#Post125273)

Unfortunately, the SOX filter which has an impulse response which looks closest to the Meridian one has a passband parameter of 87.5% which is lower than the GUI for your plugin allows.  From reading the thread on the Meridian forums it looks like setting a low passband on these filters helps shape how fast the post-echo tails off.


All over the net i see that funny graphs of pre and post echo. Can anyone help me interpreting these? As i interprete these graphs the post and pre echo that these pics show consist of frequencies "above the cutoff" that is applied. So they are out of the audible range. I wonder why people hear all kinds of problems with noise that happens above there at a very low amplitude. To get rid of that people use low-pass filters that come in way deeper in frequency and therefore may alter the sound much more as the original echo. Am i wrong? Of cause from a marketing point pre-echo is evil and can be easily shown with a simple graph. I wonder how many % of the people looking at these pics realize the shown echo is happening above their hearing.
Title: Resampler plugin
Post by: Dandruff on 2011-02-14 23:33:58
Is is right that the normal version does resampling even if input = output samplerate? I need to use the "mod" version, correct? Shouldn't this get "fixed" in SoX then?

Btw: What's the bitdepth of all the DSPs in foobar2000? 64bit float?
Title: Resampler plugin
Post by: lvqcl on 2011-02-15 16:20:29
Is is right that the normal version does resampling even if input = output samplerate? I need to use the "mod" version, correct?

Of course, it doesn't. So you don't need mod version.

Btw: What's the bitdepth of all the DSPs in foobar2000? 64bit float?

Input and output data are 32-bit float.
Title: Resampler plugin
Post by: Dandruff on 2011-02-15 16:28:59
Of course, it doesn't. So you don't need mod version.


Alright, thanks! This wasn't 100% clear to me.


Input and output data are 32-bit float.


Ok, thanks! Could swear I've read about 64bit float processing somewhere ...
Title: Resampler plugin
Post by: Dandruff on 2011-02-15 17:10:29
Where does the mod version store its configuration data?

The normal version stores it in "foo_dsp_resampler.dll.cfg". But I can't find such a file for the Mod version!?



Why does the Mod version gives information about resampling in the Console but the normal version doesn't?
Title: Resampler plugin
Post by: lvqcl on 2011-02-15 17:41:04
Ok, thanks! Could swear I've read about 64bit float processing somewhere ...

That was true for foobar2000 0.8.x (and maybe older versions too)


Where does the mod version store its configuration data?

The normal version stores it in "foo_dsp_resampler.dll.cfg". But I can't find such a file for the Mod version!?

DSP settings are stored in DSP presets (in Core.cfg, I assume). 'Normal' version has also some player-wide settings and they are stored in foo_dsp_resampler.dll.cfg file.


Why does the Mod version gives information about resampling in the Console but the normal version doesn't?

Why not? 
Title: Resampler plugin
Post by: Dandruff on 2011-02-15 18:00:58
Ok, thanks! Could swear I've read about 64bit float processing somewhere ...

That was true for foobar2000 0.8.x (and maybe older versions too)

Why the downgrade?

Where does the mod version store its configuration data?

The normal version stores it in "foo_dsp_resampler.dll.cfg". But I can't find such a file for the Mod version!?

DSP settings are stored in DSP presets (in Core.cfg, I assume). 'Normal' version has also some player-wide settings and they are stored in foo_dsp_resampler.dll.cfg file.

I see.

Why does the Mod version gives information about resampling in the Console but the normal version doesn't?

Why not? 

Ok. Might make sense for those mod versions.
Title: Resampler plugin
Post by: lvqcl on 2011-02-15 18:20:41
Why the downgrade?

Well, you can ask Peter, author of foobar2000 

IMHO, 32bit is enough for a mere audioplayer.
Title: Resampler plugin
Post by: Dandruff on 2011-02-15 18:50:43
Weird (as most DAWs nowadays also went to 64bit float processing).
Title: Resampler plugin
Post by: jaro1 on 2011-02-17 17:24:15
lvqcl, i've some comments on you. I've discovered, you created a clone of srcDrop (rateDrop), which uses sox resampling instead of libsamplerate.
Thank you for this tool, i mean it was really great idea to pair simplicity gui with sox resampling. I haven't  found a special thread about it, therefore i ask here.

1. if there is also bitwidth change applied, does it use any kind of dithering/noise shaping? it doesn't seem so.
2. on this site http://leute.server.de/wilde/resample.html (http://leute.server.de/wilde/resample.html) there stays, sox used polyphase filtering as one of the three resamp. algorithms. Its quite old article, so it seems polyphase filtering was later excluded. If its true, why?
3. in the case of sox, does the -s option have any other function than only extend default band-width to 99%? I mean steepness of the filter and band-width could be two different things.
4. does sox rate use 64 or 32-bit float processing? (know fb2k has 32 float)
5. is rateDrop also cpu optimized as fb2k plugin?
I'm sorry if there is discussion already, that answers some questions, haven't found any, though there are some basics in rate.txt article. 

Wishlist for the next version(s):
to extend rateDrop settings to full sox rate effect possibilities, i mean mainly:
-b 74-99.7             
-p 0-100
adding dithering options from sox
Title: Resampler plugin
Post by: lvqcl on 2011-02-17 19:00:17
Honestly, rateDrop is just a byproduct of my development of foo_dsp_resampler. I don't have plans to develop it further.
a) SoX resampling algorithms use 64-bit floating point arithmetics.
b) Latest version of rateDrop uses SSE3 optimisation, if possible.

About SoX itself: I am not an author of it so my knowledge is limited.
a) Yes, -s is the same as -b 99.
b) From SoX changelog: "Improved `rate' resampling effect; resample, polyphase, & rabbit now deprecated." So it was removed in favor of 'rate' effect.
c) SoX converts its input to 32-bit integers anyway.
Title: Resampler plugin
Post by: jaro1 on 2011-02-17 21:32:11
Quote
I don't have plans to develop it further.

It's a pity.
Thanks for your comment.
Title: Resampler plugin
Post by: Dandruff on 2011-02-22 13:02:49
Why not calling the DLL foo_sox_resampler.dll instead of foo_dsp_resampler.dll ?
Title: Resampler plugin
Post by: anwaypasible on 2011-03-08 07:09:16
i have tried to download and use version 0.6.0 and 0.5.6
both versions gave foobar an error that said 'the dll is either the wrong format or corrupted'

does it have anything to do with the fact that the file is not the right format when downloaded?
the 0.6.0 version said it was a '0' file
the 0.5.6 version said it was a '6' file

i tried to add .dll to the end of the filename, but apparently it didnt work.

i have used a calibrated microphone to adjust my equalizer.. and then i used DRC to use the digital room correction to further flatten the frequency response.
but the DRC impulse filter is for 48khz
so i am trying to resample everything to 48khz to make things match.
Title: Resampler plugin
Post by: lvqcl on 2011-03-08 08:45:32
Try to add .zip extension to downloaded files and unpack them.
Title: Resampler plugin
Post by: IgorC on 2011-03-19 15:24:02
I need information to do sample rate conversion. 44.1 kHz -> 48 kHz.

I know that there is foobar plugin but I need it to be done with command line.
I download SOX from here http://sourceforge.net/projects/sox/files/sox/14.3.1/ (http://sourceforge.net/projects/sox/files/sox/14.3.1/)

Highest quality is needed no matter what speed is.
I'm not sure if these are right parameters
Code: [Select]
sox Castanets.wav -b 16 resampled.wav rate -v 48000 dither -s


1.  Is dither must be here in (44.1 kHz ,16 bits) -> (48 kHz ,16 bits) conversion?
2.  What does  -b 16 do exaclty?
3.  -v stands for VHQ (Very High Quality) but do I use it correctly in mentioned command line?
Title: Resampler plugin
Post by: lvqcl on 2011-03-19 18:30:32
1. Probably yes. Note that -s also means noise-shaping: quantization noise will be shifted to high frequencies (>16 kHz)
2. Number of bits in the output file. Redundant, if castanets.wav is also 16-bit.
3. Yes.
Title: Resampler plugin
Post by: IgorC on 2011-03-19 18:46:24
Thank you
Title: Resampler plugin
Post by: Richard_Hsi on 2011-03-21 18:20:33
Thanks for update and sharing
Title: Resampler plugin
Post by: Sandrine on 2011-04-03 00:55:21
Re: Latest version
What are the implications of "single precision" vs. "double precision" in terms of quality and horsepower?
Title: Resampler plugin
Post by: lvqcl on 2011-04-03 01:36:47
It is possible to simultaneously load/add/multiply/store 2 double-precision numbers or 4 single-precision numbers. The quality is lower but IMHO it's still good enough.
Title: Resampler plugin
Post by: holyrevenger on 2011-04-13 14:23:57
Aw
Crash heavily with the newest release 0.6.8
Report has been sent by clicking the button "Send Report".
Now go back to ver 0.6.0 which works fine.
Title: Resampler plugin
Post by: Nowings69 on 2011-04-14 06:32:44
mod please
I cant play 96k as Vinyl
But I hear faster and better this version 0.6.8

How do you think adjusting for 48k 24bit?


Title: Resampler plugin
Post by: Dandruff on 2011-04-14 08:08:58
Aw
Crash heavily with the newest release 0.6.8
Report has been sent by clicking the button "Send Report".
Now go back to ver 0.6.0 which works fine.


Here 0.6.8 seems to work fine (Windows XP SP3, Intel Core 2 Duo E6700).
Title: Resampler plugin
Post by: lvqcl on 2011-04-14 15:07:10
The latest crash report that I can see in online database is for resampler 0.5.5, date = 2011-02-28.

holyrevenger, can you post the crash log here?
Title: Resampler plugin
Post by: krazzyk on 2011-04-14 15:55:47
It is possible to simultaneously load/add/multiply/store 2 double-precision numbers or 4 single-precision numbers. The quality is lower but IMHO it's still good enough.


Hello ! Thanks for great foobar plugin . I just would like to turn you attention on that fact that foobar is preffered player for those for whom the quality of signal is of most importance ! Even on my 5 year old computer (Core2duo E6400) resampling uses only 1-2% CPU power . So in my eyes any degradation of quality for perfomance optimization is not desirable . It's only my private opinion , so i hope you understand it right . 
Title: Resampler plugin
Post by: holyrevenger on 2011-04-15 13:38:41
The latest crash report that I can see in online database is for resampler 0.5.5, date = 2011-02-28.

holyrevenger, can you post the crash log here?
Code: [Select]
Illegal operation:
Code: C0000005h, flags: 00000000h, address: 036F1AEAh
Access violation, operation: read, address: 00000000h

Call path:
playback_process entry=>dsp/run=>dsp_manager::run=>dsp::run

Code bytes (036F1AEAh):
036F1AAAh:  05 B8 8C A4 71 03 50 E8 DA CA 00 00 83 C4 04 3B
036F1ABAh:  7E 10 75 0B B0 01 5F 5E 5B 8B E5 5D C2 08 00 8B
036F1ACAh:  44 24 0C 50 57 E8 BC FD FF FF 8B 7C 24 14 8B 4E
036F1ADAh:  28 8B 03 01 7E 2C 8D 54 24 18 52 8D 54 24 20 52
036F1AEAh:  8B 10 68 00 10 00 00 57 51 8B 4C 24 24 51 50 FF
036F1AFAh:  D2 83 C4 1C 85 C0 0F 85 38 01 00 00 8B 5C 24 18
036F1B0Ah:  8B 56 34 01 5E 30 39 56 2C 76 17 8B 4E 24 8B 46
036F1B1Ah:  30 3B C1 76 0D 29 56 2C 2B C1 89 46 30 39 56 2C

Stack (0809EC88h):
0809EC68h:  00000000 00000004 FFFFFD34 000002E4
0809EC78h:  FFFFFD34 000002CC 00000018 00000000
0809EC88h:  0809ECAC 0809ECA8 6D6527ED 044EDD68
0809EC98h:  05A16F88 00000002 05D8F9E8 0000002F
0809ECA8h:  0809ECBC 7591BBE4 01FA0000 00000000
0809ECB8h:  01FA0000 05ABD030 013C13C7 0809ED00
0809ECC8h:  036F2095 05A16F88 01F74C04 FD951D4C
0809ECD8h:  6D6527ED 044EDD68 0809ED94 00000000
0809ECE8h:  044EDD6C 00000000 044EDD74 0809ED28
0809ECF8h:  03715970 00000001 0809ED34 013C72DD
0809ED08h:  01F74EF0 01F74E80 00000000 01F74C04
0809ED18h:  05ABD130 05ABD130 00000031 044EDD68
0809ED28h:  0809EDC8 013DBB9A 00000002 0809EDD4
0809ED38h:  013C78D3 05ABD130 01F74EF0 01F74E80
0809ED48h:  00000000 01F74C04 01F74EC4 01F74E80
0809ED58h:  01F74EF0 773A2CE8 05AF2C58 00000001
0809ED68h:  05AF4978 52EEE681 43786ADE 0C48B1B1
0809ED78h:  1430FFA9 0809EE2C 05AF4978 0809ED98
0809ED88h:  00000000 00000000 00000000 00000000
0809ED98h:  00000000 0109001F 03000300 0000001F

Registers:
EAX: 00000000, EBX: 044EDDA8, ECX: 04FA6548, EDX: 0809ECAC
ESI: 044EDD68, EDI: 0000002F, EBP: 0809ECC4, ESP: 0809EC88

Crash location:
Module: foo_dsp_resampler
Offset: 1AEAh

Loaded modules:
foobar2000   loaded at 01290000h - 01482000h
ntdll loaded at 77350000h - 7748C000h
kernel32 loaded at 758D0000h - 759A4000h
KERNELBASE   loaded at 757A0000h - 757EA000h
COMCTL32 loaded at 74440000h - 745DE000h
msvcrt   loaded at 76B80000h - 76C2C000h
GDI32 loaded at 76C30000h - 76C7E000h
USER32   loaded at 75B00000h - 75BC9000h
LPK   loaded at 77490000h - 7749A000h
USP10 loaded at 76F10000h - 76FAD000h
SHLWAPI   loaded at 75A00000h - 75A57000h
DSOUND   loaded at 6E640000h - 6E6B2000h
ADVAPI32 loaded at 75A60000h - 75B00000h
sechost   loaded at 759B0000h - 759C9000h
RPCRT4   loaded at 75810000h - 758B1000h
ole32 loaded at 75BD0000h - 75D2C000h
WINMM loaded at 738C0000h - 738F2000h
POWRPROF loaded at 73CE0000h - 73D05000h
SETUPAPI loaded at 77090000h - 7722D000h
CFGMGR32 loaded at 75570000h - 75597000h
OLEAUT32 loaded at 77000000h - 7708F000h
DEVOBJ   loaded at 75780000h - 75792000h
UxTheme   loaded at 74280000h - 742C0000h
SHELL32   loaded at 75ED0000h - 76B1A000h
zlib1 loaded at 5A4C0000h - 5A4D4000h
shared   loaded at 6D650000h - 6D67B000h
imagehlp loaded at 759D0000h - 759FA000h
dbghelp   loaded at 6A340000h - 6A42B000h
COMDLG32 loaded at 774C0000h - 7753B000h
Secur32   loaded at 753E0000h - 753E8000h
SSPICLI   loaded at 75400000h - 7541B000h
CRYPT32   loaded at 755A0000h - 756BD000h
MSASN1   loaded at 75560000h - 7556C000h
gdiplus   loaded at 740F0000h - 74280000h
IMM32 loaded at 757F0000h - 7580F000h
MSCTF loaded at 76E40000h - 76F0C000h
MacType   loaded at 10000000h - 1009F000h
EasyHK32 loaded at 00260000h - 0027B000h
PSAPI loaded at 774A0000h - 774A5000h
CRYPTBASE loaded at 75470000h - 7547C000h
CLBCatQ   loaded at 75E40000h - 75EC3000h
MMDevApi loaded at 73F80000h - 73FB9000h
PROPSYS   loaded at 742F0000h - 743E5000h
dwmapi   loaded at 73F60000h - 73F73000h
foo_out_wasapi   loaded at 011F0000h - 01216000h
foo_input_std loaded at 68160000h - 682B0000h
foo_input_monkey loaded at 01240000h - 01289000h
foo_fileops   loaded at 6D740000h - 6D787000h
foo_midi loaded at 03380000h - 0351D000h
BASS loaded at 11000000h - 11063000h
MSACM32   loaded at 73E00000h - 73E14000h
BASSMIDI loaded at 10600000h - 10611000h
WS2_32   loaded at 77540000h - 77575000h
NSI   loaded at 774B0000h - 774B6000h
foo_audioscrobbler   loaded at 018B0000h - 018E3000h
foo_dsp_std   loaded at 6A0D0000h - 6A118000h
foo_input_tta loaded at 019B0000h - 019F2000h
foo_chacon   loaded at 6D2A0000h - 6D2C4000h
foo_uie_wsh_panel_mod loaded at 68C40000h - 68D02000h
Msimg32   loaded at 73990000h - 73995000h
foo_uie_lyrics2   loaded at 03BF0000h - 03CDE000h
WININET   loaded at 77230000h - 7734A000h
Normaliz loaded at 758C0000h - 758C3000h
iertutil loaded at 76C80000h - 76E36000h
urlmon   loaded at 75D30000h - 75E40000h
foo_discogs   loaded at 68BD0000h - 68C31000h
foo_converter loaded at 68630000h - 686AB000h
foo_uie_elplaylist   loaded at 680E0000h - 68153000h
foo_input_tak loaded at 68B80000h - 68BC4000h
tak_deco_lib loaded at 01A20000h - 01A40000h
foo_exvar loaded at 01BB0000h - 01BD8000h
foo_unpack   loaded at 6D1A0000h - 6D1CE000h
foo_albumlist loaded at 66720000h - 6677D000h
foo_uie_biography loaded at 66210000h - 66268000h
foo_ui_std   loaded at 660F0000h - 66208000h
foo_musicbrainz   loaded at 66090000h - 660EC000h
WINHTTP   loaded at 710F0000h - 71148000h
webio loaded at 710A0000h - 710EF000h
foo_out_asio loaded at 01C20000h - 01C56000h
foo_uie_albumlist loaded at 01DC0000h - 01E03000h
foo_rgscan   loaded at 684E0000h - 6852D000h
foo_ui_columns   loaded at 046D0000h - 04860000h
foo_freedb2   loaded at 6A1D0000h - 6A210000h
foo_playcount loaded at 6A130000h - 6A16C000h
foo_uie_vis_channel_spectrum loaded at 02950000h - 0298D000h
foo_uie_panel_splitter   loaded at 02C00000h - 02C59000h
foo_cuesheet_creator loaded at 02990000h - 029BC000h
foo_uie_lyricist loaded at 04AB0000h - 04BB9000h
WSOCK32   loaded at 6DA40000h - 6DA47000h
foo_lyricsgrabber2   loaded at 65FD0000h - 6608C000h
WLDAP32   loaded at 76FB0000h - 76FF5000h
python25 loaded at 1E000000h - 1E208000h
MSVCR71   loaded at 7C340000h - 7C396000h
foo_dsp_soundtouch   loaded at 02C80000h - 02CA6000h
foo_dsp_resampler loaded at 036F0000h - 037B5000h
foo_cdda loaded at 666D0000h - 6671E000h
WindowsCodecs loaded at 73E30000h - 73F2B000h
apphelp   loaded at 75420000h - 7546C000h
EhStorShell   loaded at 6FBF0000h - 6FC21000h
cscui loaded at 6F6F0000h - 6F75A000h
CSCDLL   loaded at 704C0000h - 704C9000h
CSCAPI   loaded at 700C0000h - 700CB000h
ntshrui   loaded at 6F680000h - 6F6F0000h
srvcli   loaded at 75370000h - 75389000h
slc   loaded at 735F0000h - 735FA000h
SXS   loaded at 75480000h - 754DF000h
ddraw loaded at 65EE0000h - 65FC7000h
DCIMAN32 loaded at 6D640000h - 6D646000h
atiumdag loaded at 6F760000h - 6FB65000h
atiumdva loaded at 6EE00000h - 6F2A4000h
jscript   loaded at 65420000h - 654D2000h
VERSION   loaded at 749B0000h - 749B9000h
CRYPTSP   loaded at 74FA0000h - 74FB6000h
rsaenh   loaded at 74D10000h - 74D4B000h
RpcRtRemote   loaded at 754E0000h - 754EE000h
wshom loaded at 69D90000h - 69DB1000h
MPR   loaded at 700D0000h - 700E2000h
ScrRun   loaded at 6AAE0000h - 6AB0A000h
_socket   loaded at 05240000h - 0524D000h
sud   loaded at 65360000h - 6541B000h
ADVPACK   loaded at 63550000h - 6357E000h
DUI70 loaded at 74030000h - 740E2000h
explorerframe loaded at 6FC70000h - 6FDDF000h
DUser loaded at 74000000h - 7402F000h
avrt loaded at 73CD0000h - 73CD7000h
kxasio   loaded at 6D430000h - 6D445000h
kxapi loaded at 6E6C0000h - 6E721000h
MFC42 loaded at 6E7D0000h - 6E8EC000h
ODBC32   loaded at 6E730000h - 6E7BC000h
kxgui loaded at 6E590000h - 6E5E3000h
odbcint   loaded at 6E550000h - 6E588000h
WINTRUST loaded at 756C0000h - 756ED000h
ksuser   loaded at 73900000h - 73904000h
mswsock   loaded at 74F30000h - 74F6C000h
wshtcpip loaded at 74A40000h - 74A45000h

Stack dump analysis:
Address: 6D6527EDh (shared+27EDh), symbol: "uCallStackTracker::uCallStackTracker" (+0h)
Address: 7591BBE4h (kernel32+4BBE4h), symbol: "HeapFree" (+14h)
Address: 013C13C7h (foobar2000+1313C7h)
Address: 036F2095h (foo_dsp_resampler+2095h)
Address: 6D6527EDh (shared+27EDh), symbol: "uCallStackTracker::uCallStackTracker" (+0h)
Address: 03715970h (foo_dsp_resampler+25970h), symbol: "foobar2000_get_interface" (+17530h)
Address: 013C72DDh (foobar2000+1372DDh)
Address: 013DBB9Ah (foobar2000+14BB9Ah)
Address: 013C78D3h (foobar2000+1378D3h)
Address: 773A2CE8h (ntdll+52CE8h), symbol: "RtlFreeHeap" (+7Eh)
Address: 013E0932h (foobar2000+150932h)
Address: 0132D64Ch (foobar2000+9D64Ch)
Address: 014012A0h (foobar2000+1712A0h)
Address: 013E13B9h (foobar2000+1513B9h)
Address: 0132D194h (foobar2000+9D194h)
Address: 01402FDCh (foobar2000+172FDCh)
Address: 014090F8h (foobar2000+1790F8h)
Address: 013E4622h (foobar2000+154622h)
Address: 0132FB1Eh (foobar2000+9FB1Eh)
Address: 75B137D8h (USER32+137D8h), symbol: "MsgWaitForMultipleObjects" (+0h)
Address: 7591BCCCh (kernel32+4BCCCh), symbol: "SetEvent" (+0h)
Address: 774272E0h (ntdll+D72E0h), symbol: "NlsAnsiCodePage" (+190h)
Address: 774272E0h (ntdll+D72E0h), symbol: "NlsAnsiCodePage" (+190h)
Address: 774272E0h (ntdll+D72E0h), symbol: "NlsAnsiCodePage" (+190h)
Address: 66708A1Ch (foo_cdda+38A1Ch), symbol: "foobar2000_get_interface" (+22CBCh)
Address: 774272E0h (ntdll+D72E0h), symbol: "NlsAnsiCodePage" (+190h)
Address: 02C988CCh (foo_dsp_soundtouch+188CCh), symbol: "foobar2000_get_interface" (+1508Ch)
Address: 774272E0h (ntdll+D72E0h), symbol: "NlsAnsiCodePage" (+190h)
Address: 02C988CCh (foo_dsp_soundtouch+188CCh), symbol: "foobar2000_get_interface" (+1508Ch)
Address: 018D0000h (foo_audioscrobbler+20000h), symbol: "foobar2000_get_interface" (+13230h)
Address: 757BE165h (KERNELBASE+1E165h), symbol: "OutputDebugStringA" (+100h)
Address: 757A877Fh (KERNELBASE+877Fh), symbol: "GetModuleHandleW" (+64h)
Address: 757A6BF3h (KERNELBASE+6BF3h), symbol: "TlsSetValue" (+7Fh)
Address: 757A86E1h (KERNELBASE+86E1h), symbol: "CompareStringA" (+2B0h)
Address: 04AB0000h (foo_uie_lyricist+0h)
Address: 758D0000h (kernel32+0h)
Address: 7736E0EDh (ntdll+1E0EDh), symbol: "RtlAddMandatoryAce" (+330h)
Address: 773A8D8Bh (ntdll+58D8Bh), symbol: "LdrGetDllHandleEx" (+272h)
Address: 7736E0EDh (ntdll+1E0EDh), symbol: "RtlAddMandatoryAce" (+330h)
Address: 773A8D8Bh (ntdll+58D8Bh), symbol: "LdrGetDllHandleEx" (+272h)
Address: 773A8B10h (ntdll+58B10h), symbol: "LdrGetDllHandle" (+18h)
Address: 757A876Ch (KERNELBASE+876Ch), symbol: "GetModuleHandleW" (+51h)
Address: 757A877Fh (KERNELBASE+877Fh), symbol: "GetModuleHandleW" (+64h)
Address: 757A876Ch (KERNELBASE+876Ch), symbol: "GetModuleHandleW" (+51h)
Address: 758D0000h (kernel32+0h)
Address: 757BE165h (KERNELBASE+1E165h), symbol: "OutputDebugStringA" (+100h)
Address: 757A877Fh (KERNELBASE+877Fh), symbol: "GetModuleHandleW" (+64h)
Address: 757A6BF3h (KERNELBASE+6BF3h), symbol: "TlsSetValue" (+7Fh)
Address: 757A86E1h (KERNELBASE+86E1h), symbol: "CompareStringA" (+2B0h)
Address: 01410700h (foobar2000+180700h)
Address: 77350000h (ntdll+0h)
Address: 773AF879h (ntdll+5F879h), symbol: "RtlImageDirectoryEntryToData" (+23Bh)
Address: 773500D0h (ntdll+D0h)
Address: 7736E0EDh (ntdll+1E0EDh), symbol: "RtlAddMandatoryAce" (+330h)
Address: 77350000h (ntdll+0h)
Address: 77350000h (ntdll+0h)
Address: 773500D0h (ntdll+D0h)
Address: 7736E0EDh (ntdll+1E0EDh), symbol: "RtlAddMandatoryAce" (+330h)
Address: 773AF879h (ntdll+5F879h), symbol: "RtlImageDirectoryEntryToData" (+23Bh)
Address: 773AF99Ah (ntdll+5F99Ah), symbol: "LdrGetProcedureAddressEx" (+119h)
Address: 773AFA22h (ntdll+5FA22h), symbol: "LdrGetProcedureAddressEx" (+1A1h)
Address: 773A70F2h (ntdll+570F2h), symbol: "RtlRunOnceBeginInitialize" (+103h)
Address: 773AF9E8h (ntdll+5F9E8h), symbol: "LdrGetProcedureAddressEx" (+167h)
Address: 77350000h (ntdll+0h)
Address: 773A70F2h (ntdll+570F2h), symbol: "RtlRunOnceBeginInitialize" (+103h)
Address: 773ACD10h (ntdll+5CD10h), symbol: "RtlDecodePointer" (+0h)
Address: 74520000h (COMCTL32+E0000h), symbol: "ShowHideMenuCtl" (+57Ch)
Address: 773ACD10h (ntdll+5CD10h), symbol: "RtlDecodePointer" (+0h)
Address: 74520000h (COMCTL32+E0000h), symbol: "ShowHideMenuCtl" (+57Ch)
Address: 74007265h (DUser+7265h), symbol: "SetGadgetRootInfo" (+230h)
Address: 7736E0EDh (ntdll+1E0EDh), symbol: "RtlAddMandatoryAce" (+330h)
Address: 7736E0EDh (ntdll+1E0EDh), symbol: "RtlAddMandatoryAce" (+330h)
Address: 773AF9E8h (ntdll+5F9E8h), symbol: "LdrGetProcedureAddressEx" (+167h)
Address: 773B002Dh (ntdll+6002Dh), symbol: "RtlGetActiveActivationContext" (+174h)
Address: 77350000h (ntdll+0h)
Address: 773AF879h (ntdll+5F879h), symbol: "RtlImageDirectoryEntryToData" (+23Bh)
Address: 758D0000h (kernel32+0h)
Address: 758D00F0h (kernel32+F0h)
Address: 7736E0EDh (ntdll+1E0EDh), symbol: "RtlAddMandatoryAce" (+330h)
Address: 7598EF5Bh (kernel32+BEF5Bh), symbol: "DecodePointer" (+6h)
Address: 758D0000h (kernel32+0h)
Address: 758D0000h (kernel32+0h)
Address: 7598EF55h (kernel32+BEF55h), symbol: "DecodePointer" (+0h)
Address: 7736E0EDh (ntdll+1E0EDh), symbol: "RtlAddMandatoryAce" (+330h)
Address: 773AF879h (ntdll+5F879h), symbol: "RtlImageDirectoryEntryToData" (+23Bh)
Address: 773AF99Ah (ntdll+5F99Ah), symbol: "LdrGetProcedureAddressEx" (+119h)
Address: 01410700h (foobar2000+180700h)
Address: 01410700h (foobar2000+180700h)
Address: 77396A04h (ntdll+46A04h), symbol: "NtWaitForMultipleObjects" (+Ch)
Address: 757A69DCh (KERNELBASE+69DCh), symbol: "InterlockedCompareExchange" (+BCh)
Address: 73CD0000h (avrt+0h)
Address: 773A5AE0h (ntdll+55AE0h), symbol: "wcsnicmp" (+1E4h)
Address: 01407C0Ch (foobar2000+177C0Ch)
Address: 013EAB54h (foobar2000+15AB54h)
Address: 0132EC85h (foobar2000+9EC85h)
Address: 75B137D8h (USER32+137D8h), symbol: "MsgWaitForMultipleObjects" (+0h)
Address: 7591BCCCh (kernel32+4BCCCh), symbol: "SetEvent" (+0h)
Address: 75B137F7h (USER32+137F7h), symbol: "MsgWaitForMultipleObjects" (+1Fh)
Address: 013EAB70h (foobar2000+15AB70h)
Address: 0132EC23h (foobar2000+9EC23h)
Address: 6D65281Eh (shared+281Eh), symbol: "uCallStackTracker::uCallStackTracker" (+31h)
Address: 013EAB85h (foobar2000+15AB85h)
Address: 0132EB67h (foobar2000+9EB67h)
Address: 013E13D9h (foobar2000+1513D9h)
Address: 75923C45h (kernel32+53C45h), symbol: "BaseThreadInitThunk" (+12h)
Address: 773B37F5h (ntdll+637F5h), symbol: "RtlInitializeExceptionChain" (+EFh)
Address: 7592ED38h (kernel32+5ED38h), symbol: "UnhandledExceptionFilter" (+0h)
Address: 7592ED38h (kernel32+5ED38h), symbol: "UnhandledExceptionFilter" (+0h)
Address: 7736E0EDh (ntdll+1E0EDh), symbol: "RtlAddMandatoryAce" (+330h)
Address: 773B37C8h (ntdll+637C8h), symbol: "RtlInitializeExceptionChain" (+C2h)
Address: 0132EB30h (foobar2000+9EB30h)
Address: 0132EB30h (foobar2000+9EB30h)

Environment:
App: foobar2000 v1.1.5
OS: Windows 6.1.7601 Service Pack 1 x86
CPU: Intel® Pentium® 4 CPU 2.40GHz, features: MMX SSE SSE2
Audio: Wave Out 4/5 (for system) (kX 10k2 Audio (3550) - Generic); Wave Out 2/3 (for fb2k) (kX 10k2 Audio (3550) - Generic); Master Mixer (kX 10k2 Audio (3550) - Generic); Wave Out HQ (kX 10k2 Audio (3550) - Generic); SPDIF/AC3 Output (kX 10k2 Audio (3550) - Generic); Wave Out 6/7 (for video) (kX 10k2 Audio (3550) - Generic)
UI: Columns UI 0.3.8.8

Components:
Core (2011-02-27 19:44:04 UTC)
foobar2000 core 1.1.5
foo_albumlist.dll (2011-02-27 19:42:12 UTC)
Album List 4.5
foo_audioscrobbler.dll (2010-06-04 01:27:04 UTC)
Audioscrobbler 1.4.7
foo_cdda.dll (2011-02-27 19:42:04 UTC)
CD Audio Decoder 3.0
foo_chacon.dll (2010-04-06 18:03:40 UTC)
Chacon 3
foo_converter.dll (2011-02-27 19:41:48 UTC)
Converter 1.5
foo_cuesheet_creator.dll (2010-10-12 06:02:16 UTC)
Cuesheet Creator 0.4.6
foo_discogs.dll (2010-07-20 01:43:27 UTC)
Discogs Tagger 1.25
foo_dsp_resampler.dll (2011-04-12 14:19:14 UTC)
SoX Resampler 0.6.8
foo_dsp_soundtouch.dll (2011-03-08 10:47:39 UTC)
SoundTouch DSP 1.1
foo_dsp_std.dll (2011-02-27 19:42:22 UTC)
Standard DSP Array 1.0
foo_exvar.dll (2010-07-31 11:01:32 UTC)
Extended Variables 0.3.1
foo_fileops.dll (2011-02-27 19:40:50 UTC)
File Operations 2.1.3
foo_freedb2.dll (2011-02-27 19:40:56 UTC)
freedb Tagger 0.6.3
foo_input_monkey.dll (2011-02-24 15:06:56 UTC)
Monkey's Audio Decoder 2.1.5
foo_input_std.dll (2011-02-27 19:41:24 UTC)
Standard Input Array 1.0
foo_input_tak.dll (2010-01-09 11:11:58 UTC)
TAK Decoder 0.4.4
foo_input_tta.dll (2010-10-27 04:50:20 UTC)
TTA Audio Decoder 3.2
foo_lyricsgrabber2.dll (2011-04-09 05:37:09 UTC)
Lyrics Grabber 2 0.5.5.2 beta
foo_midi.dll (2011-04-01 14:21:48 UTC)
MIDI synthesizer host 1.133
foo_musicbrainz.dll (2011-01-31 13:10:44 UTC)
MusicBrainz Tagger 0.2
foo_out_asio.dll (2010-08-09 13:04:58 UTC)
ASIO support 1.2.7
foo_out_wasapi.dll (2009-05-19 14:45:18 UTC)
WASAPI output support 2.1
foo_playcount.dll (2010-10-13 12:33:15 UTC)
Playback Statistics 3.0.1
foo_rgscan.dll (2011-02-27 19:41:56 UTC)
ReplayGain Scanner 2.0.9
foo_ui_columns.dll (2011-02-28 01:42:32 UTC)
Columns UI 0.3.8.8
foo_ui_std.dll (2011-02-27 19:42:12 UTC)
Default User Interface 0.9.5
foo_uie_albumlist.dll (2009-06-13 22:49:19 UTC)
Album list panel 0.3.5
foo_uie_biography.dll (2010-12-11 00:47:22 UTC)
Biography View 0.4.2.4
foo_uie_elplaylist.dll (2010-10-30 13:51:16 UTC)
ELPlaylist 0.6.9.1.2(beta)
foo_uie_lyricist.dll (2011-03-23 02:35:18 UTC)
乐辞 foobar2000 歌词插件 1.41
foo_uie_lyrics2.dll (2010-04-12 12:19:24 UTC)
Lyric Show Panel 2 0.4.6.15
foo_uie_panel_splitter.dll (2009-12-09 16:16:12 UTC)
Panel Stack Splitter 0.3.8.3(alpha)
foo_uie_vis_channel_spectrum.dll (2008-05-17 19:02:12 UTC)
Channel Spectrum panel 0.17.2
foo_uie_wsh_panel_mod.dll (2011-03-21 05:09:12 UTC)
WSH Panel Mod 1.4.3
foo_unpack.dll (2011-02-27 19:41:36 UTC)
ZIP/GZIP/RAR Reader 1.6

Recent events:
WSH Panel Mod ({7094D13C-B465-4B0C-A544-CFAD26689E2A}): initialized in 20 ms
WSH Panel Mod ({8C1A9CA8-84CA-4E6A-87DF-30D9F870621D}): initialized in 4 ms
WSH Panel Mod ({EEC0C287-C563-4BA7-831D-49B86BACBB74}): initialized in 23 ms
Album list panel: initialised in 0.163 s
WSH Panel Mod ({E170FE40-FF4D-4647-92B2-4102E1552CC3}): initialized in 34 ms
Autoplaylists initialized in: 0:00.019063
"#Collection <A>" : 0:00.018993
Startup time : 0:03.439791
Opening track for playback: "O:\Music\Nightwish [2007] [2CD] Dark Passion Play [Limited Edition] [EAC-MP3]\CD1\03.Nightwish - Amaranth.mp3"
Error: Externals not initialized
And here (http://storage.live.com/items/9D22F639F544F46F!181?filename=failure_00000006.dmp) the dmp file is.
Title: Resampler plugin
Post by: lvqcl on 2011-04-15 16:33:08
It was a silly error because of copy-paste... 

0.6.9 is out.
Title: Resampler plugin
Post by: 000811zhf on 2011-04-16 04:00:04
hello lvqcl! how can i down load your  foo_dsp_resampler_0.6.9.zip .when i down load it expand it with winara,display a error.
Title: Resampler plugin
Post by: holyrevenger on 2011-04-16 07:48:53
It was a silly error because of copy-paste... 

0.6.9 is out.

Many thanks!

BTW, where is the changelog? I can't find it in both discussion & upload thread.
Title: Resampler plugin
Post by: lvqcl on 2011-04-16 09:08:13
You mean this (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=67373&view=findpost&p=601510)?
Title: Resampler plugin
Post by: holyrevenger on 2011-04-16 10:03:11
You mean this (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=67373&view=findpost&p=601510)?

Yep. 
Title: Resampler plugin
Post by: AFAIK on 2011-04-17 00:36:19
Hi
I find 'modified' version quite useful 

I hope those additional functions could be merged into normal version

like adding a 'advanced settings' button, and put those settings in there

thanks!
Title: Resampler plugin
Post by: thierryj on 2011-04-17 12:15:18
I find 'modified' version quite useful

Same for me !

Will you issue modified versions also for Rev 0.69 ?

Thanks
Title: Resampler plugin
Post by: franky0182 on 2011-04-27 14:46:00
Hi , lvqcl, nice work, it's the best resampler i ever used.

Here i want to report a bug. On 0.6.8 version, i found upsample x4 did not work and the box display some strange code. Also this problem occurred on 0.6.9 . I have  to back to 0.6.0 and it works well.

Thank you,
Title: Resampler plugin
Post by: franky0182 on 2011-04-27 14:49:13
Hi , lvqcl, nice work, it's the best resampler i ever used.

Here i want to report a bug. On 0.6.8 version, i found upsample x4 did not work and the box display some strange code. Also this problem occurred on 0.6.9 . I have to back to 0.6.0 and it works well.

Thank you,
Title: Resampler plugin
Post by: lvqcl on 2011-04-27 16:13:25
Thanks, fixed.
Title: Resampler plugin
Post by: infinitor on 2011-04-29 21:08:06
Read the topic, got a few questions lingering.  I used this to for downsampling files to 44100Hz for sharing with friends and it worked out great.

Does it have any other uses?  Is there any reason to upsample 44100 -->96000 besides to decrease cpu used on sound?  I have a midpriced external soundcard, it won't hurt anything to have sox on, eh, may help decrease cpu usage?

Thanks
Title: Resampler plugin
Post by: infinitor on 2011-04-29 23:50:18
Read the topic, got a few questions lingering.  I used this to for downsampling files to 44100Hz for sharing with friends and it worked out great.

Does it have any other uses?  Is there any reason to upsample 44100 -->96000 besides to decrease cpu used on sound?  I have a midpriced external soundcard, it won't hurt anything to have sox on, eh, may help decrease cpu usage?

Thanks


Nevermind, I don't think i need this at all.
Title: Resampler plugin
Post by: Quad on 2011-05-07 14:21:35
Would it be possible to add an option for dithering/no dithering? From SoX 14.3.0 onwards dithering is enabled by default. But when resampling at the same bit depth dithering is not necessary.

I use this plugin mainly to downsample 192k to 96k as my system is limited to 96k. In this case dithering should be turned off.

Thanks a lot for your efforts. This is the best resampling plugin ever!

EDIT: Oh, I've just seen that your plugin uses SoX 14.20 routines. Does this mean that dithering is not applied automatically?
Title: Resampler plugin
Post by: lvqcl on 2011-05-07 14:32:40
The plugin doesn't dither. It receives 32-bit float samples and sends 32-bit float samples back to foobar2000 core.
Title: Resampler plugin
Post by: Quad on 2011-05-07 14:34:23
The plugin doesn't dither. It receives 32-bit float samples and sends 32-bit float samples back to foobar2000 core.


Thanks for the immediate clarification!
Title: Resampler plugin
Post by: bmark on 2011-06-19 14:06:00
Sorry for asking a really dumb question but I am not very familiar with Foobar or the Sox plugin. I want to downsample 96000 24-bit to 44100 16-bit, using Foobar's convert function and the Sox plugin installed. When I click on convert and try to configure SoX I can set the sample rate to 44100, but I cannot see any way of setting the bit-length. Whatever I do the end-result is always a 44100 file with 24-bit which my Sonos streamer refuses to play. What am I doing wrong?
Title: Resampler plugin
Post by: xnor on 2011-06-19 15:03:32
This is a resampler (= sample rate conversion) plugin. Check the options for the output plugin you're using to adjust the bit-depth used to output to your sound card / DAC.
Title: Resampler plugin
Post by: ACX on 2011-07-30 13:20:26
Hello lvqcl, thank you very much for this great plugin, I use it everyday in my liquid music system.
Do you plan to release a modified version for 0.7.0 too? I'd like to do a selective resample as in 0.6.0.

Ciao

Andrea
Title: Resampler plugin
Post by: lvqcl on 2011-07-30 16:54:40
Since there's no difference between 0.6.0 'Very high' and 0.7.0 'Best' and most people use this resampler in 'Very high' mode, I don't think there is much point in doing this.
Title: Resampler plugin
Post by: ACX on 2011-07-31 12:57:34
Since there's no difference between 0.6.0 'Very high' and 0.7.0 'Best' and most people use this resampler in 'Very high' mode, I don't think there is much point in doing this.

Thank you for your quick reply. The only thing it matters to me is the quality, so if there's no difference between between 0.6.0 'Very high' (the one I use) and 0.7.0 'Best' I don't need to upgrade.
I'm happy for having discovered the mod version, I was missing the possibility to do selective resampling.

Ciao

Andrea
Title: Resampler plugin
Post by: RastaMan on 2011-08-08 07:09:10
RE: Sox 0.7.0 settings for 24bit resampling

I'm trying to figure out how to set up the SoX/foobar2000 plugin for resampling 96/24 audio to 44/24 audio. For 16bit audio, these are my settings:

Quality: Normal
Passband: 95%
Allow Aliasing: Yes
Phase Response: 50% Linear
Dithering: Yes
Output: 16bit


Now for 24bit, obviously, the output has to be changed, dithering has to be shut off, and Quality should be left at the default (Good) or upgraded to the highst setting (Best). The question is whether the Passband , Allow Aliasing and Phase Response setting should be tweaked, or left alone. Any suggestions?
Title: Resampler plugin
Post by: RastaMan on 2011-08-16 09:14:16
Anybody?
Title: Resampler plugin
Post by: lvqcl on 2011-08-31 17:31:23
Version 0.7.5 was released. See post #13 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=67373&view=findpost&p=732180).
Title: Resampler plugin
Post by: DaNei on 2011-09-18 18:04:42
Any chance releasing further mod version?
Title: Resampler plugin
Post by: lvqcl on 2011-09-18 18:27:43
Probably when that expreimental code will be released officially.
Title: Resampler plugin
Post by: .halverhahn on 2011-09-18 22:17:01
Any chance releasing further mod version?


What's wrong with v0.6.0?
Title: Resampler plugin
Post by: nesquikstyle on 2011-09-30 15:48:51
problem reporting :

I had used foobar in year 2004~2005....now I am returning back to the field of pc-fi ing.

anyways, I recently installed Foobar v 1.1.8 (the newest version)

and also tried to install the SOX resampler - foo_dsp_resampler v 0.7.0 , 0.7.5, 0.6.0 .




I have found out that none of these versions work on my foobar....when I open up the *.zip files that are uploaded on http://www.hydrogenaudio.org/forums/index....7373&hl=sox (http://www.hydrogenaudio.org/forums/index.php?showtopic=67373&hl=sox)

I end up with files named "foo_dsp_resampler_0.7.0" .  with no *.dll extension.

Of course Foobar won't recognize it as a plugin......So I manually added the ".dll " extension, but Foobar now shows message that it had "Failed to Load foo_dsp_resampler....Unsupported File format or corrupted files."


So I tried the 0.6.0 version. Same.

So I tried the 0.7.5 version. Now the file included in the *.zip file is named "Noname" with no extension. Of course, doesn't work.


I became really frustrated, so I tried uninstalling everything and installed Foobar v 1.1.7. Still no luck.


So I ended up trying 0.6.0 Mod version. Finally, it WORKS!!


I am currently using a DELL laptop with Microsoft Windows 7 Professional 64bit.

I am really curious why I wasn't able to use the recent 0.7.0 or 0.7.5 versions and had to end up with 0.6.0 modded version....

Any ideas?

Title: Resampler plugin
Post by: marc2003 on 2011-09-30 15:59:44
component installation has changed quite a bit - no need to even open those zip files...

http://wiki.hydrogenaudio.org/index.php?ti...all_a_component (http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:How_to_install_a_component)
Title: Resampler plugin
Post by: lvqcl on 2011-09-30 16:05:07
Quote
I end up with files named "foo_dsp_resampler_0.7.0" . with no *.dll extension.

Of course Foobar won't recognize it as a plugin......So I manually added the ".dll " extension


Try to add ".zip" extension to the file, not ".dll". Or use some other program to download files.
Title: Resampler plugin
Post by: lvqcl on 2011-11-03 16:40:20
Any chance releasing further mod version?

Ver. 0.7.6 (experimental) was released, and *_mod versions were updated too.
Title: Resampler plugin
Post by: bertdw on 2011-11-23 18:14:00
Hello, and thank you for all your hard work on this plugin.  I've been using r8brain to resample hi-res files for my Squeezebox Duet, which only supports a maximum of 48kHz.  I'm anxious to hear the improvement!

I hope you won't mind a couple of questions.  My Cambridge Audio DacMagic has selectable filters, including minimum phase and linear phase.  Do you think one or the other would be better, depending on the phase response setting I use in the resampler?  For example, if I select the minimum phase setting in the resampler, should I also select the minimum phase setting on my DAC?  Or would it be better to mix the two, resampling with the minimum phase setting and playing back with the linear phase setting on my DAC?  Or vice versa?

I do plan to try several combinations and listen, but I wondered if there was a theoretical "best" combination of encoding and decoding filters.

Thank you very much for your time,

Bert Dwyer
Title: Resampler plugin
Post by: Dandruff on 2011-11-24 15:06:46
Ver. 0.7.6 (experimental) was released


What are the changes from 0.7.0?
Title: Resampler plugin
Post by: lvqcl on 2011-11-24 16:08:55
Info about 0.7.6 was added to the changelog (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=67373&view=findpost&p=601510), thanks for the reporting
Title: Resampler plugin
Post by: Dandruff on 2011-11-24 16:23:12
Thanks!
Title: Resampler plugin
Post by: kumbbl on 2012-02-06 15:12:58
RE: Sox 0.7.0 settings for 24bit resampling

I'm trying to figure out how to set up the SoX/foobar2000 plugin for resampling 96/24 audio to 44/24 audio. For 16bit audio, these are my settings:

Quality: Normal
Passband: 95%
Allow Aliasing: Yes
Phase Response: 50% Linear
Dithering: Yes
Output: 16bit


Now for 24bit, obviously, the output has to be changed, dithering has to be shut off, and Quality should be left at the default (Good) or upgraded to the highst setting (Best). The question is whether the Passband , Allow Aliasing and Phase Response setting should be tweaked, or left alone. Any suggestions?


One question which always confuses me:

What is the dependency between Allow aliasing (in the SoX-DSP-dialog window) and Dither (in the Output-panel of the foobar-converter dialog)? Is aliasing the same as dither?

or with a more precise question: what are the best settings for downsampling from a 24 bit sorce to a 16 bit target concerning these two settings?

a) Allow aliasing = yes and Dither (in the output-panel of foobar converter) = yes
b) Allow aliasing = yes and Dither (in the output-panel of foobar converter) = no
c) Allow aliasing = no and Dither (in the output-panel of foobar converter) = yes
d) Allow aliasing = no and Dither (in the output-panel of foobar converter) = no

Thanks a lot for your help!

BTW: great plugin - many thanks to the developer!
Title: Resampler plugin
Post by: xnor on 2012-02-06 15:19:11
What is the dependency between Allow aliasing (in the SoX-DSP-dialog window) and Dither (in the Output-panel of the foobar-converter dialog)? Is aliasing the same as dither?

No, dither is used with quantization, i.e. 24 bit to 16 bit changes. Since 24 bit numbers don't fit in 16 bit there will be quantization errors. Dither adds noise to randomize those errors. Additional shaping may be used to shape that noise in such a way to make it less audible.

This is a resampler plugin and therefore changes the sample rate, not the resolution/bits per sample. Aliasing occurs if you change the sample rate and don't filter out all the stuff above half of the sampling rate.

There's no dependency between the two. If you just convert from 24 bit to 16 bit you don't need a resampler at all.
Title: Resampler plugin
Post by: kumbbl on 2012-02-06 16:31:24
What is the dependency between Allow aliasing (in the SoX-DSP-dialog window) and Dither (in the Output-panel of the foobar-converter dialog)? Is aliasing the same as dither?

No, dither is used with quantization, i.e. 24 bit to 16 bit changes. Since 24 bit numbers don't fit in 16 bit there will be quantization errors. Dither adds noise to randomize those errors. Additional shaping may be used to shape that noise in such a way to make it less audible.

This is a resampler plugin and therefore changes the sample rate, not the resolution/bits per sample. Aliasing occurs if you change the sample rate and don't filter out all the stuff above half of the sampling rate.

There's no dependency between the two. If you just convert from 24 bit to 16 bit you don't need a resampler at all.


this was misunderstandable... i meant resampling from 24/96 to 16/44.1 for example...

so which settings would recommend for such a scenario?

Thanks!
Title: Resampler plugin
Post by: lvqcl on 2012-02-06 16:46:04
An example of 96 -> 44 resampling (from http://src.infinitewave.ca/ (http://src.infinitewave.ca/) )

Without aliasing:
(http://src.infinitewave.ca/images/Sweep/Audiomove.png)

With aliasing:
(http://src.infinitewave.ca/images/Sweep/Audition15_NPF.png)


It's a matter of taste IMHO.

OTOH, dithering should be enabled.
Title: Resampler plugin
Post by: kumbbl on 2012-02-06 18:20:42
sorry for maybe dump questions: what is the sonic difference between these two pictures?
for me the aliasing looks strange but maybe there are some advantages for my ears??

Title: Resampler plugin
Post by: xnor on 2012-02-06 18:26:16
Unless you can hear above 20 kHz there shouldn't be any difference. With aliasing the filter is not as steep -> less ringing, but since the ringing is above 20 kHz it shouldn't be audible.

I'm saying "shouldn't" because everyone should do an ABX test to see if there really is no audible difference.
Title: Resampler plugin
Post by: kumbbl on 2012-02-07 10:28:44
An example of 96 -> 44 resampling (from http://src.infinitewave.ca/ (http://src.infinitewave.ca/) )

Without aliasing:
(http://src.infinitewave.ca/images/Sweep/Audiomove.png)


what are these very dark blue curves in the first picture?
Title: Resampler plugin
Post by: xnor on 2012-02-07 11:50:28
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 (http://www.youtube.com/watch?v=Z_G6n2DO_2U) to demonstrate the difference without vs. with aliasing
Title: Resampler plugin
Post by: lvqcl on 2012-02-07 14:34:45
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)
Title: Resampler plugin
Post by: SoNic67 on 2012-03-02 03:54:57
Is this (http://www.hydrogenaudio.org/forums/index.php?showtopic=67373) the latest version?
Title: Resampler plugin
Post by: Alex90 on 2012-04-04 09:29:57
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,
Title: Resampler plugin
Post by: db1989 on 2012-04-04 09:41:09
You should never upsample anything unless your hardware absolutely requires it. Do you think it increases quality? It doesn’t.
Title: Resampler plugin
Post by: Alex90 on 2012-04-04 10:28:34
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.
Title: Resampler plugin
Post by: xnor on 2012-04-04 10:39:03
almost all the sound cards, DACs, even the external ones, do this.


I beg to differ.
Title: Resampler plugin
Post by: Alex90 on 2012-04-04 10:47:34
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?
Title: Resampler plugin
Post by: xnor on 2012-04-04 11:58:30
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.
Title: Resampler plugin
Post by: greynol on 2012-04-04 16:25:27
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.
Title: Resampler plugin
Post by: xnor on 2012-04-04 17:05:50
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.
Title: Resampler plugin
Post by: lvqcl on 2012-04-04 17:41:39
Are we talking about Windows XP kernel mixer or Vista/Win7 audio stack?
Title: Resampler plugin
Post by: xnor on 2012-04-04 18:04:56
Vista/Win7 except for the fixed 48 kHz part (= Win XP).
Title: Resampler plugin
Post by: greynol on 2012-04-04 18:13:40
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.
Title: Resampler plugin
Post by: lvqcl on 2012-04-04 18:15:48
Policy for Mixing Audio Streams and Setting the Output Sample Rate (http://msdn.microsoft.com/en-us/library/windows/hardware/ff537756(v=vs.85).aspx)
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.
Title: Resampler plugin
Post by: xnor on 2012-04-04 18:47:50
I am specifically talking about XP and edited my post to reflect this.

Oh.. sorry, ok.
Title: Resampler plugin
Post by: lvqcl on 2012-04-06 18:03:26
0.7.8 version.
Based on post-14.4.0 SoX code; updated algorithms => even faster performance.
Title: Resampler plugin
Post by: SoNic67 on 2012-04-07 06:05:57
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.
Title: Resampler plugin
Post by: kumbbl on 2012-04-07 08:06:08
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!
Title: Resampler plugin
Post by: lvqcl on 2012-04-07 08:35:21
No, these plugins won't do anything if output samplerate is equal to the target samplerate. Built-in PPHS works in the same way.
Title: Resampler plugin
Post by: kumbbl on 2012-04-07 16:37:55
thanks for this clarification
Title: Resampler plugin
Post by: Dario on 2012-04-13 17:21:51
lvqcl,

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

And thank you for your magnificent work.
Title: Resampler plugin
Post by: lvqcl on 2012-04-13 17:30:52
Yes, that's correct.
Title: Resampler plugin
Post by: Sanc on 2012-04-25 04:24:34
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.
Title: Resampler plugin
Post by: lvqcl on 2012-04-25 15:30:44
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.

No, that's not true. http://wiki.hydrogenaudio.org/index.php?title=Dither (http://wiki.hydrogenaudio.org/index.php?title=Dither)
If output bit depth is 24 then dither is unnecessary.

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?


This plugin doesn't perform any dithering itself.
About aliasing (not "anti aliasing"): IMHO it doesn't matter at such frequencies.
Title: Resampler plugin
Post by: SoNic67 on 2012-04-29 01:35:51
I understand that "best" is "-v" SOX option. What are the others? Is the "-l" implemented?
I am looking at this graphs (44.1>96):

(http://sox.sourceforge.net/rate-44k1-96k.png)

Also, on SOX page it says:

SoX 14.2.0 High Quality: -b 90 -a

SoX 14.2.0 VHQ Linear Phase: -v -s

SoX 14.2.0 VHQ Intermediate Phase: -v -s -I

SoX 14.2.0 VHQ Minimum Phase: -v -s -M
Title: Resampler plugin
Post by: lvqcl on 2012-04-29 08:02:13
You can see the description of other modes in the changelog of ver. 0.6.6.
Low quality mode (-l) existed in in 0.6.0 but was removed in 0.6.0 (it isn't better than built-in PPHS anyway).
Title: Resampler plugin
Post by: outerspace on 2012-05-28 18:46:18
Original sound (tone from 20 kHz to 96 kHz, 16 bit 192 kHz): http://img543.imageshack.us/img543/8640/orig.png (http://img543.imageshack.us/img543/8640/orig.png)

foobar2000 + SoX (resample to 44.1 kHz) -> analog input (recorded at 24 bit 192 kHz): http://img688.imageshack.us/img688/448/sox.png (http://img688.imageshack.us/img688/448/sox.png)

Frequencies above 22.05 kHz is not filtered. How can it possible?
Title: Resampler plugin
Post by: outerspace on 2012-05-28 19:23:13
foobar2000 + SoX (resample to 44.1 kHz) -> driver digital record (recorded at 24 bit 192 kHz): http://img444.imageshack.us/img444/4872/soxonlydigital.png (http://img444.imageshack.us/img444/4872/soxonlydigital.png)

Sound file: http://www.multiupload.nl/EU93379O5P (http://www.multiupload.nl/EU93379O5P)
Title: Resampler plugin
Post by: lvqcl on 2012-05-28 19:43:13
It's either OS resampling or soundcard filter.
Title: Resampler plugin
Post by: bandpass on 2012-05-28 20:02:39
Original sound (tone from 20 kHz to 96 kHz, 16 bit 192 kHz): http://img543.imageshack.us/img543/8640/orig.png (http://img543.imageshack.us/img543/8640/orig.png)

foobar2000 + SoX (resample to 44.1 kHz) -> analog input (recorded at 24 bit 192 kHz): http://img688.imageshack.us/img688/448/sox.png (http://img688.imageshack.us/img688/448/sox.png)

Frequencies above 22.05 kHz is not filtered. How can it possible?

It's not possible. If it has frequency content above 22.05k, then it's not been resampled to 44.1k.

Inadequate filtering would lead to aliasing, i.e. unwanted frequency content below 22.05k, but that's not what your graphs show.
Title: Resampler plugin
Post by: ei4ia on 2012-06-09 07:47:12
sorry if dumb question, but here it is: if input signal equals output (96kHz/24bit in and out, default SoX settings) does plugin process signal or it just passes unaffected?
Thanks
Title: Resampler plugin
Post by: lvqcl on 2012-06-09 14:15:09
See posts #245-246.
Title: Resampler plugin
Post by: Fabulist on 2012-06-13 03:16:19
Hello everyone,

First of all, thank you for this plugin lvqcl, really appreciate it.

Secondly, I would like to ask you guys some questions that somebody may, hopefully, be willing to answer considering I am pretty ignorant on general sound matters:

Please take in mind that I use ASIO for playback on a 2.1 THX system, and my sample rate can go as high as 48000 for ASIO (after that, I have totally distorted output, or no sound at all).

1. PassBand defines what will be passed to the bass (frequencies), correct?

2. Aliasing and Phase Response are supposed to improve quality over distorted sound, correct?

3. So assuming I do not have distorted sound and everything sounds great, should I disable them to get the maximum benefit, or can someone explain to me in simple words what they really do and how I can benefit from them?

4. Plugin irrelevant question: Should the Tone/sweep sample rate comply with my main rate (e.g. re-sampled to 48 KHz -> Tone/Sweep 48 KHz)?

I have read the technical information sheets posted here and in Sox and used Google a lot, but I am having difficulties understanding them and finding information that I can comprehend.

If anyone can help me or give me some suggestions on the matters mentioned, it would be much appreciated. 

Thanks in advance guys!
Title: Resampler plugin
Post by: SoNic67 on 2012-06-17 02:09:33
1. PassBand defines what will be passed to the bass (frequencies), correct?

No. PassBand is the whole audio band. there is no subwoffer separation and your PC speaker system doesn't have a dedicated input for that anyway.
2. Aliasing and Phase Response are supposed to improve quality over distorted sound, correct?

Wrong again. There is nothing that you can do with "distorted sound". Those parameters are related strictly to quality of upsampling, leave them as they are.
3. So assuming I do not have distorted sound and everything sounds great, should I disable them to get the maximum benefit, or can someone explain to me in simple words what they really do and how I can benefit from them?

Again you are wrong, read above. Just leave those sliders are they are default, don't check the "Allow aliasing" either.
Title: Resampler plugin
Post by: Fabulist on 2012-06-17 07:38:44
Many thanks for replying to my questions - but a few more are born based on what you said:

So what should I put the PassBand at to get the best quality?

Also, what about Aliasing and Phase Response; default options are set for maximum quality and changing them will only worsen my output?

Is there a chance I get a simplified summary of what they are and how do they affect sound?

PS: Tone/sweep insight is welcome!
Title: Resampler plugin
Post by: lvqcl on 2012-06-17 09:33:34
There are two links in the first post of this thread: to SoX FAQ and to help file.
Title: Resampler plugin
Post by: Fabulist on 2012-06-19 02:26:14
There are two links in the first post of this thread: to SoX FAQ and to help file.


I read that but I am having difficulties understanding it 

Simplified answers to my questions are most welcome!
Title: Resampler plugin
Post by: ametrano on 2012-07-09 10:53:15
I plan to use the component to downsample in my 24/96 -> 16/44.1 conversion.

(http://dl.dropbox.com/u/13123534/foobarConversion.jpg)

Since in foobar's Converter Setup the "Output format" is before "Processing" I assume the downsampling is happing after the bit reduction.
Is it correct that the opposite would be better?
How can I accomplish that using foobar?
Is command line SOX the way to go?

thanks
Title: Resampler plugin
Post by: kumbbl on 2012-07-09 11:45:37
bit reduction is always performed last - after all other processings!
Title: Resampler plugin
Post by: lvqcl on 2012-07-09 15:14:24
First processing, then converting to FLAC.
Title: Resampler plugin
Post by: lvqcl on 2012-08-08 15:36:26
Resampling plugin 0.8.0 beta 2: http://www.hydrogenaudio.org/forums/index....st&p=804445 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=67373&view=findpost&p=804445)
Title: Resampler plugin
Post by: digicco on 2012-08-25 18:01:49
I have 384kHz/352.8kHz DAC.
Please add upsample x8 setting.

Thanks
Title: Resampler plugin
Post by: lvqcl on 2012-08-25 18:27:37
If you want to resample 44100 to 352800 Hz, just type this value in the "Target samplerate" input box.
Title: Resampler plugin
Post by: digicco on 2012-08-25 19:52:20
Resolved.
Great! Thank you so much 
Title: Resampler plugin
Post by: eamon123 on 2012-10-21 18:39:32
Sorry in advance for the longish string of questions, I'm copy&pasting them from another place I asked them and got *no answer* to any.

I'm using a FiiO E7 which only supports 41,000 or 48,000 Hz, because of USB limitations. What do you think of these settings for playback? The resampler is based on SoX code and WASAPI is supposed to bypass a lot of Windows's internal sound processing.
(http://puu.sh/1gYJf.png)
I'm allowing aliasing because it gives it an easier time with ringing artefacts and not much aliasing actually happens and that which does is mostly above the Nyquist Frequency so I won't hear it anyway. Should I enable dithering in WASAPI? How does dithering even work anyway? Does it only apply when upsampling, like in images? Also I see the passband is adjustable. I have no idea why? I set it to 96, not the maximum 99% because I figured it must do something good to lower it and I can sacrifice the top 500 Hz to get this good thing. I hope this doesn't just save CPU cycles or something. Phase response turns preringing into post ringing, right? I figure post ringing is more acceptable than preringing when listening so I'm going with this.
Title: Resampler plugin
Post by: lvqcl on 2012-10-21 19:24:47
1) this plugin doesn't perform any dithering
2) About passband: http://www.hydrogenaudio.org/forums/index....mp;#entry626176 (http://www.hydrogenaudio.org/forums/index.php?showtopic=67376&st=25&p=626176&#entry626176)
Quote
A resampler's band-width setting determines how much of the fre‐
              quency content of the original signal (w.r.t. the original  sam‐
              ple rate when up-sampling, or the new sample rate when down-sam‐
              pling) is preserved during conversion.  The term `pass-band'  is
              used  to  refer  to  all  frequencies up to the band-width point
              (e.g. for 44.1kHz sampling rate, and a resampling band-width  of
              95%,  the  pass-band  represents  frequencies from 0Hz (D.C.) to
              circa 21kHz).  Increasing the resampler's band-width results  in
              a  slower  conversion  and can increase transient echo artefacts
              (and vice versa).
Title: Resampler plugin
Post by: francesco on 2012-11-25 07:46:57
Uploaded here (http://www.hydrogenaudio.org/forums/index.php?showtopic=67373)

Good quality, fast resampler (~2 times faster than PPHS Ultra, although ~2.5 times slower than regular PPHS). Minimum / intermediate / linear phase.
Any comments?

Added: If you want to know what settings are best:
1. Read SoX FAQ (http://sox.sourceforge.net/Docs/FAQ), "What are the best 'rate' settings to resample a file and retain the highest quality?"
2. This post: http://www.hydrogenaudio.org/forums/index....st&p=626176 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=67376&view=findpost&p=626176) (an excerpt from SoX help)
3. Feel free to experiment and decide what's best for you.

hi
amazing
may i ask which is the lastest version for 1.1.17 for xp?
is this one (http://www.hydrogenaudio.org/forums/index.php?showtopic=67373&st=0&p=602914&#entry602914) ,isn't
thanks
Title: Resampler plugin
Post by: lvqcl on 2012-11-25 10:22:34
The latest is the latest: 0.8.1.
Title: Resampler plugin
Post by: francesco on 2012-11-25 11:21:29
The latest is the latest: 0.8.1.

thanks
really love your component
i open a question about export using resample before burning
here is guess it's off topic
Title: Resampler plugin
Post by: CT71 on 2012-12-02 01:04:43
Hi how's it goin'.  I've just installed Foobar2000 because I was looking to downsize 24bit to 16bit and this program was recommended to me. 

Heres what I've done:

Using foobar2000 and its built-in converter to resample:

- In foobar2000, make a new playlist (File->New Playlist)(CTRL+N)

- Drag and drop your audio files from Windows Explorer into the playlist.

- In the foobar2000 playlist, select all, then right-click and go to context menu item “Convert”

- In the Converter Setup window. . .
  go to “Processing” and choose the DSP named “Resampler (SoX)”, then click the “Configure selected” button.
  Click the “Back” button and configure the rest of your settings (“Output format”, “Destination”, “Other”).
  Click the “Convert” button.

- All Done !! …go to the destination folder and enjoy your 16-bit/44kHz resampled files


Everything seems fine until the very last step when I click "Convert".  From there it keeps bringing up the folder of where my Foobar is installed.  What am I doing wrong?  Thanks, Chris
Title: Resampler plugin
Post by: lvqcl on 2012-12-02 10:11:49
and what is the title of this window?
Title: Resampler plugin
Post by: derty2 on 2012-12-02 14:13:09
There is nothing wrong with those converter instructions, however if you are very new to foobar2000 you may need further elaboration.
Here is a more detailed walkthrough of a conversion:
 
 
- In your filesystem, browse to the directory containing the target 24-bit audio files to be converted.

        Let's say these 2 files are the targets:

        C:\my music\rock\them\(1965) the angry young them\(vinyl) mono. decca #lk 4700. gbr\06. gloria.flac
        C:\my music\rock\them\(1965) the angry young them\(vinyl) mono. decca #lk 4700. gbr\07. you just can't win.flac


- In foobar2000, make a new playlist (File->New Playlist)(CTRL+N)

- Drag and drop those two audio files from Windows Explorer into the playlist, select all, then right-click and go to context menu item “Convert”

- In the Converter Setup window, go to “Processing” and choose the DSP named “Resampler (SoX)”, then click the “Configure selected” button.
  Click the “Back” button and configure the rest of your settings (“Output format”, “Destination”, “Other”).

        Output format:------ 
        I assume you have no problems setting this

        Destination:------
        "Output Path":             You must set the output path, let's choose "Source track folder" (!!!!! is same directory as the target 24-bit audio files ...next two lines will tweak)
        "If file already exists":   Ask, Skip or Overwrite ...what should foobar2000 do if there is a collision?
        "Output style...":          Choose "Convert each track to an individual file" and put this in "Name format field":   resampled\$if2(%tracknumber%. ,%list_index%. )$if2($meta(title),%filename%)

        Other:------
        "When done":               Check "Show full status report"


   Click the “Convert” button.

- When conversion is finished, two windows will pop up: ("Converter Output" — a track listing) and ("Converter Status Report" — a message log)

- Select all the tracks in the "Converter Output" window and choose "Open containing folder", Windows Explorer will open with the converted tracks highlighted at the path you see here:

        C:\my music\rock\them\(1965) the angry young them\(vinyl) mono. decca #lk 4700. gbr\resampled\06. Gloria.flac
        C:\my music\rock\them\(1965) the angry young them\(vinyl) mono. decca #lk 4700. gbr\resampled\07. You Just Can't Win.flac


- Drag those new resampled files into the same playlist and have a listen, and check their Properties (Right Click->Properties)(ALT+ENTER)

- Done.

---------------------------

if you prefer not to create a subfolder named resampled then you could have used this in "Name format field":

        $if2(%tracknumber%. ,%list_index%. )$if2($meta(title),%filename%)_resampled

which would give you this:

        C:\my music\rock\them\(1965) the angry young them\(vinyl) mono. decca #lk 4700. gbr\06. Gloria_resampled.flac
        C:\my music\rock\them\(1965) the angry young them\(vinyl) mono. decca #lk 4700. gbr\07. You Just Can't Win_resampled.flac

 
 
Title: Resampler plugin
Post by: CT71 on 2012-12-02 19:01:23
Sheesh, I'm starting to feel like an idiot here.  Same thing, once I get to clicking on the convert button, again, it brings up a windows folder that reads "Please locate flac.exe".  It doesn't matter what folder I select from there - I can navigate to any folder from there, but when I get to say the last folder in the chain, for example....my music/steely dan/aja.....once i get to aja it shows nothing in that folder and it won't let me "open" anything from there.  The only thing I can do is hit the cancel button and then I'm back to the foobar convert page.  All my music folders are showing nothing in them.  In the last folder where there should be music, you have two choices...one that says "File name" which it shows nothing to seleect.....and "files of type" which there is only one thing to choose from, and that says "Command-line encoder.
Title: Resampler plugin
Post by: lvqcl on 2012-12-02 19:14:06
So you want to convert to FLAC and foobar2000 cannot find the encoder so it ask you about its location.

Download and install this: http://www.foobar2000.org/encoderpack (http://www.foobar2000.org/encoderpack)
Title: Resampler plugin
Post by: derty2 on 2012-12-02 21:02:48
   >>  from website - foobar2000 encoderpack:   "The binaries are conveniently installed into a subfolder of the foobar2000 installation folder..." *

If you are running foobar2000 in portable mode, you may run into a problem if you copy your whole foobar to some other location.

When setting up a new (custom) converter preset for FLAC, you are going to put the path to  flac.exe  into the "New Preset—Encoder:" field.

If you manually copy  flac.exe  to the root of the foobar2000 config folder**,  you can just type  flac.exe  in the "New Preset—Encoder:" field,  and your portable foobar still works.

If you copy  flac.exe  to a subfolder of the foobar2000 config folder**,  you can not just type  flac.exe  in the "New Preset—Encoder:" field,  and your portable foobar may become compromized.

------------------------------------------------------------------------------------------------------------------------
                                      - Some Test Results (running in portable mode) -


Create this:   <foobar2000_config_folder>\encoders\flac.exe

Try converting a track to FLAC using   encoders\flac.exe   in "New Preset—Encoder:" field     ...does not work (Error window pops up)

Try converting a track to FLAC using   .\encoders\flac.exe   in "New Preset—Encoder:" field     ...does not work (Error window pops up)

Create this:   <foobar2000_config_folder>\flac.exe

Try converting a track to FLAC using   flac.exe   in "New Preset—Encoder:" field     ...works



NOTE: this test gives the same results if you change  <foobar2000_config_folder>  to  <foobar2000_installation_folder>
------------------------------------------------------------------------------------------------------------------------

* foobar2000 installation folder == foobar2000 configuration folder    ...only if you are running in portable mode;  not the same if fb2k is "installed".
   If fb2k is installed ---->   installation folder is %programfiles%\foobar2000,   configuration folder is %appdata%\foobar2000

** how to find your foobar2000 configuration folder:    While in foobar2000,   Hold down 'SHIFT' key,   then choose 'File-->Browse configuration folder'
Title: Resampler plugin
Post by: Case on 2012-12-03 06:35:09
You are complicating things, derty2. You are not supposed to use any paths in encoder presets and everything will work fine. When paths are not specified foobar2000 can use encoder pack installed versions properly, as well as any binaries found from system's search path.
Title: Resampler plugin
Post by: CT71 on 2012-12-03 23:37:39
They would not install.  I'm getting this message "Could not load component "encoders": Unsupported format or corrupted file"
Does Derty have a point about me running portable?  Am I saving all my Foobar stuff into a wrong folder? 


Title: Resampler plugin
Post by: CT71 on 2012-12-03 23:42:53
Never mind, I didn't realize you didn't  actually have to install INTO Foobar.  I just tried a track, it did work.  Now to see how successful or if I set the preferences up correctly, lol.
Title: Resampler plugin
Post by: CT71 on 2012-12-03 23:54:13
Well damn, I think it worked, lol!  Just a couple quick questions for the completely clueless:

I read so much about dithering, I'm just wondering what I'm supposed to mess with in terms of all I want to do is down sample to 16 and have it sound the same.  Am I supposed to change the dither?  The output bid depth?  And under the "Convert each track to an individual file" name file Derty had me paste a bunch of mumbo jumbo that I'm really not sure how I would've known what the heck to put into that field.  So what I have in there now is also correct?

Thanks for the help!  I'm almost to the point now where I can actually start to try and configure Foobar, but this was the main thing I needed to see if it worked first........CT
Title: Resampler plugin
Post by: Case on 2012-12-05 09:47:53
You need to change the output bitdepth to 16 from the default Auto, or you'll end up with 24 bit files. Wise people will tell you to enable dither for improved accuracy in downsampling. I am hesitating to do that myself until dither is improved not to touch digital silence.

What derty had you enter in the naming box just affects how your target files will be named. Defaults would have worked too. He was just trying to help you to avoid identical names if you converted into the same folder. Perhaps it looks confusing at first but you don't need to touch those settings unless you want to change how the converted files get their names.
You can safely experiment with various options and see what suits your needs best.
Title: Resampler plugin
Post by: CT71 on 2012-12-07 04:46:38
Thanks case.  Yeah, took me 1 time to realize that I had to change it from auto to 16.  The dither part has me a little stooped though.  I did it without and it seems to be fine while I listened to it back, but before I start changing everything and then deleteing the 24's I just want to make sure about the dither part.  Thanks.
Title: Resampler plugin
Post by: lvqcl on 2012-12-08 10:55:50
Version 0.8.2: "speed up small-factor downsampling; e.g. ~15% improvement for 48k->44100"
Title: Resampler plugin
Post by: CT71 on 2012-12-11 18:37:26
Not sure if I'm supposed to start a new topic on this, or if everything related to the resampler goes here.  I just noticed that everything I've been resampling, when finished they're all ending up with Aretha Franklin's Who's Zoomin Who artwork!  Not even sure how long ago I downloaded that album, but it was a while ago, lol.  Thanks for some help.
Title: Resampler plugin
Post by: lvqcl on 2012-12-11 19:07:46
Not sure if I'm supposed to start a new topic on this, or if everything related to the resampler goes here.

Actually your question is not related to this plugin. (And your previous question wasn't related, too).
Title: Resampler plugin
Post by: Anakunda on 2012-12-11 21:43:05
Please for explanation about the Passband value and which value produces most accurate resampling, 95%, 99%, or something between them?
Title: Resampler plugin
Post by: CT71 on 2012-12-11 21:49:29
Ok, thanks anyways.  The resampler does it's job well, I like it.
Title: Resampler plugin
Post by: eamon123 on 2012-12-17 23:53:22
If the source file is already at the target sample rate, does this plugin get bypassed?
Title: Resampler plugin
Post by: bandpass on 2012-12-18 08:26:22
Please for explanation about the Passband value and which value produces most accurate resampling, 95%, 99%, or something between them?

With sample-rates of 44100Hz or above, the 95% value preserves the entire audio band.  The 99% option exists really only for marketing reasons, following a precedent set by some commercial resamplers.  If you look at the documentation at the SoX website, you'll see that there is no recommendation other than for the default, 95%.
Title: Resampler plugin
Post by: Anakunda on 2012-12-18 10:22:32
With sample-rates of 44100Hz or above, the 95% value preserves the entire audio band.


Oh yes thanks for explaining.
Title: Resampler plugin
Post by: lvqcl on 2012-12-18 15:37:44
If the source file is already at the target sample rate, does this plugin get bypassed?

http://www.hydrogenaudio.org/forums/index....st&p=791956 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=67376&view=findpost&p=791956)
Title: Resampler plugin
Post by: Garf on 2012-12-18 16:03:33
Please for explanation about the Passband value and which value produces most accurate resampling, 95%, 99%, or something between them?


The passband position is a tradeoff. You trade more bandwidth with steeper (longer, slower) filters, more ripple, etc. It is no "more accurate" setting.
Title: Resampler plugin
Post by: jamps on 2012-12-19 21:23:57
Could I set 24-bit or 32-bit somewhere, or is it pointless?
Title: Resampler plugin
Post by: Dario on 2012-12-19 21:49:42
Could I set 24-bit or 32-bit somewhere, or is it pointless?

File -> Preferences -> Playback -> Output -> Output format

But it is quite pointless.
Title: Resampler plugin
Post by: jamps on 2012-12-20 14:47:45
Could I set 24-bit or 32-bit somewhere, or is it pointless?

File -> Preferences -> Playback -> Output -> Output format

But it is quite pointless.

It is chosen automatically by foobar2000, I can't change it.
Title: Resampler plugin
Post by: Dario on 2012-12-20 14:51:48
I don't see why it shouldn't let you modify the output's bit depth.

Make sure you're seeing this: http://i.imgur.com/ujavx.png?1 (http://i.imgur.com/ujavx.png?1)
Title: Resampler plugin
Post by: jamps on 2012-12-20 17:40:20
Ah-ha, I had to change the setting to use explicitly my soundcard(with Kernel Streaming):
Before:
http://i.imgbox.com/acwAb5r6.png (http://i.imgbox.com/acwAb5r6.png)
After:
http://i.imgbox.com/adjXTRh7.png (http://i.imgbox.com/adjXTRh7.png)
This option doesn't exist with DS(DirectSound). Can it be added? Because using KS results that I only hear foobar2000,
nothing else makes a sound

So, this resampler should give the best audio quality? I am resampling up to 192000Hz.
Oh and btw, I didn't understand what the aliasing does, seems like one picture is missing from the explanation...
Title: Resampler plugin
Post by: xnor on 2012-12-20 20:20:40
All of this is off-topic, but ...

DS will always use 32-bit on Vista/7/8,
Resampling to 192 kHz will not improve audio quality,
Aliasing (http://lmgtfy.com/?q=audio+aliasing).

If you have questions I recommend opening a new thread in the appropriate forum or doing a search.
Title: Resampler plugin
Post by: lvqcl on 2012-12-20 20:51:12
Pictures from http://src.infinitewave.ca/ (http://src.infinitewave.ca/) , resampling of a sine sweep signal.

without aliasing:

(http://src.infinitewave.ca/images/Sweep/Signalyst_Sinc.png)

with aliasing:

(http://src.infinitewave.ca/images/Sweep/Korg.png)
Title: Resampler plugin
Post by: Dario on 2012-12-20 20:57:49
Pictures from http://src.infinitewave.ca/ (http://src.infinitewave.ca/) , resampling of a sine sweep signal.

without aliasing:

(http://src.infinitewave.ca/images/Sweep/Signalyst_Sinc.png)

with aliasing:

(http://src.infinitewave.ca/images/Sweep/Korg.png)

Something doesn't seem right about those images. I thought SoX allowed aliasing to occur only above the passband?
Title: Resampler plugin
Post by: lvqcl on 2012-12-20 21:09:23
"Aliasing" option actually means aliasing for downsampling ang imaging for upsampling.
Title: Resampler plugin
Post by: bandpass on 2012-12-21 06:53:25
True, but the InfiniteWave graphs are all for downsampling, so what we are seeing here is aliasing, and since the (high-level) aliasing is at >20kHz, it is above the passband.

The bottom graph also show some low-level aliasing below the passband (the purple line extending from the high-level aliasing).  So a more accurate description of the aliasing option (for downsampling) might be that it allows aliasing, at levels above the selected artefact rejection level, above the passband; below the passband there may also be aliasing (and even without the aliasing option) but only at levels less than or equal to the selected artefact rejection level.

(These graphs are not from SoX BTW, but the same principles apply.)

Title: Resampler plugin
Post by: Avi on 2013-01-01 20:10:41
I just wanted to add my thanks for your work on this resampler. I use the mod1 version to resample the few tracks I have at 22050 to conform with my DACport LX (16/24 - 44.1/48/88.2/96). It is fantastic!
Title: Resampler plugin
Post by: xsmid4 on 2013-01-03 19:01:07
Hello,
would you be so kind and add the possibility to select the target samplerate depending on source samplerate? It would be very useful for some USB dacs with 2 masterclocks 22mhz and 24mhz which select the masterclock speed depending on incoming usb stream. For example Casea Orion Lite. Because resampling just to one fixed samplerate cancels the advantage of such 2 masterclock dacs. Many thanks.
Title: Resampler plugin
Post by: lvqcl on 2013-01-03 19:34:37
Probably you can do it using _mod and _mod2 versions.
Title: Resampler plugin
Post by: xnor on 2013-01-03 19:44:24
Because resampling just to one fixed samplerate cancels the advantage of such 2 masterclock dacs.

May I ask you why you resample then?
Title: Resampler plugin
Post by: xsmid4 on 2013-01-04 03:31:58
Because resampling just to one fixed samplerate cancels the advantage of such 2 masterclock dacs.

May I ask you why you resample then?


every dac chip resamples internally, but then integrated resampler is not as good as Sox, so pre-resampling the 44khz (and other) material 4x to 176khz will skip 2 levels of internal resampler in dac chip. These first two levels are most important for quality. Addtional benefit is that you can choose your own filter (for example 90% passband, which results in slow roll off filter), because AD1955 chip doesn't have selectable filters and the default one is quite sharp = more artefacts.
For same reason Mark Levinson highend dacs use DSP in front of DAC chip, with custom filters/resamplers
Title: Resampler plugin
Post by: SoNic67 on 2013-01-05 11:31:27
Correct, most of the simple on-chip oversamplers in the DAC integrated circuits are just... OK. The filtering is simplified compared with a PC or DSP version and audio quality is not at maximum possible.
Title: Resampler plugin
Post by: Soundgeezer on 2013-01-09 14:06:58
hey guys, first post here:

i'd like to try sox in foobar and dragged and dropped the dll into the components folder.
but when right clicking on an audio file in the playlist and go to convert i only get "quick convert" and default as an option.

Could somebody help me ? i'd like to convert files from 44.1 24 bit to 96 24 bit and vice versa.

thank you
Title: Resampler plugin
Post by: lvqcl on 2013-01-09 14:50:25
Quote
i only get "quick convert" and default as an option.

And also "..."
Title: Resampler plugin
Post by: Soundgeezer on 2013-01-09 14:52:57
Oh yes, the small print 

thank you
Title: Resampler plugin
Post by: Night Rain on 2013-01-10 17:47:42
Just wondering if it would be possible to get a mod or mod2 with passband down to 85? Thanks for considering this.
Title: Resampler plugin
Post by: j7n on 2013-02-19 00:42:55
Thank you for publishing the old version as an attachment. Much appreciated. It also works under WinXP SP1.
Title: Resampler plugin
Post by: Zippy7 on 2013-03-07 22:28:19
@lvqcl: Thanks for suggesting how to do an AB comparison between different settings of the resampler.  For other forum readers, lvqcl suggested using the SoX resampler in the configuration of the convert utility (http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Converter) within foobar2000 to create WAV files.  Then use the official ABX component (http://www.foobar2000.org/components/view/foo_abx) of foobar2000 to ABX compare the WAV files.  It even supports comparing (the same original file converted to) two different sample rates.  The ABX component supports pressing the A and B keys on the keyboard to select between the choices, so testing can be performed with the eyes closed.  A pause, but no clicks are heard, when switching sample rates.  Slick!

I found that minimizing the buffer size in foobar2000 and my ASIO driver's controls minimized the pause duration when switching between A and B with different sample rates.
Title: Resampler plugin
Post by: juantendo8 on 2013-03-10 05:59:04
Hi, I have one quick question. My DAC supports only 44.1k, 48k, and 96k sample rate. I have some 32k sample rate music that I need to upsample in order to play. Which sample rate will give me the best quality?
Title: Resampler plugin
Post by: Sandrine on 2013-03-10 11:37:52
From a mathematical point of view, that would be a samplerate which is an even divider or multiplier of the source samplerate. That would rank it 96,48,44. However, 96 might be overkill, so I'd go with 48. Then again, in the end it's up to your ears.
Title: Resampler plugin
Post by: lvqcl on 2013-03-10 13:21:51
From a mathematical point of view, that would be a samplerate which is an even divider or multiplier of the source samplerate.

This means simpler calculations, but not necessarily better quality.

Hi, I have one quick question. My DAC supports only 44.1k, 48k, and 96k sample rate. I have some 32k sample rate music that I need to upsample in order to play. Which sample rate will give me the best quality?

Any.
Title: Resampler plugin
Post by: Dario on 2013-04-21 12:46:08
Hi lvqcl,

Would it be possible to expose the resampler's "Quality" setting (Normal / Best) via its default settings (found in Advanced -> Playback -> SoX Resampler default settings)? It is the only thing that is not exposed there.

Thank you for all the hard work!
Title: Resampler plugin
Post by: Robertina on 2013-05-21 12:22:07
Hello, lvqcl,

SoX Resampler v0.8.3 mod and mod2 both don't create messages in foobar2000's console, although I can hear that they are resampling. In the changelog I didn't find a hint that this feature, that I appreciated very much when using v0.5.4.1 mod has been removed.

Do I overlook something?
Title: Resampler plugin
Post by: lvqcl on 2013-05-21 14:39:32
SoX Resampler v0.8.3 mod and mod2 both don't create messages in foobar2000's console

It was removed in 0.8.0; they were added to help debugging, so I decided to remove them finally.
Title: Resampler plugin
Post by: Robertina on 2013-05-21 21:32:58
These messages had been helpful in cases in which the processing didn't meet the ear but was needed for other purposes.

Your resamplers are my favorite ones, so thank you for them, lvqcl.
Title: Resampler plugin
Post by: Night Rain on 2013-05-22 23:20:25
SoX Resampler v0.8.3 mod and mod2 both don't create messages in foobar2000's console

It was removed in 0.8.0; they were added to help debugging, so I decided to remove them finally.



Just wondering if it would be possible to get a mod or mod2 with passband down to 85? Thanks for considering this.
Title: Resampler plugin
Post by: Dario on 2013-05-23 19:14:56
lvqcl, did you see this:
Hi lvqcl,

Would it be possible to expose the resampler's "Quality" setting (Normal / Best) via its default settings (found in Advanced -> Playback -> SoX Resampler default settings)? It is the only thing that is not exposed there.

Thank you for all the hard work!
I'd really appreciate an answer.
Title: Resampler plugin
Post by: lvqcl on 2013-05-23 20:12:47
I'd really appreciate an answer.

Other components can use resampling routines of this plugin via resampling service (http://foosion.foobar2000.org/doxygen/latest/classresampler__entry.html). They specify target samplerate and target quality when they create resampler instances; foo_dsp_resampler takes other settings from advanced preferences.

So what this plugin should do if the default quality setting is highest but some component requests low quality resampling (or vice versa)? Somebody will always ask me why my plugin ignores quality setting. 


Robertina, Night Rain: try attached plugins.
Title: Resampler plugin
Post by: Dario on 2013-05-23 20:43:12
I'd really appreciate an answer.

Other components can use resampling routines of this plugin via resampling service (http://foosion.foobar2000.org/doxygen/latest/classresampler__entry.html). They specify target samplerate and target quality when they create resampler instances; foo_dsp_resampler takes other settings from advanced preferences.

So what this plugin should do if the default quality setting is highest but some component requests low quality resampling (or vice versa)? Somebody will always ask me why my plugin ignores quality setting. 

Cool; thanks for the explanation.
Title: Resampler plugin
Post by: Robertina on 2013-05-24 05:05:48
Robertina, Night Rain: try attached plugins.

Both versions are working perfectly here. Thanks a lot for having taken into account to re-add output to console, lvqcl. 

I wish more DSPs would output their status to the console as your resamplers do.
Title: Resampler plugin
Post by: AFAIK on 2013-06-10 11:12:23
Great plugin!

Any plan to get it into the official repository?
Title: Resampler plugin
Post by: Vincent Vega on 2013-07-18 22:36:15
if i save a dsp chain preset in foobar with some custom resampler(sox) settings, then load some other preset, then reload the preset with resampler(sox) its custom settings are lost (all at defaults again).

if i do the same with resampler (pphs), all custom settings are preserved upon reloading preset.

Title: Resampler plugin
Post by: lvqcl on 2013-07-19 15:55:05
Cannot reproduce: everything is ok here.

Just in case: post a list of installed plugins.
Title: Resampler plugin
Post by: SoNic67 on 2013-07-23 10:14:28
Robertina, Night Rain: try attached plugins.

Is there a way to add the console info to status bar?
Title: Resampler plugin
Post by: lvqcl on 2013-07-23 15:11:09
It's not possible now, and I have no idea is it possible at all.
Title: Resampler plugin
Post by: Zippy7 on 2013-07-24 17:34:55
There is interest in adding a SoX resampler to REAPER (http://reaper.fm/) for both offline and real-time purposes.  First, I would like to understand the differences between libsox (as opposed to libsoxr) and lvqcl's fb2k resampler.  Is the follwing correct?
1. lvqcl has removed code not related to the resampler (rate effect) from libsox.
2. lvqcl has converted the int32 I/O to float32 for compatibility with fb2k.
3. lvqcl adds variants for SSE, SSE2 and SSE3 for optimized CPU usage.

The best choices for REAPER seem to be either libsoxr (http://sourceforge.net/projects/soxr/) or lifting code from lvqcl's fb2k resampler.  Since REAPER is a 64-bit audio engine, libsoxr looks best for offline resampling because it support double64 audio through the whole path, while lvqcl's would introduce quantization to float32 in the path.  For real-time resampling/monitoring during mixing or mastering, float32 would be of sufficient quality since the DAC is 24 bits maximum.  How would you compare libsoxr and lvqcl's resampler in terms of CPU usage and latency?
Title: Resampler plugin
Post by: SoNic67 on 2013-07-28 16:50:31
How would you compare libsoxr and lvqcl's resampler in terms of CPU usage and latency?

I did try to measure the usage. On a Core2Duo E7200 running at 3GHz, with lvqc's resampler foobar oscillates between 00 and 01 %. Changes once per second. Without the resampler, it does the same, it just flips less often and stays more time on 00 than 01.
My take is that the 'CPU ussage', for a normal PC, is not an issue at all. Probably if you try it on an Atom or a PIII platform to find it different...
Title: Resampler plugin
Post by: DragonQ on 2013-08-02 12:41:02
I can't use WASAPI due to the silent stream bug, which Foobar doesn't work around when doing manual track changes (yet). So I'm stuck using Direct Sound for my HDMI output, which I have set to 48 kHz 24-bit (most of my HTPC usage is TV/video). Is it worth my time using this plugin? How can I actually test whether SoX does a better job of resampling 44.1 kHz music to 48 kHz than my nVidia card? I have a few 96 kHz 24-bit files too - would any problems arise if I set the shared mode to 96 kHz 24-bit instead of 48 kHz 24-bit?
Title: Resampler plugin
Post by: Propheticus on 2013-08-02 14:46:18
You can do a RMAA recording test, playing the testfile from foobar2000 with all replaygain and dsp disabled at volume 100%. Then do the same with the SoX resampler DSP loaded and compare results. When you find differences in the graphs this doesn't have to automatically mean you can actually hear these differences though!
Better would be a blind listening test where you ask someone else to change the resampling without telling you what you're listening to. Best would be using a third option as a reference. This could be another (expected to be far worse) resampler plugin or the SoX resampler with far lower settings.  The other person would randomly choose an order in which to use these 3 options after which you tell him your preference from best to worst. Repeat ~5-10 times and compare results. If there's a clear preference for one of the 2 options you're interested in, this is what objectively sounds best (to you). If it's ~tied between nVidia and SoX, it doesn't matter. The reference should come 3rd (almost) all the time though.
Title: Resampler plugin
Post by: Glenda on 2013-08-19 09:27:59
Is there any way to use insert command lines like this which has can allow the use of Foobar to replace the digital filter of a DAC:

rate -v -M -b 87.5 38200 dither -S
Title: Resampler plugin
Post by: pablof on 2013-09-23 16:55:27
Any chance of conditional resampling depending on the number of channels of the audio track being played?

What I am trying to do is:

- Resample stereo tracks to 24/192.
- Resample multichannel tracks to 24/96.

My HTPC is hooked to a Pioneer SC-LX81 receiver through HDMI. This receiver unconditionally upsamples everything to 24/192, a behaviour that I am trying to avoid by means of what I assume is a better upsampler (SoX) in Foobar. The problem is that the dsp inside the receiver doesn't have enough horsepower to do room & phase correction with multichannel audio at 24/176 and beyond, so it stays at 24/96 in this case.

Any idea?

Thanks!
Title: Resampler plugin
Post by: marc2003 on 2013-09-23 17:33:44
setup 2 DSP chains and then you can use this component to switch between them based on title formatting...

http://www.hydrogenaudio.org/forums/index....showtopic=96094 (http://www.hydrogenaudio.org/forums/index.php?showtopic=96094)
Title: Resampler plugin
Post by: pablof on 2013-09-28 10:24:57
Hi, marc.

setup 2 DSP chains and then you can use this component to switch between them based on title formatting...

http://www.hydrogenaudio.org/forums/index....showtopic=96094 (http://www.hydrogenaudio.org/forums/index.php?showtopic=96094)


Thankyou very much! This seems exactly what I need.
Title: Resampler plugin
Post by: Soundgeezer on 2013-10-05 12:52:39
I just tried to convert a 96 kHz file to 44.1 kHz.
The size of the file is over 5 GB and it didn't work.

Where is the limit sizewise and is there any chance to convert a huge file in one go ?

thanks, Pat
Title: Resampler plugin
Post by: xnor on 2013-10-05 14:30:41
it didn't work


Could you be more specific? Works for me..
Title: Resampler plugin
Post by: Sober5 on 2013-11-18 21:39:15
Great job done with the the resampler! Just wondering, why don't you let the user choose the output bit depth as the original version allows?

I suspect that changing the bitdepth outside of the DSP plugin may produce inferior results compared to doing this along with the resampling within the same plugin...
Title: Resampler plugin
Post by: xnor on 2013-11-18 22:16:14
why don't you let the user choose the output bit depth

Because re-quantization happens when passing the audio data to the soundcard. In the case of Direct Sound that's completely outside of any audio player's hands and in case of ASIO/WASPI (exclusive only) the particular output plugin does the work right before the audio data leaves the player.

Title: Resampler plugin
Post by: Sober5 on 2013-11-19 11:07:30
I don't agree. Look at this example. Upsampling 44100 (16 bit) to 88200. My DAC supports 32 bits. The SOX plugin works internally on 32 bits of precision. After resampling is done SOX rounds the result back to 16 bits (in the current implementation of foobar filter). Then you suggest to change it back to 32 bits using the output filter. There you go: you have your quantization errors. If you allowed SOX to output 32 bits, it would be the best possible scenario in my case.

I know we are talking about very subtle differences.

I can understand the argument about direct sound, but I'm using ASIO output (and I assume most people using the SOX resampler should be aware of the limitations of Direct Sound as they want to achieve best possible quality...). ASIO will output the stream going out of the player directly. In this case 16 bits. No way to change it.
Title: Resampler plugin
Post by: lvqcl on 2013-11-19 15:02:27
After resampling is done SOX rounds the result back to 16 bits (in the current implementation of foobar filter).


It doesn't: it receives 32-bit float and outputs 32-bit float. Then fb2k output plugin reduces bit depth if necessary.
Title: Resampler plugin
Post by: xnor on 2013-11-19 15:25:34
I don't agree. [..] Then you suggest to change it back to 32 bits using the output filter. There you go: you have your quantization errors.

This is not a matter of (dis)agreement though. The internal format is 32 bit floating point in foobar2000 and plugins usually receive, process* and output 32 bit data except for some output plugins.
*) Processing is sometimes done using 64 bit floating point.

As I said, quantization is done as late as possible in order to not introduce unnecessary errors.

Quote
ASIO will output the stream going out of the player directly. In this case 16 bits. No way to change it.

The ASIO output plugin should choose the highest available bit depth (32 bit floating point or signed integer if available, if not 24 bit signed integer and so on..).
Title: Resampler plugin
Post by: tedsmith on 2013-11-19 15:52:38
After resampling is done SOX rounds the result back to 16 bits (in the current implementation of foobar filter).
...
ASIO will output the stream going out of the player directly. In this case 16 bits. No way to change it.
And if you don't believe the author of the plugin, using your example of resampling 44.1/16 to 88.2 via ASIO my DAC reports 88.2/24 bits: i.e. the low bits are changing.
Title: Resampler plugin
Post by: Sober5 on 2013-11-19 16:42:49
Ok, ok! Thanks for the additional info!

However, my previous DAC reported 16 bits when played via foobar even though it supported 24 bits (in all modes: KS, ASIO, wasapi). I didn't use any plugins at that time. And with no plugins (and not using volume control), 16 bit output was indeed the best option.

Unfortunately, my new DAC doesn't report anything, so I assumed ASIO feeds it also with 16 bits. I'll try to find a way to check what bit depth is on the output (analyze USB traffic?). Maybe when a plugin is enabled the output switches automatically to higher bit depth?
Title: Resampler plugin
Post by: xnor on 2013-11-19 16:55:24
Without plugins you're automatically using Direct Sound. The format is configured in the Windows sound control panel (right click sound tray icon -> playback devices) -> properties of the playback device -> advanced -> default format.

If you resample to 96 kHz for example you should set this to a format with matching sampling rate, for example to "24 bit, 96000 Hz". That way the Windows audio engine will not resample (again).
Title: Resampler plugin
Post by: Sober5 on 2013-11-19 16:57:36
"Without plugins" I ment without DSP plugins. As I said, the output was set to either KS, ASIO, wasapi. All gave 16 bits on output for 16 bit files.
Title: Resampler plugin
Post by: xnor on 2013-11-19 17:20:32
"Without plugins" I ment without DSP plugins. As I said, the output was set to either KS, ASIO, wasapi. All gave 16 bits on output for 16 bit files.


KS and WASAPI plugins allow you to set the output bit depth. If you set it to 16 bit it's going to be 16 bit.
ASIO, as I said before, should choose the highest supported bit depth automatically.
Title: Resampler plugin
Post by: Sober5 on 2013-11-19 23:22:11
KS and WASAPI plugins allow you to set the output bit depth. If you set it to 16 bit it's going to be 16 bit.


That for sure, when set to 16 bit it will output 16 bit. However KS when set to 24 bit worked for me based on the input file bit depth. For 16 bit files: 16 bit, for 24 bit files: 24 bit. That's fine as this plugin is ment to give you bit-perfect playback. I will try to find a way how to verify if this is the same when DSP plugin is enabled and get back to you. I'm thinking of trying http://www.usblyzer.com/ (http://www.usblyzer.com/) ...
Title: Resampler plugin
Post by: tedsmith on 2013-11-20 01:20:46
I will try to find a way how to verify if this is the same when DSP plugin is enabled and get back to you.  I'm thinking of trying http://www.usblyzer.com/ (http://www.usblyzer.com/)
FWIW On my system using KS and a 44.1/16 track I see 16 bits changing at the DAC, when resampling to 88.2 I see 24 bits changing at 88.2k at the DAC.
When I tried USBlyzer (for another reason) I was annoyed that the only USB audio decoders they support are for USB Audio 1.0.  But raw packets should be find for your purpose.
Title: Resampler plugin
Post by: Sober5 on 2013-11-20 09:10:38
Thanks! So it seems the output plugins are intelligent as I hoped them to be
Title: Resampler plugin
Post by: Zippy7 on 2013-11-21 14:22:42
@lvqcl: With the normal version of the SoX resampler v0.83, when the target sample rate is 192kHz, and the playback file is 192kHz, is the SoX resampler's output bit-exact with the SoX resampler's input?  I am not concerned with a buffering delay, only quantization errors.
Title: Resampler plugin
Post by: lvqcl on 2013-11-21 14:39:38
when the target sample rate is 192kHz, and the playback file is 192kHz

There's no processing, no buffering, nothing.

Also, you can compare input and output files with foo_bitcompare plugin.
Title: Resampler plugin
Post by: Zippy7 on 2013-11-24 20:29:14
Thanks lvqcl.  Well done!

I have a feature request for increased flexibility.  My external DAC supports a maximum sample rate of 192 kHz.  I would like to upsample 44k & 48k by a factor of 4, 88k & 96k by a factor of 2, and not convert 176k & 192k.  I tried your SoX resampler v0.8.3 mod2 and configured it to upsample by 4 only 44k, 48k, 88k & 96k.  foobar2000 then threw an error for 88k & 96k because my output device does not support the 4X sample rate.  I see two ways to solve this:
a) SoX resampler recognizes the maximum supported sample rate of the output device and reduces the upsample factor from 4 to 2 to 1 as needed.
b) The mod2 version uses a semicolon-separated list of I/O sample rates to convert.  My example would be 44100;176400;48000;192000;88200;176200;96000;192000
Title: Resampler plugin
Post by: xnor on 2013-11-24 21:12:44
Why don't you just only resample 88.2 kHz or 96 kHz by 2x, and with another instance resample only 44.1 kHz or 48 kHz by 4x?
Title: Resampler plugin
Post by: Glenda on 2013-11-25 03:33:36
Is there any way to use insert command lines like this which has can allow the use of Foobar to replace the digital filter of a DAC:

rate -v -M -b 87.5 38200 dither -S



Why wouldn't the sox plugin accept SOX command lines,  should be the easiest thing to implement into foobar.  I guess we are all just waiting on a 64 bit Foobar at this point anway.
Title: Resampler plugin
Post by: xnor on 2013-11-25 15:36:48
rate -v -M -b 87.5 38200 dither -S
Why wouldn't the sox plugin accept SOX command lines,  should be the easiest thing to implement into foobar.  I guess we are all just waiting on a 64 bit Foobar at this point anway.


I don't think that makes sense, since this plugin only does resampling (rate effect) and nothing else.

-v = very high quality = "Best" in the plugin
-M = minimum phase = 0% phase response in the plugin
-b = bandwidth ... closest you can get with the plugin is 90%, maybe this can be decreased to 80% in an update (or the lowest sox allows)?
Title: Resampler plugin
Post by: lvqcl on 2013-11-26 14:47:49
Why wouldn't the sox plugin accept SOX command lines

It's not a SoX plugin, it contains only resampling routines from SoX utility and nothing else.

should be the easiest thing to implement into foobar.

O rly? 
Title: Resampler plugin
Post by: Zippy7 on 2013-11-26 19:05:52
Why don't you just only resample 88.2 kHz or 96 kHz by 2x, and with another instance resample only 44.1 kHz or 48 kHz by 4x?

@xnor: Thanks for the clever idea.  I tried your idea, and it worked.

@lvqcl: I hope you will keep my ideas in mind for your next update.  Would be nice to achieve more flexibility with just one instance.
Title: Resampler plugin
Post by: Glenda on 2013-12-24 15:29:56
Is there any way to use insert command lines like this which has can allow the use of Foobar to replace the digital filter of a DAC:

rate -v -M -b 87.5 38200 dither -S



Why wouldn't the sox plugin accept SOX command lines,  should be the easiest thing to implement into foobar.  I guess we are all just waiting on a 64 bit Foobar at this point anway.



Should be but isn't, the foobar plugin is about as watered down about bad as some mac app from the 90's. 

Foobar severely needs a good resampler like Syngalist or the mac program that comes with the Izotope 64bit SRC,  but I guess as mentioned in an
earlier post we probably need a 64 bit core Foobar before any of that will happen.

Lets hope that happens because the future of computer audio is to move the everything from the digital filter prior to the computer.  I know this forum is stuck in thinking
all over-sampling is the same,  but I've' ABX's and found the digital filter one of the most important influences on sound.  And wha ta better way to
handle it than with x86 vs some proprietary fpga.
Title: Resampler plugin
Post by: Glenda on 2013-12-24 16:52:40
Sorry for the grammar I got caught off correcting it.  My main point is the spirit of foobar and its success has been customization.  We've buried our
heads in the sand while people resort to non-oversamplng DAC's and expensive priority programmed fpga's because the old SIW chips and the penny-pinching oversampler on dac chip just can't technically compete with what a modern PC can do,  and in the spirit of Foobar make it customizable,  pick your algoritm you settings.  Whether it sounds better is not the argument its
piched on dac chip filter just can't give the end user SOTA,  and ultimately the the aility to build a very simple DAC with the number crutching done by the computer.

But again a good first start with be a modern SOX plugin that accepts command lines with no bandwidth limitations (could least get Meridian apodizing.)
Title: Resampler plugin
Post by: xnor on 2013-12-24 23:36:06
Foobar severely needs a good resampler like Syngalist or the mac program that comes with the Izotope 64bit SRC,  but I guess as mentioned in an
earlier post we probably need a 64 bit core Foobar before any of that will happen.

SoX is a very good resampler.
No, you don't need a 64 bit core to do 64 bit processing, but depending on the algorithm and requirements you might be fine with 32 bit floats or even ints.

I know this forum is stuck in thinking
all over-sampling is the same,  but I've' ABX's and found the digital filter one of the most important influences on sound.

What filters? What test setup? Please provide details.

But again a good first start with be a modern SOX plugin that accepts command lines with no bandwidth limitations (could least get Meridian apodizing.)

Why do you need command line options?
Why would you want an apodizing filter that doesn't suppress images?
Title: Resampler plugin
Post by: wottha on 2014-09-07 23:29:18
Thank you lvqcl for making such a great FB2K component.

One question though.  At src.infinitewave.ca, all three of the following seem to be the same:

foo_dsp_resampler
Audacity 2.0.3
SoX 14.4 High Quality

(except the artifacts in the Sox 14.4 Sweep, but that doesn't seem quite right). 

So I guess they're all using the SoX default settings? (Quality Best, Passband 95%, Phase Linear 50%)?

What settings in foo_dsp_resampler are equivalent to:
SoX 14.4 VHQ Linear Phase (at infinitewave)

Would that be Quality Best, Passband 99%, Phase Linear 50%?

Is the only downside of Passband at 99% the speed of processing?  Because it's plenty fast for me.  Much faster than many commercial resamplers and those included in many daw programs.

Thanks.
Title: Resampler plugin
Post by: lvqcl on 2014-09-08 15:30:59
So I guess they're all using the SoX default settings? (Quality Best, Passband 95%, Phase Linear 50%)?

Yes, it seems so.

What settings in foo_dsp_resampler are equivalent to:
SoX 14.4 VHQ Linear Phase (at infinitewave)

Would that be Quality Best, Passband 99%, Phase Linear 50%?

AFAIK yes.

Is the only downside of Passband at 99% the speed of processing?  Because it's plenty fast for me.  Much faster than many commercial resamplers and those included in many daw programs.

Sharper filter means longer ringing. Compare Afconvert (Normal) with Afconvert (Bats):

(http://src.infinitewave.ca/images/Impulse/Afconvert_norm.png) VS (http://src.infinitewave.ca/images/Impulse/Afconvert_bats.png)

Different people prefer different filters, but if both input and output samplerates are high enough (say, 44.1 kHz or higher) then it doesn't matter much.
Title: Resampler plugin
Post by: wottha on 2014-09-09 20:03:40
Sharper filter means longer ringing. Compare Afconvert (Normal) with Afconvert (Bats):

Thank you for the explanation about the longer ringing.

Maybe it's more common to show the default settings at infinitewave now, but for purposes of appearances relative to the "ideal", seems like maybe 99% Passband would look "better" there, instead of or in addition to the default.

Also, just an observation, but with SoX it seems like the settings 99% Passband, 50% Phase (linear), Aliasing enabled, would probably look more like Weiss Saracon than any other SRC there, given how the SoX High Quality (95% ?) Aliasing enabled looks.

Thank you again lvqcl.

EDIT:  afaik Weiss Saracon shown at infinitewave is the one and only src setting available in Saracon.  there are no optional parameter settings. (afaik)
Title: Resampler plugin
Post by: gevorg on 2014-10-18 19:58:43
I just have a feature suggestion for this already excellent plugin.

Add the ability to upsample based on specified input sample rate, such as:

44.1KHz & 48KHz = Upsample x4
88.2KHz & 96KHz = Upsample x2
176.4KHz & 192KHz = No change, leave as-is
Title: Resampler plugin
Post by: detmek on 2014-10-22 13:21:32
Or, you can just set 192kHz as output samplerate. You won't get better quality because you upsample x2, x3 or x4.
Title: Resampler plugin
Post by: Porcus on 2014-10-22 17:28:49
44.1KHz & 48KHz = Upsample x4
88.2KHz & 96KHz = Upsample x2


Add two of it, for each use the restrict to the following rates function.

Myself I resample to frequencies my DAC supports: 16k and 32k to 48k, and 11025 and 22050 to 44100.
Title: Resampler plugin
Post by: gevorg on 2014-11-03 01:23:18
44.1KHz & 48KHz = Upsample x4
88.2KHz & 96KHz = Upsample x2


Add two of it, for each use the restrict to the following rates function.

Myself I resample to frequencies my DAC supports: 16k and 32k to 48k, and 11025 and 22050 to 44100.


How do I do that?
Title: Resampler plugin
Post by: xnor on 2014-11-03 10:35:52
How do I do that?

There are "mod" versions. Mod2 only resamples specified rates.
http://www.hydrogenaud.io/forums/index.php?showtopic=67373 (http://www.hydrogenaud.io/forums/index.php?showtopic=67373)
Title: Resampler plugin
Post by: gevorg on 2014-11-04 23:26:57
How do I do that?

There are "mod" versions. Mod2 only resamples specified rates.
http://www.hydrogenaud.io/forums/index.php?showtopic=67373 (http://www.hydrogenaud.io/forums/index.php?showtopic=67373)


Thanks, works like a charm now!
Title: Resampler plugin
Post by: Tummarellox on 2014-12-11 16:45:00
Thanks everyone for the precious tips, I have a little question:
assuming my sound board does not support 44100hz samplerate, but only higher ones (until 96000hz) so I set it from windows to 96000hz and 24bit, and I set 24bit also in the wasapi settings of foobar output.

my questions are: does the windows setting mean anything while playing music with foobar in wasapi mode? and more important: setting the sox target resampling to 96000hz is the good choice to be able to listen all the 44100hz sampled music i have? and what then about the native 96000hz stuff? do they get resampled as well or sox "skip" those automatically without touching them? (and here again: the windows setting mean something still in this case?)

Sorry for the tricky questions, i've been lurking a lot the forum! bye!
Title: Resampler plugin
Post by: Case on 2014-12-11 18:24:28
my questions are: does the windows setting mean anything while playing music with foobar in wasapi mode?

No. That settings only affects things going through the Windows mixer and both ASIO and WASAPI bypass it.

Quote
and more important: setting the sox target resampling to 96000hz is the good choice to be able to listen all the 44100hz sampled music i have?

Yes and no. SoX is fast and has super high quality but the resampler in modern Windows versions has superb quality too. I measured and WASAPI + SoX in fast mode is faster than DS output + Windows resampler. DS output has the advantage that it allows other sounds to play at the same time so you could watch video clips with sound or get sound notification about new important email. And foobar2000 can apply fade effects when you seek or pause playback so that annoying glitches aren't heard.

Quote
and what then about the native 96000hz stuff? do they get resampled as well or sox "skip" those automatically without touching them? (and here again: the windows setting mean something still in this case?)

In the above scenario the resampler DSP does absolutely nothing. And if you use WASAPI output the Windows mixer setting has no effect. If you use DirectSound output then the Windows setting has an effect. If the setting there matches your source files nothing gets resampled.
Title: Resampler plugin
Post by: Tummarellox on 2014-12-11 19:37:12
Thank you very much! that was really helpful, btw I managed it using the SoX mod2 which allows me to resample only the sample rate i want to (that is only 44100hz to 96000hz in this case, since its the only one my audio board doesnt support) and I guess all the other sample rates are totally untouched.
PS: keeping the WASAPI setting to 24bit while playing 16bit content (or the opposite, if possible) does create any quality issue? Am I supposed to change it according to what i'm listening to?
sorry for the bad english, i'm italian
Title: Resampler plugin
Post by: Case on 2014-12-11 19:53:54
Keeping it at 24 bits at all times is best. The larger bit depth can contain 16-bit signal unaltered. And if you adjust volume the extra bits will allow higher SNR in theory. If you kept it at 16 bits and played 24-bit files, you would not be transmitting the full quality to your sound card. In normal situation the difference would not be audible but there's no point to intentionally do the wrong thing.
Title: Resampler plugin
Post by: Tummarellox on 2014-12-11 21:55:26
Great, thank you  is there a way to somehow check if the playback of a 44100hz file upsampled to 96000hz is basically without quality loss?
Title: Resampler plugin
Post by: Porcus on 2015-01-07 13:19:07
Mod2 only resamples specified rates.


For wishlist: asterisk for all, and specify interval(s) rather than single rates.
Title: Resampler plugin
Post by: d125q on 2015-03-22 13:50:38
SoX was updated and there are changes to the resampling code (http://sourceforge.net/p/sox/code/ci/45b161d73ec087a8e003747b1aed07cd33589bca/tree/ChangeLog). Any chance to update the DSP, too?
Title: Resampler plugin
Post by: lvqcl on 2015-03-22 16:44:47
IIRC these changes are rather old, and they are already in the code of this plugin.
Title: Resampler plugin
Post by: Fabith on 2015-03-22 22:26:24
So... This settings are the best to get the best sound quality ?

(http://k46.kn3.net/99D279B4A.png)
Title: Resampler plugin
Post by: lobo85 on 2015-04-21 16:04:17
Is there any way to implement resampling to 705.6/768 kHz? I happen to have a device that supports these sample rates and as of yet I can only achieve this by upsampling 192 kHz sample rates by 4x. It would be nice however to have a dedicated setting for any sample rate to be resampled to 705.6/768 kHz.
Title: Resampler plugin
Post by: bmcelvan on 2015-04-25 18:19:06
Using foobar with the SoX resampler and have a question:
When downsampling from 24bit either 96/192kHz to 16bit either 44.1/48kHz...should I enable aliasing/imaging or keep it off? Or does it really not matter at all because any difference between the two are going to be differences above 20kHz hence I won't hear them?

The full settings I'm using are 50% (linear), 95% passband, and dithering. Are these the recommended/best settings? Obviously dithering is because of the bit change.

I'm asking these questions because I've been reading a bunch of posts about aliasing and right when I think I shouldn't use it because a great encoder should not introduce much noise, I read 5-10 posts in a row about why aliasing is actually good in this cae. It does add noise but in doing so it actually reduces a bunch of bad noise, ringing, etc.. So then I think I should use it. So I guess my above question is the most important...does it do anything noticeable at all or is it above the hearing threshold anyway and so it doesn't matter (to me) who will only be listening to it.

Thanks
Ben
Title: Resampler plugin
Post by: jaynyc on 2015-05-05 09:05:02
Hi.  I am using "Resampler (soX) mod2" plugin
(http://content.screencast.com/users/jaynyc1/folders/Snagit/media/f91b9987-bc61-4568-90ab-a053f84be57f/05.05.2015-04.01.png)


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

(http://content.screencast.com/users/jaynyc1/folders/Snagit/media/804d8690-a6c5-47a6-ab20-5230778e9a95/05.05.2015-04.25.png)
Title: Resampler plugin
Post by: lvqcl on 2015-05-05 16:44:45
-v: Quality = Best
-M: Phase response = 0% (minimum)
-a: Allow aliasing/imaging = on
Title: Resampler plugin
Post by: jaynyc on 2015-05-12 03:03:09
-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 ?
Title: Resampler plugin
Post by: lvqcl on 2015-05-12 16:24:19
default value (95%).
Title: Resampler plugin
Post by: modernartistry on 2015-07-22 16:06:23
With this UI, is it possible to achieve the following Sox setting:
-vMa

(http://content.screencast.com/users/jaynyc1/folders/Snagit/media/804d8690-a6c5-47a6-ab20-5230778e9a95/05.05.2015-04.25.png)


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.
Title: Resampler plugin
Post by: xnor on 2015-07-22 17:16:09
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.
Title: Resampler plugin
Post by: hydrobot on 2015-08-21 02:22:32
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?

(http://i.imgur.com/V0cbz1f.jpg)
Title: Resampler plugin
Post by: bennetng on 2015-08-21 18:37:40
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 (http://www.hydrogenaud.io/forums/index.php?showtopic=101850&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.
Title: Resampler plugin
Post by: AMRoberts on 2015-10-09 22:43:08
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!
Title: Resampler plugin
Post by: xnor on 2015-10-09 23:27:07
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.
Title: Re: Resampler plugin
Post by: Gio-Gio on 2016-01-18 22:50:40
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
Title: Re: Resampler plugin
Post by: kode54 on 2016-01-19 01:14:31
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.
Title: Re: Resampler plugin
Post by: Gio-Gio on 2016-01-19 01:27:17
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  :))
Title: Re: Resampler plugin
Post by: amiti on 2016-02-23 13:27:20
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)?
Title: Re: Resampler plugin
Post by: xsdaver on 2016-07-20 22:17:19
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.
Title: Re: Resampler plugin
Post by: xsdaver on 2016-08-08 13:18:44
I've been using this great plugin for a while and have a feature request or two:


Thanks for any consideration you may give these requests.
Title: Re: Resampler plugin
Post by: lvqcl on 2016-08-08 13:36:50
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.
Title: Re: Resampler plugin
Post by: xsdaver on 2016-08-08 13:46:24
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. 
Title: Re: Resampler plugin
Post by: arnaudf on 2016-12-07 20:47:20
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.
Title: Re: Resampler plugin
Post by: SmartOne on 2016-12-16 08:54:27
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. :)
Title: Re: Resampler plugin
Post by: bennetng on 2016-12-16 10:25:28
SoX resampler plugin for foobar2000 indeed uses float. The one that uses integer is the original commandline version.

https://hydrogenaud.io/index.php/topic,101850.0.html
Title: Re: Resampler plugin
Post by: lvqcl on 2016-12-16 11:32:37
Yes, this plugin uses floating point math.

Probably arnaudf experiences clipping in ASIO2 plugin or ASIO driver. Adding Advanced Limiter should prevent this.
Title: Re: Resampler plugin
Post by: arnaudf on 2016-12-16 22:12:39
Hi,

I don't think so.
If I don't use SoX resampler plugin the track has no clipping.
Title: Re: Resampler plugin
Post by: Chibisteven on 2016-12-16 22:50:21
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.
Title: Re: Resampler plugin
Post by: arnaudf on 2016-12-16 23:10:26
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.
Title: Re: Resampler plugin
Post by: lvqcl on 2016-12-17 01:09:22
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.
Title: Re: Resampler plugin
Post by: Chibisteven on 2016-12-17 03:02:42
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.
Title: Re: Resampler plugin
Post by: Joe Bloggs on 2017-01-05 16:12:50
I find that I'm unable to have SoX do anything but linear phase filtering (e.g. minimum phase) when resampling to 44100.  It seems this is the case with commandline SoX as well.  Any idea why this is so?
Title: Re: Resampler plugin
Post by: lvqcl on 2017-01-05 17:01:51
What's the source samplerate? I hope it's not 44100 Hz?
Title: Re: Resampler plugin
Post by: Joe Bloggs on 2017-01-06 17:57:38
96kHz
Title: Re: Resampler plugin
Post by: lvqcl on 2017-01-06 18:42:52
Works as expected here.
Title: Re: Resampler plugin
Post by: brokemack on 2017-03-12 15:49:50
Thanks for your work. For the modified version, is it possible to input a range of frequencies to pass through or do they have to be listed individually (separated w semicolons)?
Title: Re: Resampler plugin
Post by: lvqcl on 2017-03-12 18:19:38
It supports only a list of frequencies.
Title: Re: Resampler plugin
Post by: Spoonie_B on 2018-01-14 21:52:47
Sorry for the dumb question but it's been a long time since I added components.  I don't see SoX on the foobar components page (http://www.foobar2000.org/components), and the download (for mod version) gives me just a dll.  Foobar 1.3.11 doesn't seem to recognize this file type as a component to install anymore; it wants fb2k-component files.  Any idea how to get this installed?  Running Win 10.
Title: Re: Resampler plugin
Post by: lvqcl on 2018-01-14 22:14:57
and the download (for mod version) gives me just a dll.

No, it should give you .zip file, and foobar2000 supports both .fb2k-component and .zip files.
Title: Re: Resampler plugin
Post by: lvqcl on 2018-03-28 07:55:22
Beta version here: https://hydrogenaud.io/index.php/topic,115734.0.html
Title: Re: Resampler plugin
Post by: Case on 2018-03-28 17:15:47
Extrapolation feature seems to work nicely.
Title: Re: Resampler plugin
Post by: Anakunda on 2018-09-08 08:36:53
For the command line interface I'm using these parameters for resampling -G - rate -v -L <targetrate>
To be sure, is Ivqcl's plugin qualitywise up to pair with cmdline interface with used params and does the SoX utility provide the extrapolation feature?
Title: Re: Resampler plugin
Post by: Rollin on 2018-09-08 09:50:01
For the command line interface I'm using these parameters for resampling -G - rate -v -L <targetrate>
To be sure, is Ivqcl's plugin qualitywise up to pair with cmdline interface with used params and does the SoX utility provide the extrapolation feature?
Ivqcl's plugin is  up to pair with cmdline qualitywise with used params. (Passband: 95% (SoX default), Quality: Best, Allow aliasing: disabled, Phase response: 50% (linear)) But it doesn't provide guard against clipping (-G option). But are you able to hear clipping from resampling?
SoX commandline tool doesn't provide extrapolation feature.
Title: Re: Resampler plugin
Post by: Case on 2018-09-08 10:20:18
Actually foobar2000 component wins the command line in quality. The command line interface can't do floats and suffers from unnecessary rounding and of course clipping. And if you use a parameter to prevent clipping you alter the volume.
Title: Re: Resampler plugin
Post by: Anakunda on 2018-09-08 10:29:30
Thanks!
Title: Re: Resampler plugin
Post by: darkflame23 on 2018-10-26 13:07:37
Just want to say thanks for this component. Been meaning to check it out for ages, and it works exactly how I need it to.

Background: I run a mastering studio where EVERYTHING (all DACs, PC, drivers and digital equipment) is clocked to the master capture ADC. To change the sample rate is a PITA as I have to go into my Crookwood mastering console's menu settings multiple layers to do it. Every time I want to audition a quick 22k mp3, or enjoy listening to 192kHz Norah Jones albums, for example, it's a bit of a hassle to go hardware menu diving just to be able to do so. So I have been wondering for ages how I could keep things at 44.1 (my usual) but have those different SRs be automatically converted to 44 on the fly (I know it's not the best quality conversion, I go offline SRC for that in mastering duties with FinalCD or iZotpe RX7 Advanced). Now, thanks to the Mod2 version, I can specify that all those other SRs are real time converted to 44.1 and I can listen quickly without having to dick around.

THANK YOU! I wish I had sorted it out much earlier...
Title: Re: Resampler plugin
Post by: Porcus on 2018-10-26 13:22:35
@darkflame23 : If you want to resample everything to one single frequency, then you don't need the "mod2" version?
I use the mod2 in order to select for upsampling files of unsupported sampling frequency, but I do not want to spend that weak computer's CPU load on resampling when I don't have to.

(My "ideal" component would intercept an "unsupported" error message and only then start resampling, but I don't switch output device when I don't have to.)
Title: Re: Resampler plugin
Post by: darkflame23 on 2018-10-26 14:54:36
Right was wondering about that, cheers, will check original version!
Title: Re: Resampler plugin
Post by: lvqcl on 2018-11-05 21:11:43
Version 0.8.4 is available (see the 1st post).
Title: Re: Resampler plugin
Post by: sveakul on 2018-11-05 22:00:58
Ivqcl:  Thank you for the update, mod2 is one of my "essential" plugins.
Title: Re: Resampler plugin
Post by: jaro1 on 2018-11-17 06:34:48
Thank you for an update of this very fast and transparent SRC, for me unique in that it's suitable for real time playback conversion and imo very high quality offline conversion.
Shame it has not yet been added into components catalog.  
Title: Re: Resampler plugin
Post by: jaro1 on 2018-12-09 05:56:39
Possible bug with v. 0.8.5
Options for 2x/4x upsampling are not saved. After adjusting one of the upsampling values, confirming with "OK" and subsequent plugin options window opening, there stays "1000".
Title: Re: Resampler plugin
Post by: lvqcl on 2018-12-09 10:13:30
@jaro1 Thanks, should be fixed in 0.8.6.
Title: Re: Resampler plugin
Post by: Surfi on 2018-12-09 12:40:27
@lvqcl

mod link still points to 0.8.4 ...

Title: Re: Resampler plugin
Post by: lvqcl on 2018-12-09 14:23:39
No reason to update them. The bug was introduced in 0.8.5, so they weren't affected.
Title: Re: Resampler plugin
Post by: seventhstar on 2019-01-10 18:50:34
@lvqcl version 0.8.6 is not available for fb2k?
Title: Re: Resampler plugin
Post by: lvqcl on 2019-01-10 19:02:58
@lvqcl version 0.8.6 is not available for fb2k?
The file foo_dsp_resampler.fb2k-component is in the 1st post of this thread.
Title: Re: Resampler plugin
Post by: seventhstar on 2019-01-11 16:18:58
@lvqcl version 0.8.6 is not available for fb2k?
The file foo_dsp_resampler.fb2k-component is in the 1st post of this thread.

but when I install it in foobar2k it says that it is version 0.8.3 not 0.8.6, sorry for the disturbances...
Title: Re: Resampler plugin
Post by: C87P66 on 2019-01-19 15:16:24
Hi lvqcl, thanks for the awesome software! Do you know how long the filter is for x8 oversampling? Would we get better performance with an even longer filter?
Title: Re: Resampler plugin
Post by: lvqcl on 2019-01-19 21:04:11
Do you know how long the filter is for x8 oversampling?
Have no idea.

Would we get better performance with an even longer filter?
Why? It can be worse, not better.
Title: Re: Resampler plugin
Post by: C87P66 on 2019-01-19 21:21:49
Do you know how long the filter is for x8 oversampling?
Have no idea.

Would we get better performance with an even longer filter?
Why? It can be worse, not better.

I know SSRC is 16k max, if that's useful. It is often suggested that longer filters are more accurate, though more computation-intensive. Why do you think longer filters can be worse given the same design?
Title: Re: Resampler plugin
Post by: lvqcl on 2019-01-19 21:53:10
I thought that "performance" means speed, not accuracy.
There's no need for better accuracy, because SoX quality is already excellent.
Title: Re: Resampler plugin
Post by: kode54 on 2019-01-21 04:21:51
Longer filters can lead to more pre- and/or post-echo or ringing. The current filter design is already sufficient for mathematical accuracy, which is already way more than you'll ever need for audible accuracy.
Title: Re: Resampler plugin
Post by: j7n on 2019-01-21 05:43:32
Why are there 3 versions of the plugin? I understand that 'mod' with the list of frequencies blank is equivalent to 'non-mod' version.
Title: Re: Resampler plugin
Post by: Rollin on 2019-01-27 10:34:01
Do new versions compiled with 1.4 SDK use dynamic library linking when used with fbk 1.4?
Title: Re: Resampler plugin
Post by: lvqcl on 2019-01-27 13:03:17
Yes, new versions (0.8.4 and newer) are dynamically linked to MSVC runtime files.
Title: Re: Resampler plugin
Post by: 19mantis on 2019-04-05 21:33:46
Any chance you can re-code  S0x binary to sound better for Classical Music with extended highs?
Title: Re: Resampler plugin
Post by: darkflame23 on 2019-04-05 22:25:33
SRCs are not designed to change the sound of the music, but be transparent. You'd be better served with an EQ, extend your own highs. :)
Title: Re: Resampler plugin
Post by: Rollin on 2019-06-02 12:42:47
Now, that we have option "Automatic resampler preference" in advanced settings (in fb2k 1.4 and higher), isn't option "Service Priority" redundant?
Title: Re: Resampler plugin
Post by: lvqcl on 2019-08-05 19:26:02
Bugfix version (0.8.7) was released.
Title: Re: Resampler plugin
Post by: sveakul on 2019-08-06 02:12:07
Bugfix version (0.8.7) was released.
Thank you Ivqcl!  Have the two "mod" versions been permanently discontinued, and, are the 0.8.4 versions of those still available (only 0.8.3 is now present in the "old versions" post)?
Title: Re: Resampler plugin
Post by: djavo on 2019-09-18 08:01:37
thank you!
Title: Re: Resampler plugin
Post by: mrsoul4470 on 2019-09-19 13:39:32
Should we update from the old 0.8.3 versions to a newer version for reasons of audio quality? Do newer versions quality wise do "better" up- or downsampling or is it just necessary to update if you experience problems?
Title: Re: Resampler plugin
Post by: lvqcl on 2019-09-19 18:10:10
Audio quality is the same, so you can keep 0.8.3.

But if you convert files using this resampler, and you hear some (very quiet) clicks during track changes, then you should try 0.8.7.
Title: Re: Resampler plugin
Post by: mrsoul4470 on 2019-09-20 05:15:19
Thanks for the quick answer!

Another question that someone asked before but I think there wasn't an answer:
Are the mod versions discontinued? I always found them very useful.

If there is just one version updated in the future, wouldn't it make sense if that would be mod(1)? It's really useful to be able to exclude (or include) sample frequencies.
Title: Re: Resampler plugin
Post by: galenmacil@yahoo.com on 2019-12-29 03:46:18
Hi.

I could not find any relevant info in this thread using search so here is my question:

Does this plugin support multichannel (5.1, 7.1) resampling on all channel when using a plugin like FreeSurround earlier in the DSP chain?

Example: FLAC stereo source file @ 44.1khz -> DSP Surround processing to 5.1 channel -> SoX Resampling to 96khz

Thanks.
Title: Re: Resampler plugin
Post by: sveakul on 2019-12-29 06:33:38
Example: FLAC stereo source file @ 44.1khz -> DSP Surround processing to 5.1 channel -> SoX Resampling to 96khz
I have the Sox resampler as the first component in the chain, so the source gets passed on immediately at the resampled rate to whatever processing is applied farther down the chain.  That way I don't know why the surround processing (or anything else) wouldn't work just fine.
Title: Re: Resampler plugin
Post by: Chibisteven on 2019-12-30 06:33:25
Quote
Example: FLAC stereo source file @ 44.1khz -> DSP Surround processing to 5.1 channel -> SoX Resampling to 96khz
That will work just fine.

Quote
I have the Sox resampler as the first component in the chain, so the source gets passed on immediately at the resampled rate to whatever processing is applied farther down the chain.  That way I don't know why the surround processing (or anything else) wouldn't work just fine.
Also works and might be helpful if something in the DSP chain has a harder time with certain sample rates that are either too high or too low.
Title: Re: Resampler plugin
Post by: galenmacil@yahoo.com on 2020-01-06 01:45:59
Thank you both for your reply.

I was interested in knowing, specifically, if the data sent to the output are 6 channels, all re-sampled or if it only process the 2 stereo channels and pass the other 4 unchanged from the source. I know it "works" as in "I can hear the music just fine".

As a side note, putting the Resampler first in the chain produce bad quality with the DSP plugin("FreeSurround") I am using to upmix to 5.1. The higher the resampling rate from SoX, the higher the distortion present in the 5.1 output. I believe the culprit is FreeSurround not the resampler. That is why I have to put it in second. just after SoX.

So, to reiterate in broader terms: Does SoX resampler support resampling from a source with more than 2 channels?
Title: Re: Resampler plugin
Post by: kode54 on 2020-01-06 02:07:57
It supports resampling any arbitrary number of channels, as long as you have the resources for it.
SimplePortal 1.0.0 RC1 © 2008-2020