Main Content

Determinar la anchura de los picos

Cree una señal que consista en una suma de curvas de campana. Especifique la ubicación, la altura y la anchura de cada curva.

x = linspace(0,1,1000);

Pos = [1 2 3 5 7 8]/10;
Hgt = [4 4 2 2 2 3];
Wdt = [3 8 4 3 4 6]/100;

for n = 1:length(Pos)
    Gauss(n,:) =  Hgt(n)*exp(-((x - Pos(n))/Wdt(n)).^2);
end

PeakSig = sum(Gauss);

Represente las curvas individuales y su suma.

plot(x,Gauss,'--',x,PeakSig)
grid

Figure contains an axes object. The axes object contains 7 objects of type line.

Mida la anchura de los picos utilizando la media prominencia como referencia.

findpeaks(PeakSig,x,'Annotate','extents')

Figure contains an axes object. The axes object contains 4 objects of type line. These objects represent signal, peak, prominence, width (half-prominence).

Vuelva a medir las anchuras, esta vez utilizando la media altura como referencia.

findpeaks(PeakSig,x,'Annotate','extents','WidthReference','halfheight')
title('Signal Peak Widths')

Figure contains an axes object. The axes object with title Signal Peak Widths contains 6 objects of type line. These objects represent signal, peak, height, width (half-height), border.