increased or decreased with time. Thanks.
I really don't understand why you're having a problem. Have you
tried functions of the form t^n .* exp(-a*t) ?
Hope this helps.
Greg
I want to produce a square pulse with increasing amplitude with time.
As you know, in simulink, in pulse generator, we can produce a square
pulse with constant amplitude only.
The function that you gave is
t = -10:0.1:10;
n=2;
a=2;
y6=(t.^n).*exp(-a.*t)
I cannot generate the rectangular pulse!! why? Thanks so much for
your quick response...
Sam
There is a 'Signal Builder' block (with R14 anyway) that allows you
to manipulate the signal graphically.
If you do not have this block I will try to help but please bear with
me. If I understand correctly, you are trying to create a single
'sawtooth', something that looks like this ...
/|
/ |
/ |
_____/ |____
If this is correct, it can be accomplished in Simulink by using a
combination of a ramp, a step, a ground, and a switch. The ramp
generates the sloped portion. The step tells the switch to pass
through the ground signal (bring the value of the signal back to
zero).
I hope this helps.
Thanks for your reply. In order to attach the cycles, I can only send
you e-mail instead post on web site. You can see that cycles that I
need is pulse cycles with increasing amplited. In fact, I try to
combine pulse generator and the ramp only, but it is not good,
because the rectangular is not good at shape when the period is
decreased. Thanks for opinion.Also, I have signal builder, but I
found I can only make a one pulse for one signal. But I want many
pulse with time, for example, 100 pulse with 1000 s, thanks for idea.
Sam
******************************************************
Ah, I get it now. I found a quick and dirty solution that involves 6
blocks.
1) Ramp
2) Gain (augments ramp signal to determine pulse magnitude with
respect to time)
3) Zero-Order Hold (samples ramp signal and keeps the value constant
for the duration of the pulse)
4) Switch (to alternate between ramp and and baseline value)
5) Ground (or Constant) (to generate baseline value)
6) Pulse Generator (to drive the switch)
The Pulse Generator tells the switch to either pass through the
ground signal or the discrete ramp signal. The end result is pulses
that increase in magnitude (or decrease depending on the sign of the
gain and the initial output of the ramp) with respect to time.
Here is the key...
The sample time of the Zero-Order Hold block needs to be identical to
the period of the Pulse Generator block (assuming 50% pulse width).
As an added bonus, I'll send you my file.
Your original post was not clear. I thought you wanted a single non-constant
amplitude pulse.
It looks like you want to generate a "rectangular" (not square) pulse
"train"
(not a single pulse) with successive pulses varying in magnitude.
This can be done by multiplying a constant amplitude rectangular pulse train
by a modulating function. However, I'm not familiar with Simulink, so ...
Hope this helps.
Greg
Your original post was not clear. I thought you wanted a single non-constant
amplitude pulse.
It looks like you want to generate a "rectangular" (not square) pulse"train"
(not a single pulse) with successive pulses varying in magnitude.
This can be done by multiplying a constant amplitude rectangular pulse train
by a modulating function. However, I'm not familiar with Simulink, so ...
Hope this helps.
Greg
>