generating periodic trapezoidal waves with ramps
Hello,
I want to generate a periodic trapezoidal wave that has ‘ramps’ on both sides of the wave structure. I was able to generate square waves that does not have ramps using the following codes.
Pwr_avg = 200; % [W] average input power
nu_p = 2e3; % [Hz]=[1/s] pulse repetition frequency
tau_p = 1/nu_p; % [s] pulsed period
f_DC = 0.15; % [%] duty cycle (=fraction of the pulsed period power is on)
tau_on = tau_p * f_DC; % [s] length of time power is on during each pulsed period
tau_ramp = 1e-6; % [s] ramp up/down time
Pwr_max = Pwr_avg * (tau_p/tau_on); % [W] maximum power during the pulsed period during 0<t<=tau_on
Pwr_min = 1e-4; % [W] arbitrary small value during the ‘off’ period
d = tau_on/2:tau_p:t_max;
Pwr = Pwr_max * pulstran(t_array,d,’rectpuls’,tau_on); % generate periodic power input
Pwr(Pwr==0) = Pwr_min; % assign arbitrary small power input during ‘off’ period
Pwr = Pwr / (pi*r_cyl^2*l_cyl) * 1e3; % [mW/cm3] input power array
The code above use pulse train function to generate periodic structure, which is used to simulate pulsed power. The absolute zero values for the power is not ideal for my application, so I assigned arbitrary small value when the power is ‘off’.
Here, I would like to introduce a ramp up/down time as the power increases from zero, and decreases back to zero. So the pulsed waveform will become trapezoid that has steep ramps. I would like to know how to add ramps on this square wave or if Matlab already has inherent function I can use.
Thank you for your timeHello,
I want to generate a periodic trapezoidal wave that has ‘ramps’ on both sides of the wave structure. I was able to generate square waves that does not have ramps using the following codes.
Pwr_avg = 200; % [W] average input power
nu_p = 2e3; % [Hz]=[1/s] pulse repetition frequency
tau_p = 1/nu_p; % [s] pulsed period
f_DC = 0.15; % [%] duty cycle (=fraction of the pulsed period power is on)
tau_on = tau_p * f_DC; % [s] length of time power is on during each pulsed period
tau_ramp = 1e-6; % [s] ramp up/down time
Pwr_max = Pwr_avg * (tau_p/tau_on); % [W] maximum power during the pulsed period during 0<t<=tau_on
Pwr_min = 1e-4; % [W] arbitrary small value during the ‘off’ period
d = tau_on/2:tau_p:t_max;
Pwr = Pwr_max * pulstran(t_array,d,’rectpuls’,tau_on); % generate periodic power input
Pwr(Pwr==0) = Pwr_min; % assign arbitrary small power input during ‘off’ period
Pwr = Pwr / (pi*r_cyl^2*l_cyl) * 1e3; % [mW/cm3] input power array
The code above use pulse train function to generate periodic structure, which is used to simulate pulsed power. The absolute zero values for the power is not ideal for my application, so I assigned arbitrary small value when the power is ‘off’.
Here, I would like to introduce a ramp up/down time as the power increases from zero, and decreases back to zero. So the pulsed waveform will become trapezoid that has steep ramps. I would like to know how to add ramps on this square wave or if Matlab already has inherent function I can use.
Thank you for your time Hello,
I want to generate a periodic trapezoidal wave that has ‘ramps’ on both sides of the wave structure. I was able to generate square waves that does not have ramps using the following codes.
Pwr_avg = 200; % [W] average input power
nu_p = 2e3; % [Hz]=[1/s] pulse repetition frequency
tau_p = 1/nu_p; % [s] pulsed period
f_DC = 0.15; % [%] duty cycle (=fraction of the pulsed period power is on)
tau_on = tau_p * f_DC; % [s] length of time power is on during each pulsed period
tau_ramp = 1e-6; % [s] ramp up/down time
Pwr_max = Pwr_avg * (tau_p/tau_on); % [W] maximum power during the pulsed period during 0<t<=tau_on
Pwr_min = 1e-4; % [W] arbitrary small value during the ‘off’ period
d = tau_on/2:tau_p:t_max;
Pwr = Pwr_max * pulstran(t_array,d,’rectpuls’,tau_on); % generate periodic power input
Pwr(Pwr==0) = Pwr_min; % assign arbitrary small power input during ‘off’ period
Pwr = Pwr / (pi*r_cyl^2*l_cyl) * 1e3; % [mW/cm3] input power array
The code above use pulse train function to generate periodic structure, which is used to simulate pulsed power. The absolute zero values for the power is not ideal for my application, so I assigned arbitrary small value when the power is ‘off’.
Here, I would like to introduce a ramp up/down time as the power increases from zero, and decreases back to zero. So the pulsed waveform will become trapezoid that has steep ramps. I would like to know how to add ramps on this square wave or if Matlab already has inherent function I can use.
Thank you for your time pulse train MATLAB Answers — New Questions