how to generate below sawtooth pulse

5 visualizaciones (últimos 30 días)
nune pratyusha
nune pratyusha el 17 de Mayo de 2021
Comentada: Star Strider el 19 de Jul. de 2021
and what is pulse number and how it generates in matlab
  1 comentario
Adam Danz
Adam Danz el 17 de Mayo de 2021
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.

Iniciar sesión para comentar.

Respuestas (2)

DGM
DGM el 17 de Mayo de 2021
Editada: DGM el 17 de Mayo de 2021
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];
plot(x,y)
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);
plot(x,y)
You could also use SPT tools:
x = linspace(0,7,1000);
y = max(sawtooth(pi*(x-1)),0);
plot(x,y)

Star Strider
Star Strider el 17 de Mayo de 2021
Another approach using a logical threshold (specific to this waveform) —
t = linspace(0, 7, 500);
s = rem(t,2);
s = s.*(s<1);
figure
plot(t, s, 'LineWidth',2)
grid
axis([0 7.1 0 1.1])
.
  8 comentarios
nune pratyusha
nune pratyusha el 19 de Jul. de 2021
but how to give pulse width and pulse period for above sawtooth signal
Star Strider
Star Strider el 19 de Jul. de 2021
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.
.

Iniciar sesión para comentar.

Etiquetas

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by