Code covered by the BSD License  

Highlights from
Toolbox signal

image thumbnail
from Toolbox signal by Gabriel Peyre
Signal processing related functions.

compute_conv_matrix(x)
function y = compute_conv_matrix(x)

% compute_conv_matrix - compute a circular convolution matrix.
%
% M = compute_conv_matrix(x);
%  
%     Copyright (c) 2005 Gabriel Peyr

x = x(:);
n = length(x);
[Y,X] = meshgrid(0:n-1,0:n-1);
Z = mod( X+Y, n )+1;
y = x(Z);

Contact us at files@mathworks.com