[Speex-dev] Sampling Rate

David Hogan david.hogan at freshtel.net
Mon Dec 11 15:44:18 PST 2006


I'm no DSP or audio expert by any means, but I can share what works for
me. People in the know, I would appreciate tips on whether this stuff is

You could sample at 32000Hz (or 48000Hz, any AC97 card will support
this), run a 8000Hz lowpass filter over the data (16000Hz sample rate
can only represent frequencies up to 8000Hz) and then drop every second
(or 2 out of 3 for 48000->16000) sample. The result being, 16000Hz
sampled audio. If you omit the filter the result will contain artifacts.

At the other end for playback you can convert it back to 48000 (or
whatever) by 

You can use http://www-users.cs.york.ac.uk/~fisher/mkfilter/trad.html to
generate such a filter, choose Butterworth + lowpass, filter order 10,
put your sample rate in, and corner frequency 1 8000Hz.

Failing that, you could use http://www.mega-nerd.com/SRC/ to do the
resampling for you if you're prepared to GPL your code or cough up for
the license. This library will perform any arbitrary conversion for you
as well (for example 44.1->16), not just simple ones like 32->16.

Hope this helps!

David Hogan

> -----Original Message-----
> From: speex-dev-bounces at xiph.org 
> [mailto:speex-dev-bounces at xiph.org] On Behalf Of khaynes at kirkgames.com
> Sent: Tuesday, 12 December 2006 10:11 AM
> To: speex-dev at xiph.org
> Subject: Re: [Speex-dev] Sampling Rate
> It seems that I only have the following values available for 
> sampling from 
> the mic.
> "The value must be 8000, 11025, 22050, 32000, 44100, or 48000"
> Which leaves 8000 and 32000 for use with speex. I think since 
> this is a game 
> and not a voice application, I'm stuck using the 8kHz rate. 
> What speex 
> setting would you recommend I use for the best 
> quality/performace, what 
> frame size (number of samples) to send to the encoder, etc..
> > Kirk,
> >
> > Speex was designed for 8kHz, 16kHz, and 32kHz sample rates.  If you
> > don't use one of these sample rates, you'll be messing up important
> > assumptions deep within the codec.  Why these sample rates?  It's
> > telecommunications tradition, rather than PC audio tradition.
> >
> > If you want an efficient and high quality format for voice chat, try
> > 16kHz with VBR quality 6.  You should see around a 10:1 compression
> > ratio when someone is talking.  That is, around 25kbps would be a
> > rough peak using these settings.
> >
> > If that's too much bandwidth for you, you can cut it by almost half
> > using VBR quality 2.  (The loss of quality will be noticible to most
> > people using headsets.  It is less noticible when using speakers.)
> > For further bandwidth savings you could use 8kHz, but it's too much
> > of a quality hit to be worth it in my opinion.
> >
> > Tom
> _______________________________________________
> Speex-dev mailing list
> Speex-dev at xiph.org
> http://lists.xiph.org/mailman/listinfo/speex-dev

More information about the Speex-dev mailing list