【问题标题】:How to calculate FFT of a time series in 3D space (X, Y, T)如何计算 3D 空间(X、Y、T)中时间序列的 FFT
【发布时间】:2020-03-24 21:59:20
【问题描述】:

3D 空间 (X, Y, T) 中的时间序列 (x, y, t) 满足:

x(t) = f1(t), y(t) = f2(t),

where t = 1, 2, 3,....

换句话说,坐标 (x, y) 随时间戳 t 变化。计算 x(t) 或 y(t) 的 FFT 很容易,但是如何计算 (x, y) 的 FFT?我认为它不应该被计算为 2D-FFT,因为这是一个图像,而 (x, y) 只是一个系列。有什么建议吗?谢谢你。

【问题讨论】:

    标签: signal-processing fft frequency-analysis


    【解决方案1】:

    使用

    fftn

    例如:Y = fftn(X) 使用快速傅里叶变换算法返回 N 维数组的多维傅里叶变换。 N-D 变换等效于沿 X 的每个维度计算 1-D 变换。输出 Y 与 X 大小相同。 对于 3-D 变换: 创建一个 3-D 信号 X。X 的大小为 20×20×20

    x = (1:20)';
    y = 1:20;
    z = reshape(1:20,[1 1 20]);
    X = cos(2*pi*0.01*x) + sin(2*pi*0.02*y) + cos(2*pi*0.03*z);
    

    计算信号的 3-D 傅里叶变换,它也是一个 20×20×20 数组。

    Y = fftn(X)
    

    用零填充 X 以计算 32×32×32 变换。

    m = nextpow2(20);
    Y = fftn(X,[2^m 2^m 2^m]);
    size(Y)
    

    您也可以使用此代码: 首先你可以使用 SINGLE 而不是 DOUBLE

    psi = single(psi);
    fftpsi = fft(psi,[],3);
    

    下一个可能是一张一张地工作

    psi=rand(10,10,10);
    % costly way
    fftpsi=fftn(psi);
    % This might save you some RAM, to be tested
    [m,n,p] = size(psi);
    for k=1:p
        psi(:,:,k) = fftn(psi(:,:,k)); 
    end
    psi = reshape(psi,[m*n p]);
    for i=1:m*n % you might work on bigger row-block to increase speed
        psi(i,:) = fft(psi(i,:));
    end
    psi = reshape(psi,[m n p]);
    % Check
    norm(psi(:)-fftpsi(:))
    

    希望对你有用

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多