Cross Recurrence Plot Toolbox v5.29 (R38)

CRP Toolbox


Mean of the diagonal line lengths and their distribution.


[a b]=dl(x)
[a b]=dl(x,'param1','param2')


a=dl(x) computes the mean of the length of the diagonal line structures in a recurrence plot using a specific algorithums (see below).

[a b]=dl(x) computes the mean a and the lengths of the found diagonal lines, stored in b. In order to get the histogramme of the line lengths, simply call hist(b,[1 max(b)]).

...=dl(x,method) uses the specified method for considering border lines (lines starting and ending at a border of the RP).

Methods regarding considering border lines.
'all' (Default) Considers all individual lengths of border lines.
'censi' Correction schema for border lines as proposed by Censi et al. 2004, in which the length of the longest border line is used for all border lines (recommended for cyclical signals).
'kelo' Correction schema for border lines using KEep LOngest diagonal line (KELO), in which only the longest border line (in each triangle) of the RP is considered but all other border lines are discarded.
'semi' Relaxing the definition of border lines: not only lines starting AND ending at a border of the RP, but also semi border lines, which are lines that start or end at a border of the RP but have the corresponding ending or starting not at the border, are count. Has only effect for 'censi' or 'kelo' method.


In Censi et al. 2004, the length of the LOI was considered to be the longest borderline. Here we use a modification by excluding the LOI from the set of borderlines. This usually results in a shorter length of the border lines than in the original Censi approach. But this would allow us to use this correction schema also for non-cyclical signals without strange effects.


a = sin(linspace(0,5*2*pi,1000));
X = crp(a,2,50,.2,'nonorm','nogui');
[l1 l_dist1] = dl(X,'all'); % considering all border lines
[l2 l_dist2] = dl(X,'censi'); % apply Censi correction for border lines
[l3 l_dist3] = dl(X,'kelo'); % apply KELO correction for border lines
title(sprintf('considering all border lines, l=%.1f',l1))
title(sprintf('Censi correction, l=%.1f',l2))
title(sprintf('KELO correction, l=%.1f',l3))

See Also

crqa, tt


Censi, F., et al.: Proposed corrections for the quantification of coupling patterns by recurrence plots, IEEE Trans. Biomed. Eng., 51, 2004.

Kraemer, K. H., Marwan, N.: Border effect corrections for diagonal line based recurrence quantification analysis measures, Phys. Lett. A, 383, 2019.