ContextualityIndex: Tone Contextuality Index

View source: R/ContextualityIndex.R

ContextualityIndexR Documentation

Tone Contextuality Index

Description

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.

Usage

ContextualityIndex(inANIObj, inSnapShot = NULL, inHalfDecayChords = 0.1,
                  inHalfDecayToneCenters = 1.5, inEnlargement = 0)

Arguments

inANIObj

an object of class "AI". It must contain the output of the PeriodicityPitch function: a periodicity pitch image, its sample frequency (in Hz) and the periods of periodicity analysis (in s).

inSnapShot

time where the snapshot should be taken (in s). If negative, the time is taken at abs(inSnapShot) from the end of the sample. If empty or not specified, the time of the last sample is used by default.

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, 2*inHalfDecayToneCenters is used. If empty or not specified, 0 is used by default.

Details

Sample frequency of output signals is the same as inSampleFreq.

Value

An object of class "AI", which is a list with the following elements:

ChordsImage

local integration of inPeriodicityPitch into chord image.

ToneCentersImage

global integration of inPeriodicityPitch into tone center image.

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.

Note

Sample frequency of output signals is the same as inSampleFreq.

Author(s)

Marc Vidal (R version). Based on the original code from IPEM Toolbox.

References

Leman, M. (2000). An auditory model of the role of short-term memory in probe-tone ratings. Music Perception, 17(4), pp.481-509.

Examples

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)

m-vidal/eaR documentation built on Nov. 18, 2022, 3:55 p.m.