% plot_RXExampleMulti - illustration  of multi-path
%
% this is merely an illustration and does not include Q-component

%% Parameters
b = [ 1 0 1 1 0 0 1 0 1 0];      %symbol sequence
fsT = 20;                        % samples per symbol period
A = 3;

Signals = A*[ ones(1,fsT);       % signals, one per row
              ones(1,fsT/2) -ones(1,fsT/2)];

tt = 0:1/fsT:length(b)-1/fsT;    % time axis for plotting
          
%% generate signal ...
TXSignal = [];
for kk=1:length(b)
    TXSignal = [ TXSignal Signals( b(kk)+1, : ) ];
end

% simulate filter by a sequence of Gaussians with exponentially 
% decaying variance.
coeff = randn(1,2*fsT).*exp(-(0:39)/(2*fsT))/sqrt(2*fsT);
RXSignal = conv(coeff, TXSignal);
ttr = ((1:length(RXSignal))-1)/fsT;

%% ... and plot
plot(tt, TXSignal,ttr,RXSignal)
grid
axis([0 max(ttr) -5 5])
xlabel('Time/T')
ylabel('Amplitude')
%legend('Transmitted','Received')

%% Store name of script for automated figure generation
ScriptName = mfilename;