Reputation: 31
i'm new in Simulink and I'm using interpreted MATLAB function block to create a gaussian pulse generator.
This is the function:
function y=mono_gauss(t)
fs=20E9; %sample rate-10 times the highest frequency
ts=1/fs; %sample period
t1=.5E-9; %pulse width(0.5 nanoseconds)
x=(t/t1).*(t/t1); %x=(t^2/t1^2)(square of (t/t1);
A=1;
y=(A*(t/t1)-ts).*exp(-x); %first derivative of Gaussian pulsefunction
end
The problem is that the output of the block generate only one pulse and my objective is to generate a train of pulses just like a pulse generator block. Any solutions ?
Upvotes: 0
Views: 843
Reputation: 10772
You're most likely better off designing your pulse in MATLAB, then using the Repeating Sequence to use it in Simulink.
For instance, in MATLAB
t = 0:0.01:1;
y = normpdf(t,0.5,0.05);
plot(t,y)
Then within Simulink,
I have also changed the step size of the model Solver to be 0.01.
You'll need to play around with various of these parameters to get the exact curve you desire.
Upvotes: 0