New Alamouti
New Alamouti
% Create two comm.AWGNChannel System objects for one and two receive
% antennas respectively. Set the NoiseMethod property of the channel to
% 'Signal to noise ratio (Eb/No)' to specify the noise level using the
% energy per bit to noise power spectral density ratio (Eb/No). The output
% of the BPSK modulator generates unit power signals; set the SignalPower
% property to 1 Watt.
awgn1Rx = comm.AWGNChannel('NoiseMethod', 'Signal to noise ratio
(Eb/No)','SignalPower', 1);
awgn2Rx = clone(awgn1Rx);
ax.YScale = 'log';
xlim(ax,[EbNo(1), EbNo(end)]);
ylim(ax,[1e-4 1]);
xlabel(ax,'Eb/No (dB)');
ylabel(ax,'BER');
fig.NumberTitle = 'off';
fig.Renderer = 'zbuffer';
fig.Name = 'Transmit vs. Receive Diversity';
title(ax,'Transmit vs. Receive Diversity');
fig.Position = figposition([15 50 25 30]);
% Modulate data
modData = step(bpskMod,data);
% Add AWGN
rxSig21 = step(awgn1Rx,chanOut21);
% Plot results
semilogy(ax,EbNo(1:idx), ber_Alamouti(1,1:idx), 'go');
legend(ax,'Alamouti (2Tx, 1Rx)');
drawnow;
end % end of for loop for EbNo