PeriodicityPitch: Periodicity Pitch Image

Description Usage Arguments Details Value Author(s) Examples

View source: R/PeriodicityPitch.R

Description

This function calculates the periodicity pitch of a matrix containing neural firing patterns in different auditory channels. It is based on the idea that periodicity pitch is calculated as the summed autocorrelation over bandpass filtered fluctuations in auditory channels. Due to the fact that the output of the auditory model gives the envelopes of the neural firing probabilities (< 1250 Hz) it suffices to use a low-pass filter in order to obtain the pitch e.g. between 80 - 1250 Hz. Only the lowest frequency can be changed by inLowFrequency.

Usage

1
PeriodicityPitch(inMatrix, inSampleFreq, ...)

Arguments

inANI

an object of class ANI. It must contain the output of CalcANI function:

  • a matrix of size n x m where n is the number of auditory channels (<= 40) and m is the number of samples

  • the sample frequency of the input signal (in Hz).

inLowFrequency

cutoff frequency (in Hz) of a first order lowpass filter applied before calculating the autocorrelation if empty or not specified, 80 is used by default

inFrameWidth

width of the frame used for the accumulation of the autocorrelation (in s) if empty or not specified, 0.064 is used by default.

inFrameStepSize

stepsize or timeinterval between two inFrameWidths (in s) if empty or not specified, 0.010 is used by default.

Details

As for any frame-based function, the first value of the output signal is the value calculated for the first complete frame in the input signal.This means the following: if you have an input signal of length 1 s at a sample frequency of 1000 Hz, a frame width of 0.050 s, and a frame step size of 0.010 s, then there will be ceiling(((1 - 0.050)*1000 + 1)/(0.010*1000)) = 96 values in the output signal, where the first value corresponds to the first complete frame (the interval 0 to 0.050 s)

Value

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

PeriodicityPitchImage

periodicity pitch: a matrix of size inFrameWidth * length(inMatrix) / outSampleFreq

SampleFreq

sampling rate, equal to inSampleFreq/inFrameStepSize (in Hz).

Periods

analyzed periods (in s).

BPANI

bandpass filtered auditory nerve images (at the original sample frequency).

Author(s)

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

Examples

1
2
3
4
probe <- ShepardTone(293.66, 1, indBLevel = -20)
s <- c(SchumannKurioseGeschichte, numeric(2205), probe)
ANIs <- CalcANI(s, 22050)
PPs <- PeriodicityPitch(ANIs$AuditoryNerveImage, ANIs$ANIFreq)

m-vidal/pv01 documentation built on Dec. 2, 2020, 1:24 a.m.