1

我正在尝试输入一个 .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

有什么帮助吗??

4

1 回答 1

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

于 2013-10-03T05:24:48.043 回答