% Basic implementation of the probing operator
% This function calculates the circular correlation of two same sized 
% real-valued vectors (z and y) where z represent two-binded concepts 
% by circular convolution (e.g. vectors x and y) and and returns a same sized 
% approximated version of the original vector x, referred to as xTilde

% References:
%  Plate, T. A. (1994).
%  Distributed Representations and Nested Compositional Structure.
%  Ph. D. thesis, Department of Computer Science, University of Toronto,
%  Toronto, Canada.
%  http://internet.cybermesa.com/~champagne/tplate/
%
%  Plate, T. A. (2003).
%  Holographic Reduced Representation: Distributed Representation for
%  Cognitive Structures.
%  Center for the Study of Language and Information (CSLI).
%  ISBN-10: 1575864290, April 2003

% by Blerim Emruli, March 2012, eblerim@gmail.com

function xTilde = ccorr_fft(z,y)

if size(z,2) ~= size(y,2)

    error('vectors are not equally sized');

else

xTilde = ifft(fft(z).*conj(fft(y)));
xTilde = xTilde/norm(xTilde);

end
