The wave form what is observed in the electronic circuits are exaponential waves, not triangular waves. If u keep the leniority of the exponential then it will look like triangle. so may be the linearity should be kept in the requested range.. check it...
Let Vp = the peak value of the triangle.
Let Delta = the absolute value of the maximum deviation between the generated triangle wave segment and a perfect straight line from 0 to the peak value.
Linearity = (Delta/Vp) * 100.
Regards,
Kral
You can take the traiangular wave and then use curve fitting algorithm in MATLab. Then remove an ideal Triangular wave from it. What ever is left is non-linearity (distortion).