如何进行窗口化,FFT和显示结果

时间:2013-10-03 05:08:38

标签: matlab window fft

我正在尝试按

输入.wav文件
    filename = 'C:\Users\kiit\Desktop\New folder\file.wav';
    [y, Fs, nbits] = wavread(filename)

之后我用 -

计算长度
L=length(y)

我通过 -

执行了汉明窗
w=window(@hamming,L);

当我通过

执行fft时
F=fft(y,w)

它显示警告     警告:FFT长度必须是非负整数标量。

F =

Empty matrix: 0-by-1

任何帮助??

1 个答案:

答案 0 :(得分:2)

您的fft命令错误。第二个参数是FFT长度,而不是窗口。

Y = fft(X,n) returns the n-point DFT. fft(X) is equivalent to fft(X, n) where n 
is the size of X in the first nonsingleton dimension. If the length of X is less 
than n, X is padded with trailing zeros to length n. If the length of X is 
greater than n, the sequence X is truncated. When X is a matrix, the length of
the columns are adjusted in the same manner.

在窗口中,您在时域中应用(元素乘法)(即y.*w)。

了解fft的输出: