向量中的 fft 点和 fft 之间的差异

Difference between fft points and fft in vector

给定一个长度为 L 的向量 Xfft(X)fft(X,L) 之间有什么区别?

这是否意味着我们在使用 fft(X) 时在 L 点上取 fft 并且在使用 [=13 时取向量 Lfft =]?

根据the documentation on fft

Y = fft(X) computes the discrete Fourier transform (DFT) of X using a fast Fourier transform (FFT) algorithm.

If X is a vector, then fft(X) returns the Fourier transform of the vector.

Y = fft(X,n) returns the n-point DFT. If no value is specified, Y is the same size as X.

If X is a vector and the length of X is less than n, then X is padded with trailing zeros to length n.

If X is a vector and the length of X is greater than n, then X is truncated to length n.

意味着如果你有一个长度为 L 的向量 Xfft(X)fft(X,L) 等价的

当您用 n~=L 调用 fft(X,n) 时,有趣的一点出现了。

  • 如果 n<L 您的输入向量 X 将被截断,即您将使用较少的测量值并获得缩短的傅立叶序列。
  • 如果n=L;以上讨论
  • 如果 n>L 您的向量 X 是零填充的:X = [X zeros(L-n,1)](对于行向量 X)。这将做的是在频域中进行插值。从公式 at the bottom of the documentation:
  • 中最容易看出这一点

如果我们增加 n,我们会得到一个更长的向量 Y。但是,由于您填充了零,而不是信号的延续,因此其傅里叶变换将是频率之间的 插值 。通常你会得到 W(n) 运行 从你的采样频率中给出的频率,f_s 一直到 f_n = Nyquist/2 L 步骤,即您拥有的许多数据点:linspace(F_s,f_n,L)。当零填充将 more 点放入相同的 space: linspace(F_s,f_n,n) 时,你在做什么,而不添加信息。