how to convert sawtooth signal to a ramp signal

조회 수: 11 (최근 30일)
Shah Rukh Sohail Janjua
Shah Rukh Sohail Janjua 2021년 4월 9일
편집: Shah Rukh Sohail Janjua 2021년 4월 10일
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

채택된 답변

DGM
DGM 2021년 4월 10일
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)
  댓글 수: 1
Shah Rukh Sohail Janjua
Shah Rukh Sohail Janjua 2021년 4월 10일
편집: Shah Rukh Sohail Janjua 2021년 4월 10일
Thanks alot for the hint. I found an unwrap block in simulink to solve my problem.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Signal Attributes and Indexing에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by