blob: 6608ff270231fd5bdddd33519efaf90ab84143ab (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
//Chapter 2
//Example 2-2
//ProbOnPWM
//Page 34
clear;clc;
//Given
f=50;//in Hz
Vtemp=4; //input signal in volts
Ecm=10; //maximum peak voltage of sawtooth carrier wave in volts
//Example 2-2(a)
T=1/f;
Th=(Vtemp*T)/Ecm;//High time in seconds
printf("\n\n High Time = %.4f s \n\n",Th)
//Example 2-2(b)
d=(Th/T)*100;//duty cycle in percentage
printf("\n\n Duty cycle = %.4f percent \n\n",d)
|