blob: 8b763778c51a7f5e1a027272a73af83a50245709 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
clc
disp("Example 7.26")
printf("\n")
printf("Given")
disp("Period =10s")
disp("Interval is 1ms")
disp("Voltage of binary signal is either 0.5 or -0.5")
T=10;
//During 10s period there are 10000 intervals of 1ms each
//For calculating average equal number of intervals are considered at 0.5V and -0.5V
vavg=(0.5*5000-0.5*5000)/10000
//The effective value of v(t) is
//Let V=V^2eff
V=(0.5^2*5000+(-0.5)^2*5000)/10000
Veff=sqrt(V)
printf("vavg=%dV\nVeff=%3.2fV\n",vavg,Veff)
|