% 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:100000);
ttx=tx(:,1:100000);

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

% frequency domain - RED IS TRANSMITTED, BLUE IS RECEIVED

ztx=abs(fft(ttx,2048));
zrx=abs(fft(rrx,2048));
figure, stem(zrx(1:1024))
Title('Red is TRANSMITTED, Blue is RECEIVED')
hold, stem(ztx(1:1024),'r')
axis([0 1024 0 1200])