% hPositioningPlotRx Plot received waveforms
%   hPositioningPlotRx(ENB,RX,SR) plots each receive waveform in the cell
%   array RX at each eNodeB in the cell array ENB with sampling rate SR.

%   Copyright 2011-2015 The MathWorks, Inc.

function hPositioningPlotRx(enb,rx,sr)

    colors = hPositioningColors();
    figure
    hold on;

    t = (0:(sr*1e-3)-1)/sr;  % Calculate time of samples

    % For each eNodeB plot the received waveform
    legendstr = cell(1, numel(rx));
    for i = 1:numel(rx)
        signal = abs(rx{i});
        plot(t, signal(1:(sr*1e-3),:), colors{i}, 'LineWidth', 2);
        legendstr{i} = sprintf('enb%d (NCellID=%d)',i,enb{i}.NCellID);
    end
    legend(legendstr);
    xlabel('Time (s)');
    ylabel('Absolute value');
    title('Received waveforms at UE location');

end
