summaryrefslogtreecommitdiff
path: root/2294/CH1/EX1.17/EX1_17.sce
blob: 806bf7ff61bca0917e05beb65dd4825c7b17e287 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//Example 1.17<i>
//Determine the power and the rms value of the signal
clc;
t=0:0.001:10;
y=5*cos(50*t+%pi/3);
P=(integrate('5^2*(cos(50*t))^2','t',0,2*%pi))/(2*%pi);
rmsvalue=sqrt(P);
disp(P,'The power of the given signal is:');
disp(rmsvalue,'the rms value is:');
//Example 1.17<ii>
//Determine the power amd rms value of the signal
clc;
t=0:0.001:10;
x1=10*sin(50*t+%pi/4);
x2=16*cos(100*t+%pi/3);
P1=(integrate('10^2*(sin(50*t))^2','t',0,2*%pi))/(2*%pi);
P2=(integrate('16^2*(cos(100*t))^2','t',0,2*%pi))/(2*%pi);
P=P1+P2;
rmsvalue=sqrt(P);
disp(P,'The power of the given signal is:');
disp(rmsvalue,'the rms value is:');
//Example 1.17 <iii>
//Determine the power and rms value of the signal
clc;
t=0:0.001:10;
x1=5*cos(15*t);
x2=5*cos(5*t);
P1=(integrate('5^2*(cos(15*t))^2','t',0,2*%pi))/(2*%pi);
P2=(integrate('5^2*(cos(5*t))^2','t',0,2*%pi))/(2*%pi);
P=P1+P2;
rmsvalue=sqrt(P);
disp(P,'The power of the given signal is:');
disp(rmsvalue,'the rms value is:');