cI()

function out=cI(in)

Input:

Global variables:

Output:

Generalize the software in your file ``cI.m'' to have the above capability. To do this, note that by block matrix multiplication,

\begin{displaymath}
{\bf I}\, \mbox{in} = {\bf I}\, \left[ \mbox{in}(:,1), \mbox...
...ox{in}(:,2), \ldots, {\bf I}\, \mbox{in}(:,\mbox{Ns}) \right],
\end{displaymath}

where in(:,k) is octave notation for the k-th column of the matrix in. The above result simply states that you need only apply the action of ${\bf I}$ independently to each column of in and to store the result in out.

In octave this type of operation is most efficient when you first form the output matrix with data of the appropriate size with a statement like

out=zeros(size(in));
Doing this improves efficiency by avoiding extra system calls to malloc() to allocate memory as the data for out is actually computed. Then, you should loop over the columns of in with a code fragment of the form
  for col=1:size(in,2) %# size(in,2) gives 2nd dimension (# of columns) of in
    out(:,col)=fft3(in(:,col), ... ); %# <= Same operation you had before
  end
where you compute out(:,col) from in(:,col) in the same was as you previously computed out from in.

Tomas Arias 2007-04-12