function [Gds12 Gdm12 Gdms12]=gmsd12(Gd12)

ztot=zero(Gd12); ptot=pole(Gd12);
z=ztot(find(ztot>0)); p=ptot(find(ptot>0));

nz=length(z); np=length(p);

s=tf('s');
b=1;a=1;     
for i = 1:np
    b=b*(s-p(i))/(s+p(i));
end;
for i = 1:nz
    a=a*(s+z(i))/(s-z(i));
end    

Gds12=minreal(tf(b*Gd12));Gdm12=minreal(tf(Gd12*a)); Gdms12=minreal(tf(b*Gd12*a));

