필터 지우기
필터 지우기

Error meassge while using wavread and audioread

조회 수: 2 (최근 30일)
Mary Jeethu A J
Mary Jeethu A J 2021년 8월 17일
답변: KSSV 2021년 8월 17일
This is a code for computing mfcc.I'm getting error as
'Undefined function 'wavread' for input arguments of type 'char'.'
When audioread is used instead of wavread it is shown that 'Too many output arguments.'
Could anybody help me resolving the issue?
% Define variables
Tw = 25; % analysis frame duration (ms)
Ts = 10; % analysis frame shift (ms)
alpha = 0.97; % preemphasis coefficient
M = 20; % number of filterbank channels
C = 12; % number of cepstral coefficients
L = 22; % cepstral sine lifter parameter
LF = 300; % lower frequency limit (Hz)
HF = 3700; % upper frequency limit (Hz)
wav_file = 'sp10.wav'; % input audio filename
N = 9;
P = 7;
file_name_array = {'a','d','f','h','n','sa','su'};
for i=1:N
for k=1:P
wav_file = char(strcat(dir_path,file_name_array(k),'0',num2str(i)));
% for i=1:
% Read speech samples, sampling rate and precision from file
[ speech, fs, nbits ] = wavread( wav_file );
% Feature extraction (feature vectors as columns)
[ MFCCs, FBEs, frames ] = ...
mfcc( speech, fs, Tw, Ts, alpha, @hamming, [LF HF], M, C+1, L );

답변 (1개)

KSSV
KSSV 2021년 8월 17일
Try treplacing this line:
wav_file = char(strcat(dir_path,file_name_array(k),'0',num2str(i)));
with
wav_file = [dir_path,filesep,file_name_array(k),'0',num2str(i)];
Also read about fullfile.

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by