F
FPGA
Guest
I have written a process to generate sin wave as below.
-- sine wave constants
amp_sin : real := 10.0;
phase_sin : real := 0.0 --
phase in radians
samples_sin : integer :=
1000; -- number of
samples
incr_sin : real := 0.001; -- 1/
samples
period_sin : time := 0.001
ns; -- period of
sine wave/samples
two : process
variable phase_temp,result : real ;
begin
phase_temp := phase_sin; --phase_sin;
l1 : for i in 1 to samples_sin loop --number_of_samples loop
sine_real <= ((amp_sin*sin(phase_temp)));
phase_temp := phase_temp + incr_sin;
wait for period_sin;
end loop l1;
end process two;
The problem I am facing is, I get sine wave for some values and for
some I just get triangulr wave. Is there any limitation to the sin
function in math_real. Should I be able to generate any type of
frequencies with this function. Please help
-- sine wave constants
amp_sin : real := 10.0;
phase_sin : real := 0.0 --
phase in radians
samples_sin : integer :=
1000; -- number of
samples
incr_sin : real := 0.001; -- 1/
samples
period_sin : time := 0.001
ns; -- period of
sine wave/samples
two : process
variable phase_temp,result : real ;
begin
phase_temp := phase_sin; --phase_sin;
l1 : for i in 1 to samples_sin loop --number_of_samples loop
sine_real <= ((amp_sin*sin(phase_temp)));
phase_temp := phase_temp + incr_sin;
wait for period_sin;
end loop l1;
end process two;
The problem I am facing is, I get sine wave for some values and for
some I just get triangulr wave. Is there any limitation to the sin
function in math_real. Should I be able to generate any type of
frequencies with this function. Please help