[hatari-devel] Filters utilized more effectively
David Savinkoff
dsavnkff at telus.net
Wed May 18 09:19:58 CEST 2011
On May 17, 2011, Nicolas Pomarède <npomarede at corp.free.fr> wrote:
>
> Le 16/05/2011 00:08, David Savinkoff a écrit :
>
>>> Just a small question regarding :
>>>
>>> + /* Anti-alias filter is not required when nAudioFrequency == 50066 Hz */
>>> + if (nAudioFrequency>50000&& nAudioFrequency<50100)
>>>
>>> Why don't you just use "if (nAudioFrequency==50066)" ?
>>>
>> - A real Atari will not be exactly 50066 Hz
>> *(50066 is probably only an accepted nominal value).
>
> I don't understand what you mean ; a real STE is 50066 Hz (that one of
> the only 4 possible dma audio output frequencies).
> I don't see how an STE could have a 50000 Hz dma output freq for example ?
>
>> - Someone may wish to experiment with 50000.
>> - 50066 is a prime number multiplied by 2.
>>
>> BTW, options.c limits the sample frequency from 6000 to 50066 Hz
>> The enclosed testing patch references this (minor testing feature).
>
> The idea is to give the user a choice of frequencies on his computer
> that are compatible with an STF/STE. Of course, we could allow 50200,
> but as said above, I don't understand how it would match a real STE ?
>
> Nicolas
>
Hi,
I checked a STE schematic and found a 8.010613 MHz crystal associatied with
dma sound. To find the actual sampling rate frequency you would divide
8.010613 MHz / 50066 Hz and get 160.0010586026445092, but 160.0015..
is not an integer value (the hardware divider is going to be 160). So now you
divide 8.010613 MHz / 160 and get 50066.33125 Hz for the sampling rate.
Thus, 50066.33125 Hz is 'nominally' 50066 Hz; by Atari literature.
But, crystals are usually accurate to about 100 parts per million 'and'
are pullable (by changing the parallel or series capacitor) by even more.
So, +/- 100ppm at 8.010613 MHz is: +/- 801 Hz
(and pullable by a few times 100ppm)
If a crystal and capacitor on an STE result in a clock frequency of
8.010613 MHz +/- 801 Hz, then the Sampling frequency will be within
the range of 50061.325 and 50071.338 Hz.
Furthermore (and beside the point) Hatari has this:
#define CPU_FREQ 8012800
..which when divided by 160 'would on real hardware' be 50080 Hz for the
sampling rate.
All of this makes for a justifiable argument that 50000 Hz through 50100 Hz
are realistic sampling rates on a real Atari STE (and Hatari). I believe
CPU_FREQ / 160 is better, because a real STE does it this way.
David
More information about the hatari-devel
mailing list