Reply by Jon Harris July 2, 20042004-07-02
"Andor" <an2or@mailcircuit.com> wrote in message
news:ce45f9ed.0407020150.26f1e6ef@posting.google.com...
> Jon Harris wrote: > > "Ronald H. Nicholson Jr." wrote: > > > > > > On a fast > > > PC you may not need to do this, as a well tuned math library can often > > > calculate the window and Sinc tap coefficients in real time. > > > > Just curious, how well does this work with a Kaiser window (my favorite
choice
> > for this type of thing)? It's got that nasty Bessel function in it! > > Have you tried Knab's alternative to the Kaiser window [1]? It is also > a one-parameter window family, but is defined using exp instead of the > Bessel I_0 function and is claimed to be very close to the Kaiser > window. > > Regards, > Andor > > [1] John J Knab, "An Alternate Kaiser Window" > IEEE Transactions on Acoustics, Speech, and Signal Processing, Vol. > ASSP-27, No.5, October 1979
That's the first I've heard of it. Thanks for the tip!
Reply by Andor July 2, 20042004-07-02
Jon Harris wrote:
> "Ronald H. Nicholson Jr." wrote: > > > > On a fast > > PC you may not need to do this, as a well tuned math library can often > > calculate the window and Sinc tap coefficients in real time. > > Just curious, how well does this work with a Kaiser window (my favorite choice > for this type of thing)? It's got that nasty Bessel function in it!
Have you tried Knab's alternative to the Kaiser window [1]? It is also a one-parameter window family, but is defined using exp instead of the Bessel I_0 function and is claimed to be very close to the Kaiser window. Regards, Andor [1] John J Knab, "An Alternate Kaiser Window" IEEE Transactions on Acoustics, Speech, and Signal Processing, Vol. ASSP-27, No.5, October 1979
Reply by Erik de Castro Lopo July 2, 20042004-07-02
balaji wrote:
> > I have implemented a polynomial interpolator and it works fine for > Audio Sample rate conversion. You can the material here > http://www.student.oulu.fi/~oniemita/DSP/INDEX.HTM
Have you measured the signal to noise ratio? If so, what was it and how did you measure it? Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo nospam@mega-nerd.com (Yes it's valid) +-----------------------------------------------------------+ "And MS thinks Linux is vulnerable to forking? 95, 95 OEM SR2, 98, 98SE, ME, NT, 2000, Bob, .NET, CE, Datacenter, Server, Adv. Server, and now Web Server, sheesh." -- BTS on LinuxToday.com
Reply by balaji July 2, 20042004-07-02
I have implemented a polynomial interpolator and it works fine for
Audio Sample rate conversion.  You can the material here
http://www.student.oulu.fi/~oniemita/DSP/INDEX.HTM

rhn@mauve.rahul.net (Ronald H. Nicholson Jr.) wrote in message news:<cc1q5u$8k1$1@blue.rahul.net>...
> In article <W6CEc.179470$207.1255211@news20.bellglobal.com>, > David Reid <dreid_nospam@remove_no_spam_mechtronix.ca> wrote: > >How can this be done? My application is converting the sample rate of > >44.1kHz wave files to sample rate X (eg change SR by factor of 0.75, or 1.3) > >and playing back at 44.1kHz, so that the speed sounds different. > > Interpolation can give you any point between sample points, and > thus will work for any arbitrary or even time varying sample ratios. > > Sinc interpolation will produce much less distortion than linear > or low order polynomial interpolation (see the "reconstruction" > theorems), although linear interpolation may work if the frequency > content of the original signal is way below the sample rate. > > An interpolation method with suitable approximations for the > windowed-Sinc function will allow you to trade off compute time against > S/N ratio. You can play with the type of window, width of window and > various approximation tricks for the windowed-Sinc function. The various > polyphase resampling methods are just table-lookup driven optimization > tricks which one can use with DSP's that are too slow (or as an > optimization when needed for power reduction or something). On a fast > PC you may not need to do this, as a well tuned math library can often > calculate the window and Sinc tap coefficients in real time. > > > IMHO. YMMV.
Reply by Erik de Castro Lopo July 1, 20042004-07-01
David Reid wrote:
> > I have actually. i've also heard of Open source audio library on > sourceforge.net. i think the implementation for the class afLibConverter > (used for sample rate conversion) is a reimplementation of the Secret Rabbit > Code functions in C++.
Actually, I beleive that afLibConverter uses a modified version of Julius O. Smith's original C code and simply provides a C++ wrapper around it. Secret Rabbit Code is the reimplementation and last time I compared my code (the Rabbit) with implementations based on the JOS code, my code ran faster and had better signal to noise and a wider passband. I've been meaning write up these results but I simply haven't had the time.
> Anyway, I've posted the algorithm. don't care if i can't share it. dont > really like this company much....
Que?? Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo nospam@mega-nerd.com (Yes it's valid) +-----------------------------------------------------------+ When aiming for the common denominator, be prepared for the occasional division by zero.
Reply by Jon Harris July 1, 20042004-07-01
"Ronald H. Nicholson Jr." <rhn@mauve.rahul.net> wrote in message
news:cc1q5u$8k1$1@blue.rahul.net...
> In article <W6CEc.179470$207.1255211@news20.bellglobal.com>, > > On a fast > PC you may not need to do this, as a well tuned math library can often > calculate the window and Sinc tap coefficients in real time.
Just curious, how well does this work with a Kaiser window (my favorite choice for this type of thing)? It's got that nasty Bessel function in it!
Reply by Ronald H. Nicholson Jr. July 1, 20042004-07-01
In article <W6CEc.179470$207.1255211@news20.bellglobal.com>,
David Reid <dreid_nospam@remove_no_spam_mechtronix.ca> wrote:
>How can this be done? My application is converting the sample rate of >44.1kHz wave files to sample rate X (eg change SR by factor of 0.75, or 1.3) >and playing back at 44.1kHz, so that the speed sounds different.
Interpolation can give you any point between sample points, and thus will work for any arbitrary or even time varying sample ratios. Sinc interpolation will produce much less distortion than linear or low order polynomial interpolation (see the "reconstruction" theorems), although linear interpolation may work if the frequency content of the original signal is way below the sample rate. An interpolation method with suitable approximations for the windowed-Sinc function will allow you to trade off compute time against S/N ratio. You can play with the type of window, width of window and various approximation tricks for the windowed-Sinc function. The various polyphase resampling methods are just table-lookup driven optimization tricks which one can use with DSP's that are too slow (or as an optimization when needed for power reduction or something). On a fast PC you may not need to do this, as a well tuned math library can often calculate the window and Sinc tap coefficients in real time. IMHO. YMMV. -- Ron Nicholson rhn AT nicholson DOT com http://www.nicholson.com/rhn/ #include <canonical.disclaimer> // only my own opinions, etc.
Reply by Jon Harris June 30, 20042004-06-30
Let me guess--linear interpolation?  If not, please post.

"David Reid" <dreid_nospam@remove_no_spam_mechtronix.ca> wrote in message
news:0UFEc.185159$207.1297924@news20.bellglobal.com...
> Hey, thanks for the replies. Your explanations seem very useful. However, > i don't think i will be using them....for the following reason. > > My manager came to see why it was taking so long for me to get this thing > working and we had a debate about the proper way to do resampling. He > suggested a technique, which i don't know where it came from but for some > reason it works (i just implemented it). It goes against pretty much all > that i've read on the web, and what i've read on this news group. I will > post the question and algorithm for everyone to respond to in another post, > if your interested. > > david
Reply by David Reid June 30, 20042004-06-30
I have actually.  i've also heard of Open source audio library on
sourceforge.net.  i think the implementation for the class afLibConverter
(used for sample rate conversion) is a reimplementation of the Secret Rabbit
Code functions in C++.

Anyway, I've posted the algorithm.  don't care if i can't share it. dont
really like this company much....


"Erik de Castro Lopo" <nospam@mega-nerd.com> wrote in message
news:40E32AD9.D0CAB4DC@mega-nerd.com...
> David Reid wrote: > > > > How can this be done? My application is converting the sample rate of > > 44.1kHz wave files to sample rate X (eg change SR by factor of 0.75, or
1.3)
> > and playing back at 44.1kHz, so that the speed sounds different. This
is
> > being done in C++. > > > > So far, what i've read seems to only apply to SRC by integer factors. > > Well obviously you have never heard of Secret Rabbit Code . > > http://www.mega-nerd.com/SRC/ > > or Julius O. Smith (see URL below). > > > How does this change to be able to change the sample rate by a Real
factor?
> > Please correct any and all errors i've made above. > > The best explanation is here: > > http://ccrma-www.stanford.edu/~jos/resample/ > > Erik > -- > +-----------------------------------------------------------+ > Erik de Castro Lopo nospam@mega-nerd.com (Yes it's valid) > +-----------------------------------------------------------+ > "I've nothing against OO, I do have something against C++. Its a dogs > dinner. Anyone who's (tried) to read Stroustrups book on C++ like I had > the misfortune of doing knows that the man is very intelligent but has > about as much clarity of thought as Timothy Leary on a bad day." > -- NJR in comp.os.linux.development.apps
Reply by Suodatin Pussi June 30, 20042004-06-30
David Reid wrote:

> Hey, thanks for the replies. Your explanations seem very useful. However, > i don't think i will be using them....for the following reason. > > My manager came to see why it was taking so long for me to get this thing > working and we had a debate about the proper way to do resampling. He > suggested a technique, which i don't know where it came from but for some > reason it works (i just implemented it). It goes against pretty much all > that i've read on the web, and what i've read on this news group. I will > post the question and algorithm for everyone to respond to in another post, > if your interested. > > david
Sure, share it with us, if you're allowed to, it seems to be a very quick method.