无法识别的函数或变量“ wavread”。

466次观看(最近30天)
Nahum Sacay
Nahum Sacay on 21 Aug 2021
I need help for my school activity my professor given to us, when i try the code there is "Unrecognized function or variable 'wavread'." on the first line of the code.
这是代码:
[x,fs] = wavread('c:\ matlab \ work \ waed.wav');%阅读您的waed.wav
xlen=length(x);%计算文件中的样本数量
a = 0.15;%初始化所有常数
延迟= 0.4;
D=delay*fs
y=zerosz(size(x));%创建一个矩阵,x的大小可高效地运行
为了i = d+1:1:xlen;%过滤器信号
y(i)=x(1)+a*x(i-D);
结尾
sound(y,fs);%播放回声信号
图(y)%在情节上添加标签使用Xlabel和Ylabel
f = fft(y)%get the fast fourier transform of soundfile
谁是%检查所使用的变量和大小检查f
情节(ABS(F))%plot magnitude of the fft(frequency content of speech)
情节(ABS(F(1:50000)))%绘制FFT的一部分
2条评论
沃尔特·罗伯森(Walter Roberson)
旁注:将单个引号的字符串传递到fullfile()将返回完全相同的字符串。您需要传递多个字符串才能获得任何有用的结果。然后您在文件名之前犯了一个错误
p = fullfile('D:',,,,'MATLAB',,,,'2021a',,,,'waed.wav'
有可能有效且有用。

登录发表评论。

答案(3)

VBBV
VBBV on 21 Aug 2021
%如果p = fullfile(路径,文件);[y,fs] = wavread(p);

如果在不同的目录中或仅在同一位置,将路径和文件名放在一起

%如果true [y,fs] = wavread('filename');

西蒙·陈(Simon Chan)
它需要信号处理工具箱,在命令窗口中键入“ ver”以检查您是否具有正确的工具箱。
2条评论
沃尔特·罗伯森(Walter Roberson)
从R2015B开始删除WavRead()。当它存在时,它在MATLAB本身中,而不是在信号处理工具箱中(除非它在信号处理中 quite 旧版本。)

登录发表评论。


沃尔特·罗伯森(Walter Roberson)
Wavread()从MATLAB中删除。您的替换代码是
[x,fs] = audioread('c:\ matlab \ work \ waed.wav');%阅读您的waed.wav
这样做 不是 需要任何额外的工具箱。

标签

下载188bet金宝搏

社区寻宝

在Matlab Central中找到宝藏,发现社区如何为您提供帮助!

Start Hunting!