# On the use of Permutation matrix to perform iFFT

I have a question about using the permutation matrix for performing $$iFFT$$ for such matrix and then reshape it row-wise and column-wise way.

Let's say that we have a random matrix $$x$$ whose size is (32,8), so that matrix can be written as below:

where $$x_k$$ represents the column $$k$$ of matrix $$x$$ with size of 32 for each column.

$$1$$- Let's take column wise $$iFFT$$ for matrix $$x$$ and then reshape it row-wise resulting matrix $$Y$$ as below matlab code

x = randn(32,8);
y = ifft(x);
Y = reshape(y.',[],1);


$$2$$- let's manipulate that using another way of permutation matrix. first we can reshape the matrix $$x$$ column-wise into (256,1) as below:

Then performing $$iFFT$$ operation with size of $$32$$-point is corresponding to:

$$F$$ is the Fourier transformation matrix
In order to get the equivalent matrix of Y representing the reshape of $$iFFT(x)$$ in row-wise, we can multiply the matrix Z with permutation matrix P resulting vector $$Y2$$ which should be similar to vector $$Y$$ in case $$1$$. That can be done by matlab as:

z = reshape(x,[],1);   %
X = kron(eye(8),dftmtx(32));
Z = X*z;

P = zeros(m*n);       %Building the permutation matrix P
col = 1;
for i = 1:m
for j = 1:n
E = zeros(m,n);
E(i,j) = 1;
P(:,col) = E(:);
col = col + 1;
end
end

Y2 = P*Z


So, for $$(1)$$ and $$(2)$$, $$Y$$ should be similar to $$Y2$$. Is that right? but what I get is different results! My question is that calculation right? why do I get different results ?

• What is the F matrix? Mar 18 '20 at 11:05
• @DSPNovice it's fourier matrix gotten in matlab by dftmtx(32); I will add it into the question too. Thank you
– Gze
Mar 18 '20 at 11:12
• I have added a code in the answer Mar 18 '20 at 11:34
• @DSPNovice .. Thank you for your answer, but what's about the permutation matrix and reshape the matrix row-wise and column-wise ?
– Gze
Mar 18 '20 at 11:37
• Can you link the source of this? For code (1), ifft was taken by taking ifft of the individual columns and then stacking them one over the other. For code (2), the same is done but in a matrix form.Instead of applying ifft on individual columns, they are stacked to form one long x column vector and multiplied with a huge I8xF matrix. If you could link the source, I could see what the permutation matrix and row wise multiplication does. Sorry this is all I know Mar 18 '20 at 11:47

Y and Z should show the same values

clear;
%Create random vector x
x = randn(32,8);

%take ifft along each column
y = ifft(x);
Y = reshape(y,[],1);

z = reshape(x,[],1);   %
d=conj(dftmtx(32))/32;
X = kron(eye(8),d);
Z = X*z;