diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /851/CH7/EX7.01 | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '851/CH7/EX7.01')
-rwxr-xr-x | 851/CH7/EX7.01/Figure7_01.sce | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/851/CH7/EX7.01/Figure7_01.sce b/851/CH7/EX7.01/Figure7_01.sce new file mode 100755 index 000000000..05ce580d3 --- /dev/null +++ b/851/CH7/EX7.01/Figure7_01.sce @@ -0,0 +1,66 @@ +//clear//
+//Caption:Waveforms of Different Digital Modulation techniques
+//Figure7.1
+//Digital Modulation Techniques
+//To Plot the ASK, FSK and PSk Waveforms
+clear;
+clc;
+close;
+f = input('Enter the Analog Carrier Frequency in Hz');
+t = 0:1/512:1;
+x = sin(2*%pi*f*t);
+I = input('Enter the digital binary data');
+//Generation of ASK Waveform
+Xask = [];
+for n = 1:length(I)
+ if((I(n)==1)&(n==1))
+ Xask = [x,Xask];
+ elseif((I(n)==0)&(n==1))
+ Xask = [zeros(1,length(x)),Xask];
+ elseif((I(n)==1)&(n~=1))
+ Xask = [Xask,x];
+ elseif((I(n)==0)&(n~=1))
+ Xask = [Xask,zeros(1,length(x))];
+ end
+end
+//Generation of FSK Waveform
+Xfsk = [];
+x1 = sin(2*%pi*f*t);
+x2 = sin(2*%pi*(2*f)*t);
+for n = 1:length(I)
+ if (I(n)==1)
+ Xfsk = [Xfsk,x2];
+ elseif (I(n)~=1)
+ Xfsk = [Xfsk,x1];
+ end
+end
+//Generation of PSK Waveform
+Xpsk = [];
+x1 = sin(2*%pi*f*t);
+x2 = -sin(2*%pi*f*t);
+for n = 1:length(I)
+ if (I(n)==1)
+ Xpsk = [Xpsk,x1];
+ elseif (I(n)~=1)
+ Xpsk = [Xpsk,x2];
+ end
+end
+figure
+plot(t,x)
+xtitle('Analog Carrier Signal for Digital Modulation')
+xgrid
+figure
+plot(Xask)
+xtitle('Amplitude Shift Keying')
+xgrid
+figure
+plot(Xfsk)
+xtitle('Frequency Shift Keying')
+xgrid
+figure
+plot(Xpsk)
+xtitle('Phase Shift Keying')
+xgrid
+//Example
+//Enter the Analog Carrier Frequency 2
+//Enter the digital binary data[0,1,1,0,1,0,0,1]
|