Algorithm 1 Cubic Hermite interpolation for DDFS. |
Input: Phase accumulator, ROM //Phase increment and ROM with nodes and derivatives
Output: Output waveform value
-
1:
Main Function: DDFS
-
2:
Initialize , ROM
-
3:
while system running do
-
4:
-
5:
adjustPhase()
-
6:
ROM[]
-
7:
ROM[ + 1]
-
8:
cubicHermiteInterpolation(, , , , , , )
-
9:
output through DAC and LPF
-
10:
end while
-
11:
-
12:
Function cubicHermiteInterpolation(x, , , , , , ):
-
13:
//Calculate the relative position
-
14:
//Hermitian basis function
-
15:
-
16:
-
17:
-
18:
-
19:
return
-
20:
-
21:
Function adjustPhase() //Adjust phase using single-quadrant storage method
-
22:
if
then
-
23:
-
24:
-
25:
else if then
-
26:
-
27:
-
28:
else if then
-
29:
-
30:
-
31:
else
-
32:
-
33:
-
34:
end if
-
35:
return
|