巨大的傅立叶矩阵-MATLAB [英] Huge Fourier matrix - MATLAB
问题描述
我需要创建一个傅立叶矩阵,以将其应用于需要使用spalloc定义为稀疏的巨大矩阵.我试过了:
I need to create a Fourier matrix in order to apply it to a huge matrix that I needed to define as sparse using spalloc. I tried:
F=dftmtx(N);
但是N太大,因此我无法创建它. 有什么办法可以解决这个问题? 谢谢您的帮助!
but N is too large so I can't create it. Is there any way to solve this problem? Thank you for your help!
推荐答案
对于每一列,您可以通过省略将乘以零的条目来形成简化的DFT矩阵.像
For each column, you can form a reduced DFT matrix by leaving out the entries that will multiply zeros. Something like
X = my_matrix;
c = column_index;
x = X(:,c);
N = length(x);
inds = find(x);
F = exp( -1j * 2*pi/N * (0:N-1)' * (inds-1) );
Xdft(:,c) = F * x(inds);
除非输入矩阵中的零不会更改列之间的列,否则您必须迭代列.但是,以上对我来说仍然很愚蠢.我只需一次拉出一列,然后使用fft()
.
You'll have to iterate over the columns unless the zeros in the input matrix don't change column-to-column. However, the above still seems silly to me. I'd just pull off one column at a time and use fft()
.
这篇关于巨大的傅立叶矩阵-MATLAB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!