Unrecognized function or variable 'wavread'.

조회 수: 276 (최근 30일)
Nahum Sacay
Nahum Sacay 2021년 8월 21일
댓글: Walter Roberson 2021년 8월 23일
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.
Here is the code:
[x,fs]=wavread('c:\matlab\work\waed.wav'); %read your waed.wav
xlen=length(x); %calculate the number of samples in the file
a=0.15; %initialize all constants
delay=0.4;
D=delay*fs
y=zerosz(size(x)); % create a matrix, the size of x for efficient an speedier operation
for i=D+1:1:xlen; % filter signal
y(i)=x(1)+a*x(i-D);
end:
sound(y,fs); %play the echo signal
plot(y) %add labels on plot use xlabel and ylabel
f=fft(y) %get the fast fourier transform of soundfile
whos %checks the variables used and the sizes check of out f
plot(abs(f)) %plot magnitude of the fft(frequency content of speech)
plot(abs(f(1:50000))) % plots a section of the fft
  댓글 수: 2
Nahum Sacay
Nahum Sacay 2021년 8월 23일
there is still unrecognized on the program
>> p = fullfile('D:\MATLAB\2021a,waed.wav');
>> [Y,Fs]=wavread(p);
Unrecognized function or variable 'wavread'.
Walter Roberson
Walter Roberson 2021년 8월 23일
Side note: passing a single quoted string into fullfile() will return back exactly the same string. You need to pass in multiple strings to get any useful result. And you made a mistake with comma before the file name
p = fullfile('D:', 'MATLAB', '2021a', 'waed.wav')
would potentially be valid and useful.

댓글을 달려면 로그인하십시오.

답변 (2개)

Simon Chan
Simon Chan 2021년 8월 21일
It requires Signal Processing Toolbox, type 'ver' in the Command WIndow to check whether you have the right Toolbox or not.
  댓글 수: 2
Nahum Sacay
Nahum Sacay 2021년 8월 23일
Thank you,I checked it and there is no Signal Processing Toolbox.
Walter Roberson
Walter Roberson 2021년 8월 23일
wavread() was removed as of R2015b. When it existed, it was in MATLAB itself, not in the Signal Processing Toolbox (unless it was in Signal Processing in a quite old release.)

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2021년 8월 23일
wavread() was removed from MATLAB. The replacement code for you is
[x, fs] = audioread('c:\matlab\work\waed.wav'); %read your waed.wav
This does not need any extra toolboxes.

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by