我正在尝试按
输入.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
任何帮助??
答案 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
的输出: