Decomposition of the numerator and denominator polynomials into their even and odd parts

Here there is a time transfer function (G(s)) in the form:

 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) , where w = frequency symbol.

Now, how can the numerator and denominator be expanded into polynomials of equation (1) in their even and odd parts and get G(jw) as (using Matlab):

enter image description here

+5
source share
1 answer

You could probably take the real and imaginary parts after replacing with s=j*w . However, you can choose the even and odd parts of your polynomials:

 % G(s) = N(s)/D(s); syms s; N = s^3+4*s^2-s+1; p = sym2poly(N); %// do this in fewer lines: %{ /* if mod(length(p),2)==0 %// then first index is odd imin_o = 1; %// for odd part imin_e = 2; %// for even part else imin_o = 2; %// for odd part imin_e = 1; %// for even 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); % even 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 the same for the denominator.

+5
source

Source: https://habr.com/ru/post/1242559/


All Articles