% ECE464 - Lab02 -- Delay Spread --- bkf@comm.utoronto.ca
% code to be run on Part A, B and C 
% make sure you run the Part A model for about 5 seconds

clear rrx, clear ttx, close all
rrx=rx(:,1:48000);
ttx=tx(:,1:48000);

% time domain -- RED IS TRANSMITTED, BLUE IS RECEIVED
% what's happening?
figure
subplot(2,1,1), plot(ttx(1:5000),'r')
title('Transmitted Signal'), axis([0 5000 -2 2])
subplot(2,1,2), plot(rrx(1:5000))
title('Received Signal'), axis([0 5000 -2 2])

% frequency domain - RED IS TRANSMITTED, BLUE IS RECEIVED

ztx=abs(fft(ttx,2048));
zrx=abs(fft(rrx,2048));
figure, plot(zrx(1:1024)), hold, plot(ztx(1:1024),'r')
title('Transmitted and Received Signal - Frequency Domain')