I've worked on the digital amplifier of the sinus wave. It amplifies the input signal by a factor controlled by the digital inputs.
Theory? Theory.
Calculation of OPAMP resistors.
This is the simplest form of the amplifier above:
The idea is to change the amplification of the circuit by adding / taking away resistors from the circuit, controlled by the two transistors, and therefore effectively changing the value of R1.
Since the amplitude of the sine wave is approximately 400 mV, I can calculate the maximum amplification I'll need on the output (which is of course 12V, and considering the losses of a non rail-to-rail OPAMP, I'm just going to say 10V by feeling):
Vmax = 10V / 0.4V =
25
From expirience, I'll choose R2 = 51k. Now I can calculate the minimum resistance of R1:
(R2/R1 + 1) * Uinput = Uoutput where Vmax = Uoutput / Uinput
R1min = R2 / Vmax = 51k / 25 =
2.04k
The minimum amplification I'll choose to be Vmin = Vmax * 0.2 = 5. With that I can calculate the maximum resistance of R1:
R1max = 51k / 5 = 10.2k
And since R1max is going to be in parallel with the other 2 resistors, it is the first resistor in the circuit at the very top (R22).
Right. Now that I know the maximum and minimum resistance of R1, and I know I'll be connecting the various resistors in parallel, I can approximate the other two which are in parallel. The following calculation gives me the resistance of both unkown resistors. I'll call it Rx:
Rx = 1/[ (1/R1min) - (1/R1max) ] = 2.55k
So knowing Rx = 2.55k, and knowing that it's a good thing to have the values pretty far apart (so one transistor can give more pain than the other), I'll choose one of the resistors, R23, to be 8.2k. Now I can finally calculate the last resistor:
R24 = 1/[ (1/Rx) - (1/R21) ] = 3.6k
Just to wrap up:
R22 = 10k
R23 = 8.2k
R24 = 3.6k
AWESOME, am I glad that's out of the way.

Are we finished? Nope.
Calculation of base resistors for transistors
This is much simpler than the previous maths. Let's collect some values first.
Uce = 0.3V (datasheet)
Ube = 0.7V (datasheet)
hfe = 120 (minimum amplification of transistor)
u = 5 (Overamplification factor)
Uoutput = 10V (OPAMP output maximum)
Udigital = 5V (digital input voltage)
Rmin = 51k (smallest resistance between supply voltage and GND we're using).
First, we calculate the maximum current that flows into the collector.
Icmax = (Uoutput - Uce) / Rmin = 0.19mA
With that the current flowing into the base can be calculated:
Ib = Icmax / hfe = 1.6uA
And now we can calculate the base resistor:
Rb = (Udigital - Ube) / Ib / u =
550k
That just about wraps up the theory. More to come~
TheComet