En Fri, 23 Jan 2009 14:36:46 -0200, Peter Pearson <ppear...@nowhere.invalid> escribió:
On Thu, 22 Jan 2009 20:58:14 -0200, Gabriel Genellina wrote:
En Mon, 19 Jan 2009 21:57:04 -0200, Peter Pearson
<ppear...@nowhere.invalid> escribió:

The following code uses ossaudiodev to read 1000 values from
my sound card at a rate of 12,000 samples per second:

When I select a sample rate that is not a power of 2 times
3000 samples/second, a strong and very regular sawtooth is
superimposed on the signal.  At some sampling frequencies,
it appears as a rising sawtooth, and at other sampling
frequencies it is a declining sawtooth, so I'm presumably
lost in some aliasing wilderness.  As best I can tell,
it's a 48 KHz sawtooth.

That could be a hardware and/or driver limitation. By example, an
AC97-compliant chipset may provide a fixed rate of 48000 samples/second any sample rate conversion must be done by other means, if possible at all.

Oh!  As a matter of fact, my "soundcard" *is* AC97-compliant
("VT8233/A/8235/8237", according to Sysinfo).  So . . . this
sawtooth might result from some software, somewhere in the bucket
brigade between me and the hardware, attempting to perform
sample-rate conversion?  The 48 KHz coincidence seems very
significant.

Yep. Google found this for me:
http://mail-index.netbsd.org/port-i386/2003/02/18/0003.html

Using a sample rate that is a sub-multiple of 48000 is perhaps a safe approach.

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to