% shaper_goal       - Goal function for the deconvolution optimization

function y = shaper_goal(x, prm, idx);

% x(1) - Shaping coefficient C2
% x(2) - Shaping coefficient C0

c   = [x(1) 1 x(2)];

drv = shaper(c, prm);
idx1 = idx + [1:prm.Npb:length(drv)];

kicks = -sort(-abs(drv(idx1)));
y = kicks(2)/kicks(1);
