IPB

Welcome Guest ( Log In | Register )

15 Pages V  < 1 2 3 4 > »   
Reply to this topicStart new topic
Resampler plugin, uses SoX 14.2.0 resampling routines
bandpass
post Mar 10 2009, 23:02
Post #26





Group: Members
Posts: 321
Joined: 3-August 08
From: UK
Member No.: 56644



QUOTE (lvqcl @ Mar 10 2009, 16:56) *
QUOTE (jaro1 @ Mar 10 2009, 13:00) *
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 wink.gif


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 smile.gif 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


Go to the top of the page
+Quote Post
jaro1
post Mar 11 2009, 09:33
Post #27





Group: Members
Posts: 76
Joined: 22-November 08
Member No.: 62952



Thanks to both lvqcl, bandpass for your comments, it was very helpfull for me.

This post has been edited by jaro1: Mar 11 2009, 11:11
Go to the top of the page
+Quote Post
bandpass
post Mar 11 2009, 15:11
Post #28





Group: Members
Posts: 321
Joined: 3-August 08
From: UK
Member No.: 56644



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
Go to the top of the page
+Quote Post
a3aan
post Mar 11 2009, 20:21
Post #29





Group: Members
Posts: 79
Joined: 23-December 06
Member No.: 38930



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.
Go to the top of the page
+Quote Post
kode54
post Mar 11 2009, 21:49
Post #30





Group: Admin
Posts: 4499
Joined: 15-December 02
Member No.: 4082



QUOTE (a3aan @ Mar 11 2009, 12:21) *
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.
Go to the top of the page
+Quote Post
lvqcl
post Mar 12 2009, 18:28
Post #31





Group: Developer
Posts: 3208
Joined: 2-December 07
Member No.: 49183



QUOTE (a3aan @ Mar 11 2009, 22:21) *
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 smile.gif
I'll think about adding this feature.
Go to the top of the page
+Quote Post
a3aan
post Mar 12 2009, 21:56
Post #32





Group: Members
Posts: 79
Joined: 23-December 06
Member No.: 38930



Thanks a lot for considering. I'm ready to help with some testing wink.gif.

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.

QUOTE (lvqcl @ Mar 12 2009, 18:28) *
QUOTE (a3aan @ Mar 11 2009, 22:21) *
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 smile.gif
I'll think about adding this feature.

Go to the top of the page
+Quote Post
lvqcl
post Mar 12 2009, 22:35
Post #33





Group: Developer
Posts: 3208
Joined: 2-December 07
Member No.: 49183



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.
Go to the top of the page
+Quote Post
punkrockdude
post Mar 15 2009, 01:35
Post #34





Group: Members
Posts: 243
Joined: 21-February 05
Member No.: 20022



I wonder what are the difference and therefore ten different plugins to choose from? Regards
Go to the top of the page
+Quote Post
lvqcl
post Apr 5 2009, 16:21
Post #35





Group: Developer
Posts: 3208
Joined: 2-December 07
Member No.: 49183



QUOTE (punkrockdude @ Mar 15 2009, 04:35) *
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.
Go to the top of the page
+Quote Post
lvqcl
post Apr 5 2009, 16:28
Post #36





Group: Developer
Posts: 3208
Joined: 2-December 07
Member No.: 49183



QUOTE (kode54 @ Mar 12 2009, 00:49) *
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?)
Go to the top of the page
+Quote Post
Yirkha
post Apr 5 2009, 17:31
Post #37





Group: FB2K Moderator
Posts: 2359
Joined: 30-November 07
Member No.: 49158



is_conversion_supported() - 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.
get_priority() - 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).


--------------------
Full-quoting makes you scroll past the same junk over and over.
Go to the top of the page
+Quote Post
lvqcl
post Apr 5 2009, 18:35
Post #38





Group: Developer
Posts: 3208
Joined: 2-December 07
Member No.: 49183



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. huh.gif Are they intended for 3rd party components and not for fb2k itself?
Go to the top of the page
+Quote Post
Yirkha
post Apr 5 2009, 18:56
Post #39





Group: FB2K Moderator
Posts: 2359
Joined: 30-November 07
Member No.: 49158



dsp is a generic DSP service.

resampler_entry 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).


--------------------
Full-quoting makes you scroll past the same junk over and over.
Go to the top of the page
+Quote Post
lvqcl
post Apr 5 2009, 19:18
Post #40





Group: Developer
Posts: 3208
Joined: 2-December 07
Member No.: 49183



Thanks again. I will use resampler_entry class (and WTL, too wink.gif ) in future versions.
Go to the top of the page
+Quote Post
Mix3dmessagez
post Apr 6 2009, 10:51
Post #41





Group: Members
Posts: 87
Joined: 22-March 09
Member No.: 68252



QUOTE (lvqcl @ Nov 18 2008, 22:45) *
Uploaded here

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?
Go to the top of the page
+Quote Post
Mr.Duck
post Apr 6 2009, 13:16
Post #42





Group: Members
Posts: 80
Joined: 26-March 09
Member No.: 68393



Thanks, lvqcl. A really excelent plugin. Must be the best resampler available for foobar. Thanks to SoX as well of course! Excelent job.
Go to the top of the page
+Quote Post
lvqcl
post Apr 6 2009, 15:34
Post #43





Group: Developer
Posts: 3208
Joined: 2-December 07
Member No.: 49183



QUOTE (Mix3dmessagez)
My question is, what does those settings do?


http://sox.sourceforge.net/Docs/FAQ -- "What are the best 'rate' settings to resample a file and retain the highest quality?"
Go to the top of the page
+Quote Post
Mix3dmessagez
post Apr 6 2009, 17:42
Post #44





Group: Members
Posts: 87
Joined: 22-March 09
Member No.: 68252



QUOTE (lvqcl @ Apr 6 2009, 10:34) *
QUOTE (Mix3dmessagez)
My question is, what does those settings do?


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'?
Go to the top of the page
+Quote Post
lvqcl
post Apr 6 2009, 18:29
Post #45





Group: Developer
Posts: 3208
Joined: 2-December 07
Member No.: 49183



From help file of standalone SoX program (ver. 14.4.0):

CODE
              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.


This post has been edited by lvqcl: Jun 17 2012, 09:23
Go to the top of the page
+Quote Post
Mix3dmessagez
post Apr 6 2009, 18:45
Post #46





Group: Members
Posts: 87
Joined: 22-March 09
Member No.: 68252




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

This post has been edited by Canar: Apr 6 2009, 20:37
Reason for edit: quoted without thinking
Go to the top of the page
+Quote Post
lvqcl
post Apr 6 2009, 18:51
Post #47





Group: Developer
Posts: 3208
Joined: 2-December 07
Member No.: 49183



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?)
Go to the top of the page
+Quote Post
esa372
post Jun 1 2009, 21:11
Post #48





Group: Members (Donating)
Posts: 429
Joined: 5-September 04
From: Los Angeles
Member No.: 16796



I just found this thread...

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

cool.gif


--------------------
Clowns love haircuts; so should Lee Marvin's valet.
Go to the top of the page
+Quote Post
Steve Forte Rio
post Jul 9 2009, 20:20
Post #49





Group: Members
Posts: 432
Joined: 4-October 08
From: Ukraine
Member No.: 59301



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???

This post has been edited by Steve Forte Rio: Jul 9 2009, 20:26
Go to the top of the page
+Quote Post
lvqcl
post Jul 10 2009, 16:36
Post #50





Group: Developer
Posts: 3208
Joined: 2-December 07
Member No.: 49183



QUOTE (Steve Forte Rio)
I do not understand.... What about "allow aliasing"?

A picture is worth a thousand words:

Original test signal (44.1 kHz):


Resampled to 48 kHz (bandwith = 90%, aliasing = no):


Resampled to 48 kHz (bandwith = 90%, aliasing = yes):


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


QUOTE (Steve Forte Rio)
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.

This post has been edited by lvqcl: Jul 10 2009, 16:38
Go to the top of the page
+Quote Post

15 Pages V  < 1 2 3 4 > » 
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 17th April 2014 - 11:48