matlab - Decomposing the numerator and the denominator polynomials into their even and odd parts -
here there continues time transfer function (g(s))
in form of:
g(s) = n(s)/d(s); g(s) = (s^3+4s^2-s+1)/(s^5+2s^4+32s^3+14s^2-4s+50) (1)
and (s = j*w)
w = frequency symbol.
now, how possible decompose numerator , denominator polynomials of eq. (1) , odd parts , g(jw)
(using matlab) :
you take real , imaginary parts after substitution s=j*w
. however, can select , odd parts of polynomials:
% g(s) = n(s)/d(s); syms s; n = s^3+4*s^2-s+1; p = sym2poly(n); %// in fewer lines: %{ /* if mod(length(p),2)==0 %// first index odd imin_o = 1; %// odd part imin_e = 2; %// part else imin_o = 2; %// odd part imin_e = 1; %// part end */ %} imin_o = mod(length(p),2) + 1; imin_e = 2 - mod(length(p),2); % odd part of numerator p_o = zeros(size(p)); p_o(imin_o:2:end) = p(imin_o:2:end); % part of numerator p_e = zeros(size(p)); p_e(imin_e:2:end) = p(imin_e:2:end); % restore n_o = poly2sym(p_o,s); n_e = poly2sym(p_e,s);
and same denominator.
Comments
Post a Comment