%% Sinc pulse train
close all; clc; clear;

T = 0.1; % Pulse width? 

Ts = 4*T; % Symbol time.

A = [-1 1]

v = @(t,Ts) sinc((t-Ts)./T);

t = -1:0.001:4; % Time axis

subplot(211); hold on;grid on

s_sum = 0;
for i = 0:4
    if i == 1|| i==3
        s = A(1)*v(t,i*Ts)
    else
        s = A(2)*v(t,i*Ts)
    end
    s_sum = s_sum + s;
    
    plot(t,s);
end

subplot(212);
snr = 2;
s_noise = awgn(s_sum, snr);
plot(t, s_sum);
hold on
plot(t, s_noise);

grid on

