Generating trapezoidal wave given plateau duration and total length of impulse train
Hello,
I want to plot a trapezoidal wave train knowing only the plateau times, meaning the duration of the "flat part" of the trapezoidal wave, and the total duration of the impulse train, depending on another data vector I have. I do not have the equation of the ascending or descending parts, even though I can calculate them. But I need an easy way to plot this in matlab.
The plateaus need to be 60 seconds long and total number of points needs to be equal to the length of a data vector A.
So far I only found the trapezoidal equation with some parameters:
a = 0.5 %Amplitude
m = 9.55 % Time Period
l = 3*pi/2 % phase
c = a/2 % offset
x = 0:.1:100 %Sample Points
Trapezoidal_Wave = a/pi*(asin(sin((pi/m)*x+l))+acos(cos((pi/m)*x+l)))-a/2+c;
plot(x, Trapezoidal_Wave)
However I cannot control the plateau duration (or I don’t understand how). Any help and any better way to do this would be greatly appreciated. Thank you!Hello,
I want to plot a trapezoidal wave train knowing only the plateau times, meaning the duration of the "flat part" of the trapezoidal wave, and the total duration of the impulse train, depending on another data vector I have. I do not have the equation of the ascending or descending parts, even though I can calculate them. But I need an easy way to plot this in matlab.
The plateaus need to be 60 seconds long and total number of points needs to be equal to the length of a data vector A.
So far I only found the trapezoidal equation with some parameters:
a = 0.5 %Amplitude
m = 9.55 % Time Period
l = 3*pi/2 % phase
c = a/2 % offset
x = 0:.1:100 %Sample Points
Trapezoidal_Wave = a/pi*(asin(sin((pi/m)*x+l))+acos(cos((pi/m)*x+l)))-a/2+c;
plot(x, Trapezoidal_Wave)
However I cannot control the plateau duration (or I don’t understand how). Any help and any better way to do this would be greatly appreciated. Thank you! Hello,
I want to plot a trapezoidal wave train knowing only the plateau times, meaning the duration of the "flat part" of the trapezoidal wave, and the total duration of the impulse train, depending on another data vector I have. I do not have the equation of the ascending or descending parts, even though I can calculate them. But I need an easy way to plot this in matlab.
The plateaus need to be 60 seconds long and total number of points needs to be equal to the length of a data vector A.
So far I only found the trapezoidal equation with some parameters:
a = 0.5 %Amplitude
m = 9.55 % Time Period
l = 3*pi/2 % phase
c = a/2 % offset
x = 0:.1:100 %Sample Points
Trapezoidal_Wave = a/pi*(asin(sin((pi/m)*x+l))+acos(cos((pi/m)*x+l)))-a/2+c;
plot(x, Trapezoidal_Wave)
However I cannot control the plateau duration (or I don’t understand how). Any help and any better way to do this would be greatly appreciated. Thank you! plotting, impulse, trapezoidal MATLAB Answers — New Questions