% computes the frequency domain represenation of shocks
function h = h(alpha,theta,N1,N2,K,omega)
%function h = h(alpha,theta,N1,N2,K,omega)
% omega is the vector of frequences

h = ones(length(omega),2);
lambda = 1-K-alpha*N1+K*N2;
kappa1=-alpha*N1./(1-lambda.*exp(-i*omega));
kappa2=N1*K./(1-lambda.*exp(-i*omega));
rho1=-N2*alpha./(1-lambda.*exp(-i*omega));
rho2=N2*K./(1-lambda.*exp(-i*omega));
h(:,1) = alpha.*(1+exp(-i.*omega).*(kappa1-(K/alpha).*rho1));
h(:,1) = h(:,1)./(1-(1-K)*exp(-i.*omega));
h(:,2) = K.*(1+exp(-i.*omega).*(rho2-(alpha/K).*kappa2));
h(:,2) = h(:,2)./(1-(1-K)*exp(-i.*omega));
