View source: R/ContextualityIndex.R
| ContextualityIndex | R Documentation |
The contextuality index measures the pitch commonality between two running periodicity pitch images, each one having a possible different echo. For both images, pitch commonality is also evaluated with respect to a probe. In Leman (2000), the contextuality index is used to measure the pitch commonality of local (short echo) images versus global (long echo) images.
The function uses a periodicity pitch image
to determine two echoed images with a different rate of decay using LeakyIntegration. Then, Pearson's correlation coefficient is calculated across all periodicities concerning the following methods:
Inspection: compares a fixed local image (the probe) with running local images and running global images.
Comparison: compares a running local image with a running global image.
ContextualityIndex(inANIObj, inSnapShot = NULL, inHalfDecayChords = 0.1,
inHalfDecayToneCenters = 1.5, inEnlargement = 0)
inANIObj |
an object of class " |
inSnapShot |
time where the snapshot should be taken (in s). If negative, the time is taken at |
inHalfDecayChords |
half decay time for leaky integration into chord image (local image). If empty or not specified, 0.1 is used by default. |
inHalfDecayToneCenters |
half decay time for leaky integration into tone center image (global image). If empty or not specified, 1.5 is used by default. |
inEnlargement |
time by which the input signal is enlarged (in s). If -1, |
Sample frequency of output signals is the same as inSampleFreq.
An object of class "AI", which is a list with the following elements:
ChordsImage |
local integration of |
ToneCentersImage |
global integration of |
LocalInspection |
correspondence between chord taken at snapshot position and running chord image. |
GlobalInspection |
correspondence between chord taken at snapshot position and running tone center image |
Comparison |
correspondence between running chord image and running tone center image. |
PlotContextualityIndex |
the plot of the three indices. |
Sample frequency of output signals is the same as inSampleFreq.
Marc Vidal (R version). Based on the original code from IPEM Toolbox.
Leman, M. (2000). An auditory model of the role of short-term memory in probe-tone ratings. Music Perception, 17(4), pp.481-509.
C <- ShepardToneComplex(c(1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0),0.75,22050,1,-20) F <- ShepardToneComplex(c(1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0),0.75,22050,1,-20) G <- ShepardToneComplex(c(0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1),0.75,22050,1,-20) s <- c(C, F, G, C) ANIs <- CalcANI(s, 22050) PPs <- PeriodicityPitch(ANIs) CIs <- ContextualityIndex(PPs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.