Learn R Programming

seewave (version 1.5.5)

lfs: Linear Frequency Shift

Description

This function linearly shifts all the frequency content of a time wave.

Usage

lfs(wave, f, shift, wl = 128, wn = "hanning", Sample = FALSE)

Arguments

wave
a vector, a matrix (first column), an object of class ts, Sample (left channel), or Wave (left channel).
f
sampling frequency of wave (in Hz). Does not need to be specified if wave is an object of class ts, Sample, or Wave<
shift
positive or negative frequency shift to apply (in Hz).)
wl
window length for the analysis (even number of points, by default = 512).
wn
window name, see ftwindow (by default "hanning").
Sample
if TRUE and plot is FALSE returns an object of class Sample

Value

  • If plot is FALSE, a new wave is returned as a one-column matrix or as a Sample object if Sample is TRUE.

Details

A short-term Fourier transform is first applied to the signal (see spectro), then the frequency shift is applied and the new signal is eventually generated using the reverse of the Fourier Transform (fft). There is therefore neither temporal modifications nor amplitude modifications.

References

Hopp, S. L., Owren, M. J. and Evans, C. S. (Eds) 1998. Animal acoustic communication. Springer, Berlin, Heidelberg.

See Also

ffilter, spectro

Examples

Run this code
data(orni)
a<-lfs(orni,f=22050,shift=1000)
spectro(a,f=22050)
# to be compared with the original signal
spectro(orni,f=22050)

Run the code above in your browser using DataLab