Description Usage Arguments Details Value Author(s) See Also Examples
This function filters out a selected frequency section of a time wave (lowpass, highpass, lowstop, highstop, bandpass or bandstop frequency filter).
1 2 3 
wave 
an R object. 
f 
sampling frequency of 
channel 
channel of the R object, by default left channel (1). 
from 
start frequency (in Hz) where to apply the filter. 
to 
end frequency (in Hz) where to apply the filter. 
bandpass 
if 
custom 
a vector describing the frequency response of a custom filter.
This can be manually generated or obtained with 
wl 
window length for the analysis (even number of points). 
ovlp 
overlap between successive FFT windows (in %). 
wn 
window name, see 
fftw 
if 
rescale 
a logical, if 
listen 
a logical, if 
output 
character string, the class of the object to return, either

A shortterm 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
(istft
).
There is therefore neither temporal modifications nor
amplitude modifications.
If plot
is FALSE
, a new wave is returned. The class
of the returned object is set with the argument output
.
Jerome Sueur
afilter
,lfs
,fir
,
preemphasis
, combfilter
, bwfilter
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  a<noisew(f=8000,d=1)
# lowpass
b<ffilter(a,f=8000,to=1500)
spectro(b,f=8000,wl=512)
# highpass
c<ffilter(a,f=8000,from=2500)
spectro(c,f=8000,wl=512)
# bandpass
d<ffilter(a,f=8000,from=1000,to=2000)
spectro(d,f=8000,wl=512)
# bandstop
e<ffilter(a,f=8000,from=1500,to=2500,bandpass=FALSE)
spectro(e,f=8000,wl=512)
# custom
myfilter1<rep(c(rep(0,64),rep(1,64)),4)
g<ffilter(a,f=8000,custom=myfilter1)
spectro(g,f=8000)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.