function err = SYN_err_measure(params,w)
%
% to use fminsearch:
% W = synthwin(11,pi/4,0,2);
% x = fminsearch(@(x) SYN_err_measure(x,W),[1;pi/4;2]);
%

rho = params(1);
theta = params(2);
width = params(3);

err = 0;
[num_rows,num_cols] = size(w);

w_syn = synthwin(num_rows,theta,rho,width);
err = sum(sum(abs(w-w_syn)));
