function [error_theta_1,error_theta_2,error_theta_3,error_gain,error_H]=parameter_result(est_H,est_gain,est_theta_1,est_theta_2,est_theta_3,H,gain,theta_1,theta_2,theta_3)
%% para MSE; H NMSE
error_theta_3=norm(angular_difference(sort(est_theta_3),sort(theta_3)))^2;
error_theta_2=norm(angular_difference(sort(est_theta_2),sort(theta_2)))^2;
error_theta_1=norm(angular_difference(sort(est_theta_1(:,1)),sort(theta_1(:,1))))^2+norm(angular_difference(sort(est_theta_1(:,2)),sort(theta_1(:,2))))^2;

[~,I]=sort(abs(est_gain));
[~,I2]=sort(abs(gain));
error_gain=norm(est_gain(I)-gain(I2))^2;
error_H=norm(est_H-H)^2/norm(H)^2;

    function c=angular_difference(a,b)
        l=length(a);
        c=zeros(l,1);
        for jj=1:l
            if abs(a(jj)-b(jj))>3
                c(jj)=abs(a(jj)-b(jj))-pi;
            else
                c(jj)=abs(a(jj)-b(jj));
            end
        end
    end
end
