The input signal, x(t), is a time varying signal with known max and min amplitude and frequency bandwidth. On input to the PWM routine, x(t) is passed through a S/H circuit to produce a piecewise linear x(t) approximation designated as x(k). A ramp generator output producing a precision ramp voltage which has a peak to peak amplitude slightly larger than the maximum amplitude range of the input signal is added to x(k). The peak to peak amplitude is controlled by the PEAK RAMP AMPLITUDE GAIN which should be set to 1.1 times the maximum amplitude range of the input signal. This sum is then compared with a fixed reference value (the COMPARATOR REFERENCE LEVEL). When the sum is greater than the comparator reference level, the output PWM pulse is HIGH (1), when the sum is less than the comparator reference level, the output PWM pulse is LOW (0).
Limitations:
1. set PEAK RAMP AMPLITUDE GAIN to at least 1.1 times the maximum amplitude range of the input signal.
2. select COMPARATOR REFERENCE LEVEL such that there is always an intersection with the sum of the S/H circuit and the ramp voltage. This will require one or more test runs using the desired input signal. If this is not possible, INCREASE the PEAK RAMP AMPLITUDE GAIN.
3. select the PWM update time (Digital Update Time) to a value less than 1/2 the max period of the input signal, x(t) - The Nyquist frequency.