Arduino compare

Excuse me! I have a question: Is it possible to use Arduino DUE's compare match to compare sine wave and carrier wave to change the duty ratio of PWM?

compare in what way? amplitude, frequency, phase

By comparing the target sine wave with the triangle wave generated by the timer programmed in the Arduino DUE's Atmel SAM3X8E microcontroller, we can change the PWM duty ratio as shown in the figure.

not sure what purpose the triangle wave serves other than a sampling period.

why not generate a PWM proportional to the sine wave amplitude?

Interesting graphics. Isn't this a Class D audio amplifier?