summaryrefslogtreecommitdiff
path: root/40/CH7/EX7.9
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /40/CH7/EX7.9
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 '40/CH7/EX7.9')
-rwxr-xr-x40/CH7/EX7.9/Exa_7_9.sce21
1 files changed, 21 insertions, 0 deletions
diff --git a/40/CH7/EX7.9/Exa_7_9.sce b/40/CH7/EX7.9/Exa_7_9.sce
new file mode 100755
index 000000000..dd88eaf73
--- /dev/null
+++ b/40/CH7/EX7.9/Exa_7_9.sce
@@ -0,0 +1,21 @@
+//(a)Quantisation effects
+sig=0.005;
+D=4;
+B=log2(D/(sig*sqrt(12)));//no.of samples
+//value of B to ensure quantisation error to 5mv
+//(b)Quantisation error and noise
+xn=0:0.2:2.0;
+xqn=[0 0 0.5 0.5 1 1 1 1.5 1.5 2 2];
+en=xn-xqn;//quantization error
+//Quantisation signal top noise ratio
+x=0;e=0;
+for i=1:length(xn)
+ x=x+xn(i)^2;
+ e=e+en(i)^2;
+end
+//method 1
+SNRQ=10*log10(x/e)
+//method 2
+SNRQ=10*log10(x/length(xn))+10.8+20*log10(4)-20*log10(2)
+SNRS=10*log10(1.33)+10*log10(12)+20*log10(4)-20*log10(2)
+//from results we see that SNRS is statistical estimate \ No newline at end of file