ffilter {seewave}R Documentation

Frequency filter

Description

This function filters out a selected frequency section of a time wave (low-pass, high-pass, low-stop, high-stop, bandpass or bandstop frequency filter).

Usage

ffilter(wave, f, from = FALSE, to = FALSE, bandpass = TRUE,
wl = 512, wn = "hanning")

Arguments

wave data describing a time wave or a Sample object created loading a wav file with loadSample (package Sound).
f sampling frequency of wave (in Hz).
from start frequency (in Hz) where to apply the filter.
to end frequency (in Hz) where to apply the filter.
bandpass if TRUE a band-pass filter is applied between from and to, if FALSE a band-stop filter is applied between from and to (by default TRUE).
wl window length for the analysis (even number of points).
wn window name, see ftwindow (by default "hanning").

Details

A short-term Fourier transform is first applied to the signal (see spectro), then the frequency filter 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.

Value

fls returns a one-column matrix describing the new wave.

Author(s)

Jérôme Sueur jerome.sueur@univ-tours.fr

See Also

afilter,lfs

Examples

a<-noise(f=8000,d=1)
# low-pass
b<-ffilter(a,f=8000,to=1500)
spectro(b,f=8000,wl=512)
# high-pass
c<-ffilter(a,f=8000,from=2500)
spectro(c,f=8000,wl=512)
# band-pass
d<-ffilter(a,f=8000,from=1000,to=2000)
spectro(d,f=8000,wl=512)
# band-stop
e<-ffilter(a,f=8000,from=1500,to=2500,bandpass=FALSE)
spectro(e,f=8000,wl=512)

[Package seewave version 1.4.2 Index]