get_ccr_peaks {cmpsR} | R Documentation |
Identify peaks of a cross correlation curve
Description
Given a comparison profile and a segment, get_ccr_peaks
computes the
cross correlation curve and finds peaks of the curve.
Usage
get_ccr_peaks(comp, segments, seg_outlength, nseg = 1, npeaks = 5)
Arguments
comp |
a nueric vector, vector of the bullet comparison profile |
segments |
list with basis segments and their corresponding indices in the original profile, obtianed by |
seg_outlength |
length of the enlarged segment |
nseg |
integer. |
npeaks |
integer. the number of peaks to be identified. |
Value
a list consisting of:
-
ccr
: the cross correlation curve -
adj_pos
: indices of the curve -
peaks_pos
: position of the identified peaks -
peaks_heights
: the cross correlation value (height of the curve) of the peaks
Examples
data("bullets")
land2_3 <- bullets$sigs[bullets$bulletland == "2-3"][[1]]
land1_2 <- bullets$sigs[bullets$bulletland == "1-2"][[1]]
x <- land2_3$sig
y <- land1_2$sig
segments <- get_segs(x, len = 50)
# compute ccf based on y and segment 7 with scale 1, then identify 5 highest peaks
ccrpeaks <- get_ccr_peaks(y, segments = segments, seg_outlength = 50,
nseg = 7, npeaks = 5)
[Package cmpsR version 0.1.2 Index]