function f = pcorr(a,b)
% PCORR(A,B) is the periodic cross-correlation of two row vectors A and B.
% A and B must be the same length. The correletion is normalised.
% The first correlation of [a1 a2 a3 a4] with [b1 b2 b3 b4] is the 
% product [a1b1 + a2b2 + a3b3 + a4b4] and the sense then proceeds as
% if B were rotated right. That is:
% PCORR([1 2 3 4], [0 4 0 0]) = [2 3 4 1].  Compare with
% PCONV([1 2 3 4], [0 4 0 0]) = [4 1 2 3].

% written by DG on 30/4/02.

% First we time-reverse the b sequence, then call PCONV
f = pconv( a, timereverse(b) );

