Maverick Max
The PWM period must be much shorter than the sine wave period. Let's say for example, the PWM period is 256 counts and there are 36 PWM periods over a sine wave period (each PWM period is 2*pi/36 radians or 10 degrees).
Let's say that at a value of zero, we are using a PWM period of 50%. Negative one is 0% and positive one is 100%.
For each PWM period, you use the sine table to determine what your duty cycle should be. For sin(0), PWM = 50%, count=128. For sin(2*pi/36), PWM = 59%, count=151, for sin(2*pi*2/36), PWM = 67%, count=171, etc.
So your output is high for 128, low for 128, high for 151, low for 256-151=105, high for 171, low for 85, etc. throughout the period of the sinewave.
Basically, all you do is compare a counter to the appropriate value in your table. The result of the comparison yields the state of your output.