Time is being implied in your phase assignment. But you are not coding the

frequency generation correctly.

You code mathematiclly is saying the following

y=A*sin(fq+x)

x=x+c

Where fq is frq_sin, and c is incr_sin the sin wave cycle lasts from 0 to

2PI. There is no time or frequency associated with it. Your fq is just

offseting the start point not seting a period. What you want to do is the

following.

x=x+c

y=A*sin(2*PI*fq*x)

now remember that x is being incremented in time. fq is in hz. You need to

inverse fq to get your period time. which yeilds.

x=x+c;

y=A*sin(2*PI*x/tp)

where tp is the cycle length.

Your code should look like so:

for i in 1 to samples_sin loop

result:= scale*(amp_sin*(sin(2.0*PI*frq_sin*phase_temp);

sine_real<=(amp_sin*(sin(2.0*MATH_PI*frq_sin*phase_temp);

sineWave<=toSigned(result,bw)

phase_temp:= phase_temp+incr_sin;

wait for 5 ns; ---Note: This 5ns is not setting the actual frequncy result

with this code

end loop;

--to see a full sine wave cycle set the following:

phase_sin=0.0;

frq_sin=1000; --(1khz)

samples_sin=1000;

incr_sin=0.000001--(1ms/1000 samples)

With this code the "5ns" doesn't do anything constructive. But you could

change the code to make it useful

If you want the time display of the code to match the values that are given

in my comments use "wait for 1us"

Just looking at the time display based on the above code would apear to have

a 200MHZ

sign wave. (1us/5ns)=200, 200*(1 khz)=200Mhz

Your frq_sin value is actually just a phase offset. There is no time

associated with this constant to feed the sin(). The phase_temp, on

the other hand, is effectively t*incr_sin where t is a cycle count.

To see the frequency change, change the incr_sin value instead.

In what way is your sine distorted?

- John_H- Hide quoted text -

- Show quoted text -

How can I pass time parameter to the sineWave? I was able to remove

the distortion by reducing the incr_sin value. Still not clear on the

frequency and time parameter that you are talking about.