필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Use findpeaks function for latency assessment

조회 수: 2 (최근 30일)
Anton M
Anton M 2022년 5월 10일
마감: Anton M 2022년 5월 10일
Hello,
I am trying to use the findpeaks function to measure the latency of my trigger signal (first channel) and my sound signal (second channel). The problem is that, particularly for my second channel, there are loads of peaks (there are trains of five vowels). I only need the x value of the first initial small peak of each vowel train as this would be the onset of the sound which I would need to compare to the trigger latency.
I know that the first small peak occurs approximately every 1000 miliseconds and I tried to insert 1000 as MinPeakDistance but I get this error message:
Error using findpeaks
Expected MinPeakDistance to be a scalar with value < 0.999994.
Error in findpeaks>parse_inputs (line 339)
validateattributes(Pd,{'numeric'},{'real','scalar','nonempty','nonnegative','<',x(M)-x(1)},'findpeaks','MinPeakDistance');
Error in findpeaks (line 136)
= parse_inputs(isInMATLAB,Yin,varargin{:});
I dont understand why MinPeakDistance needs to be less than 0.99. Does anybody know an alternative solution for this?
Thank you!
%% Select sample of recording for visualisation
Sample = 160000
SecondChS = SecondCh(1:Sample,:);
FirstChS = FirstCh(1:Sample,:)
XS = NewX(1:Sample);
%%Top plot
nexttile
plot(XS,FirstChS)
title('First Channel')
%Bottom plot
nexttile
plot(XS,SecondChS)
title('Second Channel')
[pks,locs] = findpeaks(SecondChS,Sample,'MinPeakProminence',0.01,'Annotate','extents','MinPeakDistance',1000);

답변 (0개)

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

Community Treasure Hunt

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

Start Hunting!

Translated by