![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/579287/image.png)
how to convert sawtooth signal to a ramp signal
14 views (last 30 days)
Show older comments
Shah Rukh Sohail Janjua
on 9 Apr 2021
Edited: Shah Rukh Sohail Janjua
on 10 Apr 2021
Hi!
I'm calculating the angle of a complex number and it is coming out as sawtooth wave of 0 to 2pi limit. I want to convert it to a continiously increasing angle. I mean i dont want the angle to go back to 0 after every period. The angle should go on forever from 0 to 2pi 3pi 4pi and so on. I'm attaching a snap to make my question clear. The blue graph is what i get and i want it to convert it to yellow graph, Also i'm using fixed descrete step discret simulink model. Thanks
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/578792/image.jpeg)
0 Comments
Accepted Answer
DGM
on 10 Apr 2021
I imagine what you want is unwrap:
t = linspace(0,3*2*pi,1000);
raw = atan2(sin(t),cos(t));
unwrapped = unwrap(raw);
plot(t,raw,t,unwrapped)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/579287/image.png)
1 Comment
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!