Info

此问题已关闭。 请重新打开它进行编辑或回答。

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

1 次查看(过去 30 天)
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 个)

Jos (10584)
Jos (10584) 2014-7-14
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!

Translated by