MelFilter

final case class MelFilter(in: D, size: I, minFreq: D, maxFreq: D, sampleRate: D, bands: I) extends SingleOut[Double]

A UGen that maps short-time Fourier transformed spectra to the mel scale. To obtain the MFCC, one has to take the log of the output of this UGen and decimate it with a DCT.

Example:

def mfcc(in: GE) = {
 val fsz  = 1024
 val lap  = Sliding(in, fsz, fsz/2) * GenWindow(fsz, GenWindow.Hann)
 val fft  = Real1FFT(lap, fsz, mode = 1)
 val mag  = fft.complex.mag.max(-80)
 val mel  = MelFilter(mag, fsz/2, bands = 42)
 DCT_II(mel.log, 42, 13, zero = 0)
}
Value parameters:
bands

number of filter bands output

in

magnitudes of spectra, as output by Real1FFT(..., mode = 1).complex.abs

maxFreq

upper frequency to sample. Will be clipped between minFreq (inclusive) and Nyquist (exclusive).

minFreq

lower frequency to sample. Will be clipped between zero (inclusive) and Nyquist (exclusive).

size

bands in input spectrum (assumed to be fft-size / 2). lowest band corresponds to DC and highest to (size - 1)/size * sampleRate/2.

Companion:
object
trait Serializable
trait SingleOut[Double]
trait Lazy[Double]
trait GE[Double]
trait Expander[UGenInLike[Double]]
trait Lazy
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Inherited methods

final def name: String
Inherited from:
UGenSource
def productElementNames: Iterator[String]
Inherited from:
Product
def productIterator: Iterator[Any]
Inherited from:
Product