diff options
author | prashantsinalkar | 2017-10-10 12:38:01 +0530 |
---|---|---|
committer | prashantsinalkar | 2017-10-10 12:38:01 +0530 |
commit | f35ea80659b6a49d1bb2ce1d7d002583f3f40947 (patch) | |
tree | eb72842d800ac1233e9d890e020eac5fd41b0b1b /851/CH7 | |
parent | 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (diff) | |
download | Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.tar.gz Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.tar.bz2 Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.zip |
updated the code
Diffstat (limited to '851/CH7')
-rwxr-xr-x | 851/CH7/EX7.3/Table7_3.sce | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/851/CH7/EX7.3/Table7_3.sce b/851/CH7/EX7.3/Table7_3.sce index ec59df5cf..c6e943d10 100755 --- a/851/CH7/EX7.3/Table7_3.sce +++ b/851/CH7/EX7.3/Table7_3.sce @@ -1,37 +1,37 @@ -//clear//
-//Caption:Illustrating the generation of DPSK signal
-//Table7.3 Generation of Differential Phase shift keying signal
-clc;
-bk = [1,0,0,1,0,0,1,1];//input digital sequence
-for i = 1:length(bk)
- if(bk(i)==1)
- bk_not(i) =~1;
- else
- bk_not(i)= 1;
- end
-end
-dk_1(1) = 1&bk(1); //initial value of differential encoded sequence
-dk_1_not(1)=0&bk_not(1);
-dk(1) = xor(dk_1(1),dk_1_not(1))//first bit of dpsk encoder
-for i=2:length(bk)
- dk_1(i) = dk(i-1);
- dk_1_not(i) = ~dk(i-1);
- dk(i) = xor((dk_1(i)&bk(i)),(dk_1_not(i)&bk_not(i)));
-end
-for i =1:length(dk)
- if(dk(i)==1)
- dk_radians(i)=0;
- elseif(dk(i)==0)
- dk_radians(i)=%pi;
- end
-end
-disp('Table 7.3 Illustrating the Generation of DPSK Signal')
-disp('_____________________________________________________')
-disp(bk,'(bk)')
-bk_not = bk_not';
-disp(bk_not,'(bk_not)')
-dk = dk';
-disp(dk,'Differentially encoded sequence (dk)')
-dk_radians = dk_radians';
-disp(dk_radians,'Transmitted phase in radians')
-disp('_____________________________________________________')
+//clear// +//Caption:Illustrating the generation of DPSK signal +//Table7.3 Generation of Differential Phase shift keying signal +clc; +bk = [1,0,0,1,0,0,1,1];//input digital sequence +for i = 1:length(bk) + if(bk(i)==1) + bk_not(i) =~1; + else + bk_not(i)= 1; + end +end +dk_1(1) =bool2s( 1 & bk(1)); //initial value of differential encoded sequence +dk_1_not(1)=bool2s(0& bk_not(1)); +dk(1) = bitxor(dk_1(1),dk_1_not(1))//first bit of dpsk encoder +for i=2:length(bk) + dk_1(i) = dk(i-1); + dk_1_not(i) = ~dk(i-1); + dk(i) = bitxor(bool2s(dk_1(i)& bk(i)),bool2s(dk_1_not(i)& bk_not(i))); +end +for i =1:length(dk) + if(dk(i)==1) + dk_radians(i)=0; + elseif(dk(i)==0) + dk_radians(i)=%pi; + end +end +disp('Table 7.3 Illustrating the Generation of DPSK Signal') +disp('_____________________________________________________') +disp(bk,'(bk)') +bk_not = bk_not'; +disp(bk_not,'(bk_not)') +dk = dk'; +disp(dk,'Differentially encoded sequence (dk)') +dk_radians = dk_radians'; +disp(dk_radians,'Transmitted phase in radians') +disp('_____________________________________________________')
\ No newline at end of file |