summaryrefslogtreecommitdiff
path: root/1592/CH9/EX9.11/example_9_11.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:38:01 +0530
committerprashantsinalkar2017-10-10 12:38:01 +0530
commitf35ea80659b6a49d1bb2ce1d7d002583f3f40947 (patch)
treeeb72842d800ac1233e9d890e020eac5fd41b0b1b /1592/CH9/EX9.11/example_9_11.sce
parent7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (diff)
downloadScilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.tar.gz
Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.tar.bz2
Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.zip
updated the code
Diffstat (limited to '1592/CH9/EX9.11/example_9_11.sce')
-rwxr-xr-x1592/CH9/EX9.11/example_9_11.sce55
1 files changed, 30 insertions, 25 deletions
diff --git a/1592/CH9/EX9.11/example_9_11.sce b/1592/CH9/EX9.11/example_9_11.sce
index cb72453e8..51fb4d676 100755
--- a/1592/CH9/EX9.11/example_9_11.sce
+++ b/1592/CH9/EX9.11/example_9_11.sce
@@ -1,25 +1,30 @@
-//Scilab Code for Example 9.11 of Signals and systems by
-//P.Ramakrishna Rao
-//Power Spectral Density
-clear;
-clc;
-clear f n;
-fo=2;
-n=1;
-RC=1/(2*%pi*10^3);
-w=4*%pi*10^3
-H=1/(1+%i*w*RC);
-disp(H,'H(f)');
-X=(abs(H))^2;
-for f=-5:5
- Pxx(n)=25*[delta(f-fo)+delta(f+fo)];
- Pyy(n)=X*Pxx(n);
- n=n+1;
-end
-disp(Pxx,'Pxx=');
-disp(Pyy,'Pyy=');
-f=-5:5;
-plot2d3(f,Pyy,-2);
-title('Power Spectral Density');
-ylabel('Pyy(f)');
-xlabel('f in Hz');
+//Scilab Code for Example 9.11 of Signals and systems by
+//P.Ramakrishna Rao
+//Power Spectral Density
+clear;
+clc;
+function [y]=delta(t)
+ if t==0
+ y=1
+else y=0
+ end
+endfunction
+fo=2;
+n=1;
+RC=1/(2*%pi*10^3);
+w=4*%pi*10^3
+H=1/(1+%i*w*RC);
+disp(H,'H(f)');
+X=(abs(H))^2;
+for f=-5:5
+ Pxx(n)=25*[delta(f-fo)+delta(f+fo)];
+ Pyy(n)=X*Pxx(n);
+ n=n+1;
+end
+disp(Pxx,'Pxx=');
+disp(Pyy,'Pyy=');
+f=-5:5;
+plot2d3(f,Pyy,-2);
+title('Power Spectral Density');
+ylabel('Pyy(f)');
+xlabel('f in Hz'); \ No newline at end of file