Reply 20 of 66, by reenigne
- Rank
- Oldbie
wrote:So, if the cutoff frequency is set to 22kHz, won't there be higher frequencies still in the mix after filtering, although at 6dB quiter for each octave above 22050Hz?
That's an artifact of a particular filter implementation, not of a particular cutoff frequency. I was talking about an ideal filter, not a 6dB per octave one.
wrote:Also, won't that mess up the PWM used at 72 PWM samples, since the calculated response is much faster?
It will yield an audible carrier frequency at 16.6kHz, just as real hardware does.
wrote:So you would need (22050/44100)*~1190000(1.19MHz) PIT samples instead of 72 in order for the PWM to give valid effects?
I'm not sure what you mean by that.
wrote:Or is the only requirement that there is a low-pass filter present, no matter what it's cutoff frequency?
As I said above, the low pass filter is necessary because you're doing downsampling, not because of the way the PC speaker works or because of any particular trick that any particular PC speaker software uses.
wrote:Would a IIR low-pass filter at 22050Hz still allow PWM using a division of x out of 72(73 depths) to give correctly audible results?
An low-pass filter at 22050Hz (not sure about an IIR one specifically) would still allow PWM to work at any PWM sample rate. Forget about the particular PWM sample rate that 8088 MPH uses - other PC speaker software uses PWM at different rates, and a good emulator should work just as well for any of them.
wrote:Or will that destroy the entire trick, since the frequency response is off(by a lot)?
The point of the low-pass filter in the emulator is to eliminate aliasing caused by the downsampling (which doesn't occur on real hardware), not to eliminate PWM carrier waves (which do).