Learn R Programming

wrassp (version 0.1.3)

cssSpectrum: cssSpectrum

Description

calculate cepstrally smoothed spectrum using libassp

Usage

cssSpectrum(listOfFiles = NULL, optLogFilePath = NULL, beginTime = 0,
  centerTime = FALSE, endTime = 0, resolution = 40, fftLength = 0,
  windowShift = 5, window = "BLACKMAN", numCeps = 0, toFile = TRUE,
  explicitExt = NULL, outputDirectory = NULL,
  forceToLog = useWrasspLogger)

Arguments

listOfFiles
vector of file paths to be processed by function
optLogFilePath
path to option log file
beginTime
=
centerTime
=
endTime
=
resolution
= : set FFT length to the smallest value which results in a freqequency resolution of Hz or better (default: 40.0)
fftLength
= : set FFT length to points (overrules default and 'resolution' option)
windowShift
= : set analysis window shift to ms (default: 5.0)
window
= : set analysis window function to (default: BLACKMAN)
numCeps
= : set number of cepstral coeffcients used to (default: sampling rate in kHz + 1; minimum: 2)
toFile
write results to file (default extension depends on )
explicitExt
set if you wish to overwride the default extension
outputDirectory
directory in which output files are stored. Defaults to NULL, i.e. the directory of the input files
forceToLog
is set by the global package variable useWrasspLogger. This is set to FALSE by default and should be set to TRUE is logging is desired.

Value

  • nrOfProcessedFiles or if only one file to process return AsspDataObj of that file

Details

Short-term spectral analysis of the signal in using the Fast Fourier Transform and cepstral smoothing. Analysis results will be written to a file with the base name of the input file and '.css.' as extension. Default output is in SSFF format with 'css' in lower case as track name.

See Also

dftSpectrum, lpsSpectrum, cepstrum; all derived from libassp's spectrum function.

Examples

Run this code
# get path to audio file
path2wav <- list.files(system.file("extdata", package = "wrassp"),
                       pattern = glob2rx("*.wav"),
                       full.names = TRUE)[1]

# calculate cepstrally smoothed spectrum
res <- cssSpectrum(path2wav, toFile=FALSE)

# plot spectral values at midpoint of signal
plot(res$css[dim(res$css)[1]/2,],
     type='l',
     xlab='spectral value index',
     ylab='spectral value')

Run the code above in your browser using DataLab