close all
clear all

f0 = .10;
f2 = .12;
f1 = mean([f0 f2]);

f01 = mean([f0 f1]);
f12 = mean([f1 f2]);
df0 = f2-f0;

S = 6.8;

A0 = sqrt(2*S*(f2-f0));
A1 = sqrt(2*S*(f1-f0));
A2 = sqrt(2*S*(f2-f1));

dt = .05;
t = 0:dt:1/(df0/4)-dt;

eta0 = A0*sin(2*pi*f1*t);
eta1 = A1*sin(2*pi*f01*t);
eta2 = A2*sin(2*pi*f12*t);
eta12 = 2*A1*cos(2*pi*df0*t/4).*sin(2*pi*f1*t);

figure('Position',[520 108 887 990])
ah1 = subplot(3,1,1);
plot(t,eta0)

ah2 = subplot(3,1,2);
plot(t,eta1,t,eta2)

ah3 = subplot(3,1,3);
plot(t,eta1+eta2,t,eta12)

linkaxes([ah1 ah2 ah3],'x');


Pb0 = 2*A0*f1;
Pb1 = 2*A1*f01;
Pb2 = 2*A2*f12;

Pbt_a = Pb1+Pb2;
Pbt_b = sqrt(Pb1^2+Pb2^2);

2*sqrt(2)*A0*mean(abs(cos(2*pi*df0*t/4)))*f1
2*A0*f1