% plot_TxExampleOrth - plot waveform for orthogonal signal example

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

%% ... and plot
plot(tt, TXSignal)
axis([0 length(b) -(A+1) (A+1)]);
grid
xlabel('Time/T')
ylabel('Amplitude')

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