clear all
close all

T = 1;
t = 0:T/1000:100*T

p1 = cos(2*pi*t/T);
p2 = cos(2*pi*t/T+2*pi/3);
p3 = cos(2*pi*t/T+4*pi/3);

abs_p1 = abs(p1);
abs_p2 = abs(p2);
abs_p3 = abs(p3);


Vrect12 = max([abs_p1; abs_p2]);
Vrect = max([Vrect12; abs_p3]);

M1 = mean(abs_p1);
M12 = mean(Vrect12);
M = mean(Vrect);

figure
plot(t,abs([p1 ; p2 ; p3]),t,Vrect,'kx',t,M,t,M12,t,M);

M1/M
