给定一个长度为 L
的向量 X
,fft(X)
和 fft(X,L )
?
这是否意味着我们在使用 fft(X)
和 fft
时在 L
点上取 fft
> 执行 fft(X,L)
时矢量 L
的 >?
最佳答案
Y = fft(X)
computes the discrete Fourier transform (DFT) ofX
using a fast Fourier transform (FFT) algorithm.If
X
is a vector, thenfft(X)
returns the Fourier transform of the vector.
Y = fft(X,n)
returns then
-point DFT. If no value is specified,Y
is the same size asX
.If
X
is a vector and the length ofX
is less thann
, thenX
is padded with trailing zeros to lengthn
.If
X
is a vector and the length ofX
is greater thann
, thenX
is truncated to lengthn
.
意思是如果你有一个向量 X
长度L
, fft(X)
和 fft(X,L)
是等价的。
有趣的一点是当您调用 fft(X,n)
时与 n~=L
.
- 如果
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)
.当零填充将 更多 点放入同一空间时,您在做什么:linspace(F_s,f_n,n)
, 不添加信息。
关于matlab - 向量中的 fft 点和 fft 之间的差异,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57802554/