Pulstran function to generate biphasic pulses
How can I correct following code to get pulses like on the picture? I don’t get correct shape of pulses.
Parameters: N = 400 (number of pulses), Tp = 1 (pulse width), d1 = 1 (interphase delay [us]), d2 = 1 (interpulse delay [us]). Let’s say the U0=1V. It should look like this:
number_of_points_on_interval = 1000;
t = linspace(0, 1.6, 10000);
Tp = 0.001; %pulse width [ms]
d1 = 0.001; %interphase delay [ms]
d2 = 0.001; %interpulse delay [ms]
dPos = 0.001:(d1+Tp+d2):1.6; % times when positive pulses start
dNeg = dPos + Tp + 0.001; % times when negative pulses start
dT = [dPos dNeg]’; % times of pulses
% Amplitude of positive and negative pulses
U=1;
dAmp = [U*ones(numel(dPos),1); -1 * U*ones(numel(dNeg),1)];
% generating a signal with rectangular pulses
y = pulstran(t,[dT dAmp],’rectpuls’,Tp);
plot(t,y)
ylim paddedHow can I correct following code to get pulses like on the picture? I don’t get correct shape of pulses.
Parameters: N = 400 (number of pulses), Tp = 1 (pulse width), d1 = 1 (interphase delay [us]), d2 = 1 (interpulse delay [us]). Let’s say the U0=1V. It should look like this:
number_of_points_on_interval = 1000;
t = linspace(0, 1.6, 10000);
Tp = 0.001; %pulse width [ms]
d1 = 0.001; %interphase delay [ms]
d2 = 0.001; %interpulse delay [ms]
dPos = 0.001:(d1+Tp+d2):1.6; % times when positive pulses start
dNeg = dPos + Tp + 0.001; % times when negative pulses start
dT = [dPos dNeg]’; % times of pulses
% Amplitude of positive and negative pulses
U=1;
dAmp = [U*ones(numel(dPos),1); -1 * U*ones(numel(dNeg),1)];
% generating a signal with rectangular pulses
y = pulstran(t,[dT dAmp],’rectpuls’,Tp);
plot(t,y)
ylim padded How can I correct following code to get pulses like on the picture? I don’t get correct shape of pulses.
Parameters: N = 400 (number of pulses), Tp = 1 (pulse width), d1 = 1 (interphase delay [us]), d2 = 1 (interpulse delay [us]). Let’s say the U0=1V. It should look like this:
number_of_points_on_interval = 1000;
t = linspace(0, 1.6, 10000);
Tp = 0.001; %pulse width [ms]
d1 = 0.001; %interphase delay [ms]
d2 = 0.001; %interpulse delay [ms]
dPos = 0.001:(d1+Tp+d2):1.6; % times when positive pulses start
dNeg = dPos + Tp + 0.001; % times when negative pulses start
dT = [dPos dNeg]’; % times of pulses
% Amplitude of positive and negative pulses
U=1;
dAmp = [U*ones(numel(dPos),1); -1 * U*ones(numel(dNeg),1)];
% generating a signal with rectangular pulses
y = pulstran(t,[dT dAmp],’rectpuls’,Tp);
plot(t,y)
ylim padded pulstran, pulses, biphasic, rectangular MATLAB Answers — New Questions