This is an Op Amp Level Shifter of the Vout=m*Vin+b where m = slope, and b= offset,
This circuit takes a 1v amplitude sinewave (2V P-P) centeres on 0V, amplifies and shifts it to between 0-4V. The linear transform takes Vin and makes Vout = m *Vin + b with m = 2 and b = +2V by using these components:
Vref = 5V -- chosen arbitrarily.
R1 = 10k
R2 = 5V *10k * 2/2 = 50k
Rf = 100k
Rg = 50k*100k/(2*(10k+50K)-50k)=71.4k
Calculations:
Choose R1 ____
R2 = Vref * R1 *m / b
Choose Rf _______ (from datasheet)
Rg = R2*Rf/(m * (R1+R2) - R2)
Op amps require 4 different circuits depending on the signs of the coefficients. See https://www.ti.com/lit/an/sloa097/sloa097.pdf for a great reference.