Forum Discussion
Altera_Forum
Honored Contributor
11 years agoHere you are generating a half sine wave. The range of a full wave would be 0 to 2*pi. I also think that the division factor should be 500.0 instead of 499.0.
for i in 0 to 499 loop
x:= SIN(real(i)*MATH_PI/real(499)); You want something like this for i in 0 to 499 loop
x:= SIN(real(i)*2.0*MATH_PI/500.0); Secondly, your counters are counting one step too much, e.g. incSineTable counts 498, 499, 500, 0, 1 ...