Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

as.spectral

Function to convert an object into an object of class 'spectral'.


Description

The function converts a vector, matrix, or EMU-trackdata object into an object of the same class and of class 'spectral'

Usage

as.spectral(trackdata, fs)

Arguments

trackdata

A vector, matrix, or EMU-trackdata object.

fs

Either a single element numeric vector, or a numeric vector of the same length as the length of trackdata if trackdata is a vector, or of the same number of rows as trackdata

Details

If fs is a single element numeric vector, then the frequencies of trackdata are defined to extend to fs/2. If fs is missing, then the frequencies are 0:(N-1) where N is the length of trackdata.

Value

The same object but of class 'spectral'.

Author(s)

Jonathan Harrington

See Also

Examples

vec = 1:10
as.spectral(vec, 2000)
mat = rbind(1:10, 1:10)
as.spectral(mat)
# turn a spectral trackdata object into a trackdata object
tr = as.trackdata(rbind(fric.dft$data), fric.dft$index, fric.dft$ftime)
# turn it into a spectral trackdata object with sampling freq 16 kHz
tr = as.spectral(tr, 16000)
# list the frequencies
trackfreq(tr)
# Notice that only the $data is made into a spectral matrix,
# not the entire trackdata object
# so this is trackdata
class(tr)
# this is a spectral matrix
class(tr$data)

emuR

Main Package of the EMU Speech Database Management System

v2.2.0
GPL (>= 2)
Authors
Raphael Winkelmann [aut, cre], Klaus Jaensch [aut, ctb], Steve Cassidy [aut, ctb], Jonathan Harrington [aut, ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.