Learn R Programming

soundgen (version 2.7.0)

averageMatrices: Average matrices

Description

Internal soundgen function.

Usage

averageMatrices(mat_list, rFun = "max", cFun = "median", reduceFun = "+")

Arguments

mat_list

a list of matrices to aggregate (eg spectrograms or modulation spectra)

rFun,

cFun functions used to determine the number of rows and columns in the result

reduceFun

function used to aggregate

Details

Takes a list of matrices (normally modulation spectra), interpolates them to have the same size, and then reduces them (eg takes the average).

Examples

Run this code
mat_list = list(
  matrix(1:30, nrow = 5),
  matrix(80:17, nrow = 8)
)
soundgen:::averageMatrices(mat_list)
soundgen:::averageMatrices(mat_list, cFun = 'max', reduceFun = '*')

Run the code above in your browser using DataLab