function [Gds1 Gdm1 Gdms1]=gmsd1(Gdtest1)

ztot=zero(Gdtest1); ptot=pole(Gdtest1);
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    

Gds1=minreal(tf(b*Gdtest1)); Gdm1=minreal(tf(Gdtest1*a)); Gdms1=minreal(tf(b*Gdtest1*a));