function w = a(u,v,n)
% A is bilnear form of vectors of length n (even)
u_hat = fft(u);
v_hat = fft(v);
u_shift = fftshift(u_hat);
v_shift = fftshift(v_hat);
u_pad = [zeros(1,n/2) u_shift(2:n) zeros(1,n/2)];
v_pad = [zeros(1,n/2) v_shift(2:n) zeros(1,n/2)];
w_hat = zeros(1,n);
for j=(-n/2+1):(n/2-1)
    v_pad_shift = circshift(v_pad,[0 j]);
    w_hat(j+n/2+1) = sum(u_pad.*conj(v_pad_shift))/n;
end
w_hat = ifftshift(w_hat);
w = real(ifft(w_hat));
end

