Datasheet
HH
VS1053B OGG VORBIS ENCODER VSMPG
2.6 Samplerate Considerations
The Ogg Vorbis encoder cannot always work at exactly the right samplerate. To be exact,
the samplerate is accurate only when the input clock is 12.288 MHz and the nominal
samplerate of a profile is either 8000 Hz or 16000 Hz. In all other cases the samplerate
can be calculated as follows. First let:
• f
i
=input clock divided by 4000 (same value that you write to SC_FREQ (bits 10:0)
of register SCI_CLOCKF, or 3072 if you have written 0 to these bits to indicate
12.288 MHz clock).
• f
n
=nominal samplerate of the profile (8000, 16000 or 44100).
• r = 3 if f
n
= 8000, otherwise r = 2.
• Now let u = f
n
× r .
• Let d = b
f
i
×2000+
u
2
u
c
• Now our real samplerate f
s
=
2000×f
i
d×r
Example: We are running at an input clock of 12.288 MHz and we are running the Stereo
Music profile that has a nominal samplerate of 44100 Hz.
First f
i
=
12288000
4000
= 3072.
Because f
n
= 44100, then r = 2.
Thus u = 44100 × 2 = 88200.
This leads to d = b
3072×2000+
88200
2
88200
c = 70
And, finally, our real samplerate f
s
=
2000×3072
70×2
≈ 43885.7 (Hz)
As can be seen, in this example the nominal and real samplerate have a difference of
0.5 %. While this is normally not significant, it is good to know and important in the case
of streaming.
2.7 Post-Processing the Recording with VorbisGain
It is recommended to post-process your own recording later on a PC machine using
VorbisGain to get equal loudness with other recordings. For details, see Chapter 3.3.
Rev. 1.70c 2012-11-16
Page 24(39)