function y = fourier_val ( coeff, x )
    n = size(coeff,2);
    m = size(x,2);

    powers = [0:(n/2) (-n/2+1):-1];
    exp_mat = exp(pi*1i*(powers .') * x);
    coeff_mat = repmat(coeff .',1,m);
    y = sum(coeff_mat .* exp_mat);
end
