how to generate below sawtooth pulse

조회 수: 2 (최근 30일)
nune pratyusha
nune pratyusha . 2021년 5월 17일
댓글: Star Strider . 2021년 7월 19일
and what is pulse number and how it generates in matlab
  댓글 수: 1
Adam Danz
Adam Danz 2021년 5월 17일
Do you have the signal processing toolbox? If so, see sawtooth.
Have you searched the forum for an answer because this question has definitely been addressed.

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

답변 (2개)

DGM 2021년 5월 17일
편집: DGM 님. 2021년 5월 17일
The super-explicit way:
x = [0 1 1 2 3 3 4 5 5 6 7 7];
y = [0 1 0 0 1 0 0 1 0 0 1 0];
You could build those sequences any number of ways. Here's one:
xp = 0:2:7;
x = reshape(xp+[0 1 1].',1,[]);
y = reshape(xp+[0 1 0].',1,[]);
y = mod(y,2);
You could also use SPT tools:
x = linspace(0,7,1000);
y = max(sawtooth(pi*(x-1)),0);

Star Strider
Star Strider 2021년 5월 17일
Another approach using a logical threshold (specific to this waveform) —
t = linspace(0, 7, 500);
s = rem(t,2);
s = s.*(s<1);
plot(t, s, 'LineWidth',2)
axis([0 7.1 0 1.1])
  댓글 수: 8
Star Strider
Star Strider 2021년 7월 19일
Two months!
In this instance, pulse width is one-half the period, and the period is the time between peaks. Several functions, such as findpeaks, islocalmax, islocalmin, and others are useful here.

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


Help CenterFile Exchange에서 Pulse and Transition Metrics에 대해 자세히 알아보기





Community Treasure Hunt

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

Start Hunting!

Translated by