From 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Tue, 10 Oct 2017 12:27:19 +0530 Subject: initial commit / add all books --- 3446/CH8/EX8.1/Ex8_1.sce | 17 +++++++++++++++++ 3446/CH8/EX8.2/Ex8_2.sce | 29 +++++++++++++++++++++++++++++ 3446/CH8/EX8.3/Ex8_3.sce | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 3446/CH8/EX8.1/Ex8_1.sce create mode 100644 3446/CH8/EX8.2/Ex8_2.sce create mode 100644 3446/CH8/EX8.3/Ex8_3.sce (limited to '3446/CH8') diff --git a/3446/CH8/EX8.1/Ex8_1.sce b/3446/CH8/EX8.1/Ex8_1.sce new file mode 100644 index 000000000..625e0c86c --- /dev/null +++ b/3446/CH8/EX8.1/Ex8_1.sce @@ -0,0 +1,17 @@ +// Exa 8.1 +// To calculate coverage gain in dB. + +clc; +clear all; + +Pdiff=-3; //in dB +AMR1=12.2; //in kbps +AMR2=7.95; //in kbps +AMR3=4.75; //in kbps + +//solution +//CG(dB)=10log{(DPDCH(kbps)+DPCCH)/(DPDCH(AMR bit rate (kbps))+ DPCCH)} +CG1=10*log10((AMR1+AMR1*10^(Pdiff/10))/(AMR2+AMR1*10^(Pdiff/10))); +CG2=10*log10((AMR1+AMR1*10^(Pdiff/10))/(AMR3+AMR1*10^(Pdiff/10))); +printf('By reducing the AMR bit rate from 12.2 to 7.95 kbps coverage gain becomes %.2f dB \n ',CG1); +printf('By reducing the AMR bit rate from 7.95 to 4.75 kbps coverage gain becomes %.2f dB \n ',CG2); diff --git a/3446/CH8/EX8.2/Ex8_2.sce b/3446/CH8/EX8.2/Ex8_2.sce new file mode 100644 index 000000000..e1b93ebf1 --- /dev/null +++ b/3446/CH8/EX8.2/Ex8_2.sce @@ -0,0 +1,29 @@ +// Exa 8.2 +// To calculate the output of the encoder. + +clc; +clear all; + +K=4; //constraint length +r=1/2; //code rate(n/k) +x=poly(0,"x");//Defining x as a ploynomial variable +G1=1+x^2+x^3; +G2=1+x+x^2+x^3; +in=[1 0 1 1 1];//input(first bit first) + +//solution +//with reference to Fig 8.9 on page no 239 +g1=[1 0 1 1]; //converting from G1 polynomial to bit form +g2=[1 1 1 1];////converting from G2 polynomial to bit form +x1=round(convol(g1,in)); +x2=round(convol(g2,in)); +V1=modulo(x1,2); +V2=modulo(x2,2); +disp("Multiplexing the V1 and V2 to get required output sequence as "); + a=5; +for i= 1:5 + printf('%d%d',V2(a),V1(a)); + a=a-1; + +end + diff --git a/3446/CH8/EX8.3/Ex8_3.sce b/3446/CH8/EX8.3/Ex8_3.sce new file mode 100644 index 000000000..43e6a72fb --- /dev/null +++ b/3446/CH8/EX8.3/Ex8_3.sce @@ -0,0 +1,38 @@ +// Exa 8.3 +// To demostrate 4X4 Bit interleaving/de-interleving. + +clc; +clear all; + +BitStream= [0 0 0 0 0 1 1 1 0 0 0 1 0 0 0 1];//Last bit to first bit + +//solution +disp("Interleaving is performed by storing the data in a table containing rows and columns at the transmitter. The data is written in rows and transmitted in a vertical direction (according to columns). At the receiver, the data is written and read in the opposite manner. ") + +// Interleaver + Input1=[1 0 0 0 //Writing data row wise + 1 0 0 0 + 1 1 1 0 + 0 0 0 0]; +disp("GIven Bit stream is") +disp(BitStream); +disp("Input to interleaver is") +disp(Input1); + +Output1=[0 0 0 0 0 1 0 0 0 1 0 0 0 1 1 1]; // Reading data column wise +disp("Output of interleaver is"); +disp(Output1); +//De-interleaver + Input2=[1 1 1 0 //Writing o/p data row wise + 0 0 1 0 + 0 0 1 0 + 0 0 0 0]; + // Let From 6th to 9th bits have Burst Error + disp("Input to de-interleaver is"); + disp(Input2); + //Output of deinterleaver + +Output2= [0 0 0 0 0 1 1 1 0 0 0 1 0 0 0 1]; +disp("Output of de-interleaver is") +disp(Output2); +disp( "Bits with Burst error were from 6th to 9th. But in output of de-interleaver, they relocated to positions 3rd, 6th, 10th and 14th."); -- cgit