I'm trying to understand the difference between linear and circular convolution by adapting the Matlab methodologies here. I'm comparing the results of linear convolution with use of the inbuilt conv and cconv function, Bruno Luong's convnfft, and NAG's c06pk.
This is related to the math.stackexchange post.
My code is
% complex vectors
x = rand(2^5,1) + 1j*rand(2^5,1);
y = rand(2^5,1) - 1j*rand(2^5,1);
clin = conv(x,y); % Matlab convolution function
cfun = convnfft(x,y); % Bruno Luong function
N = length(x)+length(y)-1;
xpad = [x' zeros(1,N-length(x))]; % pad vectors
ypad = [y' zeros(1,N-length(y))];
ccirc = cconv(xpad,ypad); % do linear convolution with circular convolution function
cnag = c06pk(int64(1),xpad,ypad); % do linear convolution with NAG function
figure()
plot(clin,'o'); hold on; plot(cfun,'+')
figure()
plot(ccirc,'.'); hold on; plot(cnag,'x')
When I plot the results of linear convolution using the various methods outlined in the code, not all of them agree with the clin result. The cfun agrees, but ccirc and cnag don't because they are designed for finding circular convolutions.
Have I done something wrong with the zero-padding?
Edit: If I plot the results of these linear convolutions I get:
Is there some scaling issue in cconv and c06pk?

