What format is y in y=wavread('file')? Difficulty in finding peaks of a wav file as y is not a vector.

I have been trying to find the peaks of a wav file but stuck with this error.
Error using findpeaks Expected X to be a vector.
Error in findpeaks>parse_inputs (line 54) validateattributes(X,{'numeric'},{'nonempty','real','vector'},...
Error in findpeaks (line 43) [X,Ph,Pd,Th,Np,Str,infIdx] = parse_inputs(X,varargin{:});
Error in ab (line 23) [pks,locs] = findpeaks(xn);
Error in run (line 57) evalin('caller', [s ';']);
I have used wavread as follows:
i = 88200; j = 352800; samples = [i, j]; [xn fs]=wavread('/media/file.wav',samples); t=[1/fs:1/fs:length(xn)/fs];
Please help.

답변 (1개)

what does
size(xn)
returns? It might be N-by-2 for stereo wave files

이 질문은 마감되었습니다.

태그

질문:

2014년 7월 14일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by