Derivative of Sawtooth wave?

5.4k Views Asked by At

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

3

There are 3 best solutions below

3
On 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.

0
On

The correct plot of the derivative is probably the one which seems like almost constant zero since you have wrong scale of $y$-axis on the plot of the derivation – the original saw tooth has $Δy$ only in scale of $0.01$ but you plot hundreds on the derivative plot. The second near 200 constant line is the plot of the original saw tooth. You shouldn't plot the saw tooth and the derivation in the same picture since they have very different values and small variations.

0
On

It looks fine. The little pulses coincident with the ratchet drops are like undersampled Dirac deltas. You need to increase the sample rate to get better resolution.