qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] PC speaker emulation (square wave)


From: Joachim Henke
Subject: Re: [Qemu-devel] [PATCH] PC speaker emulation (square wave)
Date: Sun, 29 Jan 2006 11:44:19 +0100

The fact, that we can only reproduce frequencies up to half of sampling frequency, has already been dealt with since the first patch I posted (2006-01-18).

I chose to use a sample rate of 32000 Hz, which should be sufficient for our purpose. So we can handle PIT count values down to 75. Previous patches also played the highest possible frequency for PIT count values 1-74. I changed this with the square wave patch: It plays "silence" for frequencies above 16 kHz now.

Currently, I want to keep things as simple as possible. I see no need for producing more overhead to emulate low-pass filtering for plain tone generation. We can implement this, when we have realtime PIT emulation, which would make full PC speaker emulation possible. But, as you told, there are different kinds of PC speakers anyway.

I'm currently improving the patch a bit and will post one, that could be included into CVS, soon.


Sebastian Kaliszewski wrote:
No. Typical cutoff freq is where components of the signal are attenuated by 3dB (i.e. are half as loud). At 2 times taht frequency they'll be attenuated by 3 + A dB, where A is filter's rate in dB/octave. Typical 1st order filter is 6dB/octave, 2nd order is 12dB/octave, etc. Typical soundards used no more than 2nd order filter.

But, if you want to have your path behave really nicely, you should simply not generate at all waves at frequencies above half of current output sampling rate -- those can't be reproducted -- instead significant distortion will be generated (google for Nyquist frequency).

--
Joachim Henke
http://he-jo.net/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]