[Math] Derivative of Sawtooth wave

derivativesMATLAB

I am trying to take derivative of saw-tooth like pulse in matlab. enter image description here

In result, I am getting this thing:enter image description here

I am confused whether it is correct or not and it looks strange to me as well. I tried to take the derivative of sin wave and looks ok:
enter image description here

Please let me know whether I am doing right of wrong

Corrected plot after removing the plot of actual data.enter image description here

Best Answer

You have a problem with scaling in your second picture. It looks like you have plotted the derivative in the same window as the original vector. The negative pulses in the derivative due to the jumps in the original signal are barely visible. Try plotting the derivative by itself and you'll get a nicer view.

Related Question