Info

This question is closed. Reopen it to edit or answer.

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

1 view (last 30 days)
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.

Answers (1)

Jos (10584)
Jos (10584) on 14 Jul 2014
what does
size(xn)
returns? It might be N-by-2 for stereo wave files

Community Treasure Hunt

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

Start Hunting!