AN2274 Freescale Semiconductor / Motorola, AN2274 Datasheet - Page 3
![no-image](/images/no-image-200.jpg)
AN2274
Manufacturer Part Number
AN2274
Description
Generic Tone Generation on the StarCore SC140 Core
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
1.AN2274.pdf
(20 pages)
(
x 2 –
A digital oscillator requires the following initializations:
The following table shows the computation of initial conditions:
x 1 –
For a pre-defined number of target frequencies, the initialization values can be pre-computed. However, a generic
tone generation requires the computation with high precision for any frequency. A polynomial approximation,
described in the following section, is employed for this calculation.
1.2 Polynomial Approximation
A polynomial approximation is used to compute the cosine necessary to initialize the digital oscillator. This method
uses the Taylor's expansion of a cosine:
Replacing x with the following:
and defining the normalized frequency as follows yields Equation 3:
Freescale Semiconductor
(
(
)
)
=
=
±
±
•
•
amplitude
amplitude
The coefficient
The two initial conditions: x(–1) and x(–2)
COSINE Initialization
)
×
coefficient
--------------------------- -
Generic Tone Generation on the StarCore™ SC140/SC1400 Cores, Rev. 1
2
=
amplitude
cos
cos
(
2πf
×
x ( )
cos
n
)
⎛
⎝
=
=
2πf
--------
f
2.
s
k
k
⎞
⎠
∑
cos
∑
f
∞
=
∞
=
n
2πf f
0
0
=
a
(
b
2πf f
k
k
x
(
⁄
f f
f
x 1 –
x
2k
n
2k
(
⁄
– ( )
s
⁄
,
,
s
2
)
b
a
s
k
=
k
)
=
0
=
=
±
amplitude
(
(
------------ -
(
2π
1 –
2k
)
)
)!
2k
k
a
)
SINE Initialization
k
×
sin
2πf
---------- -
f
s
Digital Sine Wave Generation
=
amplitude
×
cos
Equation 2
Equation 3
⎛
⎜
⎝
2πf
------- -
f
s
–
π
-- -
2
⎞
⎟
⎠
3