Sine Approximation - Analog Devices adsp-2100 Manual

Adsp-2100 family programmable single-chip microprocessors
Table of Contents

Advertisement

M3 = (1 - length of delay line buffer)
Return Value:
SR1 = output sample Y(n)
Altered Registers:
SE, MX0, MX1, MY0, MR, SR
Computation Time (with N even):
ADSP-2101/2102: (8 x N/2) + 5 cycles
ADSP-2100/2100A: (8 x N/2) + 5 + 5 cycles
All coefficients and data values are assumed to
be in 1.15 format
}
.ENTRY
biquad;
biquad:
CNTR = number_of_biquads
DO sections UNTIL CE;
SE=DM(I1,M2);
MX0=DM(I0,M0), MY0=PM(I4,M4);
MR=MX0*MY0(SS), MX1=DM(I0,M0), MY0=PM(I4,M4);
MR=MR+MX1*MY0(SS), MY0=PM(I4,M4);
MR=MR+SR1*MY0(SS), MX0=DM(I0,M0), MY0=PM(I4,M4);
MR=MR+MX0*MY0(SS), MX0=DM(I0,M1), MY0=PM(I4,M4);
DM(I0,M0)=MX1, MR=MR+MX0*MY0(RND);
sections:
DM(I0,M0)=SR1, SR=ASHIFT MR1 (HI);
DM(I0,M0)=MX0;
DM(I0,M3)=SR1;
RTS;
.ENDMOD;
Listing 14.2 Cascaded Biquad IIR Filter
14.5

SINE APPROXIMATION

The following formula approximates the sine of the input variable x:
sin(x) = 3.140625x + 0.02026367x
The approximation is accurate for any value of x from 0˚ to 90˚ (the first
quadrant). However, because sin(–x) = –sin(x) and sin(x) = sin(180˚ – x),
you can infer the sine of any angle from the sine of an angle in the first
Software Examples
{Loop once for each biquad}
{Scale factor for biquad}
2
– 5.325196x
3
4
+ 0.5446778x
+ 1.800293x
14
5
14 – 7

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents