%% Periodic Gaussian Pulse
% Plot a 10 kHz Gaussian RF pulse with 50% bandwidth, sampled at a rate of 10 MHz. Truncate the pulse where the envelope falls 40 dB below the peak.

fs = 1e7;
tc = gauspuls('cutoff',10e3,0.5,[],-40); 
t = -tc:1/fs:tc; 
x = gauspuls(t,10e3,0.5); 

plot(t,x)
xlabel('Time (s)')
ylabel('Waveform')

%
% The pulse repetition frequency is 1 kHz, the sample rate is 50 kHz, and the pulse train length is 25 ms. The gain factor is a sinusoid of frequency 0.1 Hz.

ts = 0:1/50e3:0.025;
d = [0:1/1e3:0.025;sin(2*pi*0.1*(0:25))]';
y = pulstran(ts,d,x,fs);

%
% Plot the periodic Gaussian pulse train.

plot(ts,y)
xlim([0 0.01])
xlabel('Time (s)')
ylabel('Waveform')

%
% Copyright 2015 The MathWorks, Inc.