CodeMLIMatlab PDF
CodeMLIMatlab PDF
Vdc=320000;
fmod=50;
fport=500;
ts=0.04;
te=0.000001;
t=0:te:ts;
i=1:(ts/te)+1;
%modulantes
modpha=sin(2*pi*fmod*t(i))/2;
modphb=sin(2*pi*fmod*t(i)-2*pi/3)/2;
modphc=sin(2*pi*fmod*t(i)+2*pi/3)/2;
%Porteuse
port=sawtooth(2*pi*fport*t(i),1/2);
figure
plot(t,modpha,t,modphb,t,modphc,t,port);
xlabel('temps (s)');
ylabel('Amplitude');
grid on
%commutations
%differences
difpha=modpha-port;
difphb=modphb-port;
difphc=modphc-port;
%iterations
for i=1:(ts/te)+1
if difpha(i)>0
Sa(i)=1;
else
Sa(i)=0;
end
Sa(1,i)=Sa(i);
end
for i=1:(ts/te)+1
if difphb(i)>0
Sb(i)=1;
else
Sb(i)=0;
end
Sb(1,i)=Sb(i);
end
for i=1:(ts/te)+1
if difphc(i)>0
Sc(i)=1;
else
Sc(i)=0;
end
Sc(1,i)=Sc(i);
end
figure
plot(t,Sa)
xlabel('temps (s)');
ylabel('Amplitude (V)');
grid
figure
plot(t,Sb)
xlabel('temps (s)');
ylabel('Amplitude (V)');
grid
figure
plot(t,Sc)
xlabel('temps (s)');
ylabel('Amplitude (V)');
grid
%Tension de sortie
V=(Vdc/3)*[2 -1 -1; -1 2 -1;-1 -1 2]*[Sa; Sb; Sc];
figure
plot(t,V(1,:))
xlabel('temps (s)');
ylabel('Amplitude (V)');
grid
figure
plot(t,V(2,:))
xlabel('temps (s)');
ylabel('Amplitude (V)');
grid
figure
plot(t,V(3,:))
xlabel('temps (s)');
ylabel('Amplitude (V)');
grid