You are on page 1of 5

LAB 10

Investigation of Inter Symbol Interference and Eye Diagram using


MATLAB.

Submitted By: Muhammad Maab Nawaz


FA21-EEE-021

Submitted To: Dr. GHUFRAN SHAFIQ

Submission Date: 2 1 /12/2023


Without Noise and filters

With noise and filter


Code
1. clear all; close all; clc;
2. signal = randi([0 1],1,100);
3. fs = 1000;
4. T = 1/fs;
5. time = 0:1/fs:1-1/fs;
6. Fullbitspace=-ones(1, (length(time)));
7. Fullbitone=ones(1, (length(time)));
8. x=[];
9. for i = 1:length(signal)

10. if signal(i) == 1
11. x((i-1)*length(time)+1:i*length(time)) = Fullbitone;
12. else
13. x((i-1)*length(time)+1:i*length(time)) = Fullbitspace;
14. end
15. end
16. figure();
17. plot(x,linewidth=3)
18. ylim([-10 10])
19. xlim([0 40000])
20. title('polarNRZ');
21. grid on;
22. grid minor
23. tb=0.1;
24. f=1/tb;
25. wn=tb/2;
26. n=1000;
27. start=1;
28. endpoint=length(Fullbitone);
29. figure(2);
30. for i=1:length (signal)
31. start=endpoint+1;
32. endpoint=endpoint+length(Fullbitone);
33. temp=x(start:endpoint);
34. %i=i+length(pulse);
35. h=fir1(n,wn);
36. channel=conv(temp,h);
37. noise=awgn(channel,5);
38. match_out=conv(Fullbitone,noise);
39. plot(match_out,'k')

40. hold on
41. end
42. grid on;
Post Lab
1.
2.
3. clear all; close all; clc;
4. t=0:0.001:5;
5. signal=randi([0 1],1,100);
6. tb=0.1;
7. f=1/tb;
8. fs=10*f;
9. sample_time=fs/f;
10. wn=tb/2;
11. % Original pulse
12. fullbitone=ones(1,sample_time);
13. x=[];
14. n=1;
15. for i = 1:length(signal)
16. if signal(i) == 1
17. x=[x fullbitone];
18. else
19. x=[x -1*fullbitone];
20. end
21. end
22. t1=linspace(0,(5*length(signal)),length(x));
23. figure(1);
24. plot(t1,x,'k','linewidth',2)
25. legend('pulse signal')
26. xlim([0 50])
27. start=1;
28. endpoint=length(fullbitone);
29. figure(2);
30. for r = [0, 0.5, 1]
31. for i=1:length(signal)
32. start=endpoint+1;
33. endpoint=endpoint+length(fullbitone);
34. temp=x(start:endpoint);
35. h = rcosdesign(r, 6, sample_time, 'sqrt');
36. channel = conv(temp, h);
37. noise = awgn(channel, 5);
38. match_out = conv(fullbitone, noise);
39. plot(match_out,'k')
40. title('raised cosine filter')
41. hold on
42. end
43. end
44. grid on;
Critical Anylsis:
In this lab I explored the eye diagram. I sampled a random bit stream in polar NRZ and without
using matched filter or noise I observed its eye diagram. It was clear and was distinguishable.
Upon adding noise and match filter the eye diagram was very distorted to the point that it
wasn’t even distinguishable. The more the strength of the noise the more the eye diagram became
distorted. The eye diagram served as a visual aid for understanding inter-symbol interference
and helps determine the optimal number of samples for efficient data transmission through our
channel.
In the post-lab task, I perform the same task using a raised cosine filter. During this process,
I learn that the raised cosine filter is employed to prepare the signal for transmission, while
the matched filter is used to optimize the reception process for enhanced signal detection and
noise reduction. The raised cosine filter shapes the transmitted signal to minimize distortion
and improve overall signal quality. It ensures that the transmitted signal has a smooth spectrum
and limited frequency content, thereby reducing the likelihood of interference with other signals
in the channel. On the other hand, the matched filter is utilized at the receiver to optimize the
detection process. It is designed to have a response that matches the transmitted signal, thereby
maximizing the signal-to-noise ratio and improving the ability to accurately detect and decode
the received signal. The matched filter aids in recovering the original transmitted signal, even
in the presence of noise and inter-symbol interference.
By utilizing the raised cosine filter for transmission and the matched filter for reception, I
can achieve higher signal quality, reduced errors, and improved overall system performance. This
combination of filters ensures efficient and reliable data transmission across the channel.

You might also like