Why can I not use findpeaks with this audio signal?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Taylor Gray
el 4 de Mzo. de 2019
Respondida: Star Strider
el 4 de Mzo. de 2019
Honestly not used the software much at all I understand this may be a very simple problem. My aim is to spectrally analyse an audio signal and extract its modes (frequency peaks) to spectrally model in max msp. Also if anyone knows a better way to find out the frequencies and amplitudes of peaks of an audio signal please let me know. Below is the code that will not work, I have also attached the audio sample I would like to analyze:
clear;
clc;
close all;
[audio_file, Fs] = audioread("honours_gun.wav");
findpeaks(audio_file);
Below is the error it returns:
Error using findpeaks
Expected Y to be a vector.
Error in findpeaks>parse_inputs (line 199)
validateattributes(Yin,{'double','single'},{'nonempty','real','vector'},...
Error in findpeaks (line 136)
= parse_inputs(isInMATLAB,Yin,varargin{:});
Error in Test (line 5)
findpeaks(audio_file);
0 comentarios
Respuesta aceptada
Star Strider
el 4 de Mzo. de 2019
The findpeaks function takes a vector input for the first argument. Note that ‘audio_file’ is a (8447 x 2) (stereophonic) matrix.
Use:
findpeaks(audio_file(:,1));
or
findpeaks(audio_file(:,2));
instead.
I doubt that you will get any useful information from using findpeaks as you are, with no additional arguments.
0 comentarios
Más respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!