Description Usage Arguments Details Value Author(s) Examples
View source: R/PeriodicityPitch.R
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
.
1 | PeriodicityPitch(inMatrix, inSampleFreq, ...)
|
inANI |
an object of class
|
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. |
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)
An object of class "ANI
", which is a list with the following elements:
PeriodicityPitchImage |
periodicity pitch: a matrix of size |
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). |
Marc Vidal (R
version). Based on the original code from Marc Leman.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.