summaryrefslogtreecommitdiff
path: root/3161/CH11
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /3161/CH11
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '3161/CH11')
-rw-r--r--3161/CH11/EX11.3/Ex11_3.sce47
-rw-r--r--3161/CH11/EX11.4/Ex11_4.sce31
-rwxr-xr-x3161/CH11/EX11.5/Ex11_5.sce45
-rwxr-xr-x3161/CH11/EX11.6/Ex11_6.sce52
-rwxr-xr-x3161/CH11/EX11.7/Ex11_7.sce31
-rwxr-xr-x3161/CH11/EX11.8/Ex11_8.sce30
-rwxr-xr-x3161/CH11/EX11.9/Ex11_9.sce22
7 files changed, 258 insertions, 0 deletions
diff --git a/3161/CH11/EX11.3/Ex11_3.sce b/3161/CH11/EX11.3/Ex11_3.sce
new file mode 100644
index 000000000..a3254b02f
--- /dev/null
+++ b/3161/CH11/EX11.3/Ex11_3.sce
@@ -0,0 +1,47 @@
+clc;
+//page 558
+//problem 11.3
+
+//Prior probability of s1 P_s1 = 0.4
+P_s1 = 0.4;
+
+//Prior probability of s2 P_s2 = 1 - P_s1
+P_s2 = 1 - P_s1;
+
+//Voltage level V1 = 1
+V1 = 1;
+
+//Voltage level V2 = -1
+V2 = -1;
+
+//Part a
+
+//Noise Variance sigma1 = 10^-3
+sigma1 = 10^-3;
+
+//Descision Threshold lambda1
+lambda1 = (V1+V2)/2 + (sigma1)*log(P_s2/P_s1)/(V1-V2);
+
+//Probability of error Pe
+Pe = 0.5*(2*P_s1 - P_s1*erfc(((V2-V1)/(2*sigma1*2^0.5)) + (sigma1)*log(P_s2/P_s1)/((V1-V2)*2^0.5)));
+
+disp('The decision threshold is '+string(lambda1)+' V');
+disp('The probability of error is approximately '+string(Pe));
+
+//Part b
+
+//Noise Variance sigma2 = 10^-1
+sigma2 = 10^-1;
+
+//Descision Threshold lambda2
+lambda2 = (V1+V2)/2 + (sigma2)*log(P_s2/P_s1)/(V1-V2);
+
+//Probability of error Pe
+Pe1 = 0.5*(2*P_s1 - P_s1*erfc(((V2-V1)/(2*sigma2*2^0.5)) + (sigma2)*log(P_s2/P_s1)/((V1-V2)*2^0.5)));
+
+//In the textbook Pe has been calulated to be 0.0021 because of the use of a very high precision calculator, unfortunately in scilab the function erfc approximates the output value to a larger extent due to which an exact value cannot be obtained.
+
+disp('The decision threshold is '+string(lambda2)+' V');
+disp('The probability of error is approximately '+string(Pe1));
+
+
diff --git a/3161/CH11/EX11.4/Ex11_4.sce b/3161/CH11/EX11.4/Ex11_4.sce
new file mode 100644
index 000000000..f0cd9a447
--- /dev/null
+++ b/3161/CH11/EX11.4/Ex11_4.sce
@@ -0,0 +1,31 @@
+clc;
+//page 559
+//problem 11.4
+
+//Part b
+
+//Voltage level V1 = 1
+V1 = 1;
+
+//Voltage level V2 = -1
+V2 = -1;
+
+//Prior probability of s1 P_s1 = 0.4
+P_s1 = 0.4;
+
+//Prior probability of s2 P_s2 = 1 - P_s1
+P_s2 = 1 - P_s1;
+
+//Cost of selecting s1 when s2 is transmitted C12 = 0.7
+C12 = 0.7;
+
+//Cost of selecting s2 when s1 is transmitted C21 = 1 - C12
+C21 = 1 - C12;
+
+//Noise Variance sigma = 10^-3
+sigma = 10^-3;
+
+//Descision Threshold lambda
+lambda = (V1+V2)/2 + (sigma)*log((C12*P_s2)/(C21*P_s1))/(V1-V2);
+
+disp('The decision threshold is '+string(lambda)+' V');
diff --git a/3161/CH11/EX11.5/Ex11_5.sce b/3161/CH11/EX11.5/Ex11_5.sce
new file mode 100755
index 000000000..cd99b4750
--- /dev/null
+++ b/3161/CH11/EX11.5/Ex11_5.sce
@@ -0,0 +1,45 @@
+clc;
+//page 567
+//problem 11.5
+
+//The voltage level of reciever is V = 5 mV
+V = 5*10^-3;
+
+//The time required to transfer one bit is T = 1/9600 sec
+T = 9600^-1;
+
+//the signal energy of a bit be Es
+Es = (V^2)*T;
+
+//The power spectral density is n/2 = 10^-9 Watt/hertz
+n = 2*10^-9;
+
+//Probability error for optimal reciever is Pe
+Pe = 0.5*erfc((Es/n)^0.5);
+
+disp('The probability of error is '+string(Pe));
+
+//When the data rate is doubled, the new effective energy per bit is Es_new
+Es_new = (V^2)*(T/2);
+
+//The new probability of error is Pe_new
+Pe_new = 0.5*erfc((Es_new/n)^0.5);
+
+//Percentage increase in error rate is P
+P = 100*(Pe_new - Pe)/Pe;
+
+disp('Percentage increase in error rate is '+string(P));
+
+//Voltage required to restore probability levels, V_new
+V_new = V*2^0.5;
+
+disp('Voltage required to restore the probability levels is '+string(V_new)+' Volts');
+
+
+
+
+
+
+
+
+
diff --git a/3161/CH11/EX11.6/Ex11_6.sce b/3161/CH11/EX11.6/Ex11_6.sce
new file mode 100755
index 000000000..f5f2c5533
--- /dev/null
+++ b/3161/CH11/EX11.6/Ex11_6.sce
@@ -0,0 +1,52 @@
+clc;
+//page 575
+//problem 11.6
+
+//Amplitude of signal is A = 10 mV
+A = 10*10^-3;
+
+//Power Spectral Density n = 2 * 10^(-9) W/Hz
+n = 2 * 10^(-9);
+
+//Frequency is f = 1 MHz
+f = 1*10^6;
+
+//Data rate is D = 10^4 bps;
+D = 10^4;
+
+//Time taken for a bit to traverse
+T = 1/D;
+
+//Energy per signal element is Es
+Es = A^2/(2*D);
+
+//Probability of error Pe
+Pe = 0.5*erfc((Es/n)^0.5);
+
+disp('Probability of error is '+string(Pe));
+
+//Phase shift phi = %pi/6
+phi = %pi/6;
+
+//Probability of error Pe_local_oscillator
+Pe_local_oscillator = 0.5*erfc(((Es/n)^0.5)*cos(phi));
+
+disp('Probability of error of local oscillator with phase shift is '+string(Pe_local_oscillator));
+
+//Timing error t
+t = 0.1*T;
+
+//Probability of error when there is a synchronization fault Pe_timing_error
+Pe_timing_error = 0.5*erfc(((Es/n)*(1 - 2*(t/T))^2)^0.5);
+
+disp('Probability of error with synchronization fault is '+string(Pe_timing_error));
+
+//Probability of error when both faults occur Pe_both
+Pe_both = 0.5*erfc(((Es/n)*(cos(phi)^2)*(1 - 2*(t/T))^2)^0.5);
+
+disp('Probability of error when both faults occur '+string(Pe_both));
+
+
+
+
+
diff --git a/3161/CH11/EX11.7/Ex11_7.sce b/3161/CH11/EX11.7/Ex11_7.sce
new file mode 100755
index 000000000..846eadcba
--- /dev/null
+++ b/3161/CH11/EX11.7/Ex11_7.sce
@@ -0,0 +1,31 @@
+clc;
+//page 575
+//problem 11.7
+
+//Amplitude of signal is A = 10 mV
+A = 10*10^-3;
+
+//Power Spectral Density n = 2 * 10^(-9) W/Hz
+n = 2 * 10^(-9);
+
+//Data rate is D = 10^4 bps;
+D = 10^4;
+
+//Time taken for a bit to traverse
+T = 1/D;
+
+//Energy per signal element is Es
+Es = A^2/(2*D);
+
+//Probability of error Pe_a
+Pe_a = 0.5*erfc((0.6*Es/n)^0.5);
+disp('Probability of error when offset is small is '+string(Pe_a));
+
+//Probability of error Pe_b
+Pe_b = 0.5*erfc((Es/(2*n))^0.5);
+disp('Probability of error when frequencies used are orthogonal is '+string(Pe_b));
+
+//Probability of error Pe_c
+Pe_c = 0.5*exp(-(Es/(2*n)));
+disp('Probability of error for non coherent detection is '+string(Pe_c));
+
diff --git a/3161/CH11/EX11.8/Ex11_8.sce b/3161/CH11/EX11.8/Ex11_8.sce
new file mode 100755
index 000000000..f967df937
--- /dev/null
+++ b/3161/CH11/EX11.8/Ex11_8.sce
@@ -0,0 +1,30 @@
+clc;
+//page 588
+//problem 11.8
+
+//Energy aasosciated with each bit Eb = 5 * 10^(-8) J
+Eb = 5 * 10^(-8);
+
+//Power Spectral Density n = 2 * 10^(-9) W/Hz
+n = 2 * 10^(-9);
+
+//No of symbols M
+M = 16
+
+//No of bits N
+N = log2(M);
+
+//Error limit for 16-PSK is P_16_PSK
+P_16_PSK = erfc(((N*Eb*(%pi)^2)/(((M)^2)*n))^0.5);
+
+disp('Upper limit of error probability of 16 PSK system is '+string(P_16_PSK));
+
+//Error limit for 16-QASK is P_16_QASK
+P_16_QASK = 2*erfc(((0.4*Eb)/(n))^0.5);
+
+disp('Upper limit of error probability of 16 QASK system is '+string(P_16_QASK));
+
+//Error limit for 16-FSK is P_16_FSK
+P_16_FSK = ((2^4 - 1)/2)*erfc(((N*Eb)/(2*n))^0.5);
+
+disp('Upper limit of error probability of 16 FSK system is '+string(P_16_FSK)+', negligibly small');
diff --git a/3161/CH11/EX11.9/Ex11_9.sce b/3161/CH11/EX11.9/Ex11_9.sce
new file mode 100755
index 000000000..a8edb9be3
--- /dev/null
+++ b/3161/CH11/EX11.9/Ex11_9.sce
@@ -0,0 +1,22 @@
+clc;
+//page 595
+//problem 11.9
+
+//Energy aasosciated with each bit Eb = 5 * 10^(-8) J
+Eb = 5 * 10^(-8);
+
+//Power Spectral Density n = 2 * 10^(-9) W/Hz
+n = 2 * 10^(-9);
+
+//Probability of error Pe
+Pe = 0.5*erfc(((Eb*(%pi)^2)/(16*n))^0.5);
+
+disp('Probability of error of QPR system is '+string(Pe));
+
+//Given Bandwidth of channel is BW
+BW = 10*10^3;
+
+D = 2*BW;
+
+disp('Data rate is '+string(D)+' bps');
+