The sawtooth wave has a positive and a fixed slope. In case of generating the wave the step size defines the frequency of the sawtooth wave. The following lines of code are used to simulate a sawtooth waveform.
for(j=0;j<1024;j++)
{
if(y>1.00)
{
w=0.00;
}
sawtooth[j]=y;
y=y+0.5;
}
Figure shows two sawtooth waveforms of different frequencies. The first wave with F=4 KHz and the second wave with F=1 KHz. The step sizes taken were 0.5 and 0.125 respectively
No comments:
Post a Comment