Advanced Communications Matlab-1
Advanced Communications Matlab-1
Advanced Communications Matlab-1
n=23;
k=12;
dmin=7;
ebno=1:10;
ber_block=bercoding(ebno,'block','hard',n,k,dmin);
berfit(ebno,ber_block)
ylabel('bit error probability');
title('ber vs eb/no');
RESULT:
Dept. of ECE
Dept. of ECE
Dept. of ECE
RESULT:
ans =
Columns 1 through 17
Columns 18 through 34
ans =
Columns 1 through 17
Columns 18 through 34
Dept. of ECE
tb=2;
t=poly2trellis([3],[7,5]);
encoded_sequence=[ 1 1 1 0 0 0 1 0 0 0 0 1 1 0 0 1 1 1 0 1 1 0 1 0 1 1 0 1 1 1 ];
decoded=vitdec(encoded_sequence,t,tb,'trunc','hard')
RESULTS:
decoded =
Dept. of ECE
Dept. of ECE
if hopped_sig(1,k)==0;
dsss_sig=[dsss_sig c1]
else
dsss_sig=[dsss_sig c2]
end
end
figure,plot([1:12120],dsss_sig);
axis([-1 12120 -1.5 1.5]);
title('\bf\ it dss signal');
%plotting the fft of dsss signal
figure,plot([1:12120],abs(fft(dsss_sig)));
RESULT:
Dept. of ECE
Dept. of ECE
Dept. of ECE
10
Dept. of ECE
11
Dept. of ECE
12
Dept. of ECE
13
7. Histogram of a Image
clc;
clear all;
f=imread('cameraman.tif');
figure,imshow(f);
title('Input Image');
h=imhist(f);
h1=h(1:10:256);
horz=1:10:256;
figure,bar(horz,h1);
figure,plot(horz,h1);
title('Histogram Equalized Image');
Z=adapthisteq(f,'cliplimit',0.9,'distribution','uniform');
imview(Z);
b=imhist(f);
figure,imshow(b);
Dept. of ECE
14
Dept. of ECE
15
Dept. of ECE
16
RGB=imread('peppers.png');
I=rgb2gray(RGB);
J=fft2(I);
k=ifft2(J);
subplot(2,2,1),imshow(RGB);
title('original image');
subplot(2,2,2),imshow(I);
title('gray scale image');
subplot(2,2,3),imshow(J);
title('DFT');
subplot(2,2,4);imshow(k,[0 255]);
title('IDFT');
RESULT:
Dept. of ECE
17
Dept. of ECE
18
RESULT:
Dept. of ECE
19
Dept. of ECE
20
Dept. of ECE
21
Dept. of ECE
22
Dept. of ECE
23
Dept. of ECE
24
N=60;
R=0.5;
b=firnyquist(N,4,R,0,'nonnegative');
h=firrcos(N,0.25,R,2,'rolloff');
hfvt=fvtool(b,1,h,1);
set(hfvt,'color', [1 1 1]);
legend(hfvt,'FIR NYQUIST DESIGN','FIR RCOS DESIGN');
Dept. of ECE
25
Dept. of ECE
26
Dept. of ECE