summaryrefslogtreecommitdiff
path: root/851/CH7/EX7.31/Figure7_31.sce
diff options
context:
space:
mode:
Diffstat (limited to '851/CH7/EX7.31/Figure7_31.sce')
-rwxr-xr-x851/CH7/EX7.31/Figure7_31.sce25
1 files changed, 25 insertions, 0 deletions
diff --git a/851/CH7/EX7.31/Figure7_31.sce b/851/CH7/EX7.31/Figure7_31.sce
new file mode 100755
index 000000000..36e218f75
--- /dev/null
+++ b/851/CH7/EX7.31/Figure7_31.sce
@@ -0,0 +1,25 @@
+//clear//
+//Caption:Power spectra of M-ary PSK signals
+//Figure7.31 Comparison of Power Spectral Densities of M-ary PSK signals
+rb = input('Enter the bit rate=');
+Eb = input('Enter the energy of the bit=');
+f = 0:1/100:rb;
+Tb = 1/rb; //Bit duration
+M = [2,4,8];
+for j = 1:length(M)
+ for i= 1:length(f)
+ SB_PSK(j,i)=2*Eb*(sinc_new(f(i)*Tb*log2(M(j)))^2)*log2(M(j));
+ end
+end
+a=gca();
+plot2d(f*Tb,SB_PSK(1,:)/(2*Eb))
+plot2d(f*Tb,SB_PSK(2,:)/(2*Eb),2)
+plot2d(f*Tb,SB_PSK(3,:)/(2*Eb),5)
+xlabel('Normalized Frequency ---->')
+ylabel('Normalized Power Spectral Density--->')
+title('Power Spectra of M-ary signals for M =2,4,8')
+legend(['M=2','M=4','M=8'])
+xgrid(1)
+//Result
+//Enter the bit rate in bits per second:2
+//Enter the Energy of bit:1