Santiago Barreda
Assistant Professor, Department of Linguistics, UC Davis

Main Research Vignettes CV phonTools Statistics Links

 


FIRfilter [phonTools]

 

This functions allows the user to filter signals using a finite impulse response (FIR) digital filter with a linear phase response. This function may perform high-pass, low-pass and band-pass filtering. The filter can have any desired order resulting in arbitrarily narrow transition regions.

In the example below, flat-spectrum white noise has been filtered by several different kinds of filters, and the boundaries between stop and pass-bands are shown by vertical red lines.

 

 

 

 

 

Code used to generate examples:


library (phonTools) noise = rnorm (10000, 0, 1) ## generate flat-spectrum noise ## perform lowpass, highpass and bandpass filtering of this noise bandpass = FIRfilter (noise, from = 3000, to = 7000) lowpass = FIRfilter (noise, from = 0, to = 6000) highpass = FIRfilter (noise, from = 6000, to = 11025) ## plot spectra of the resulting filtered sounds par (mfrow = c(4,1), mar = c(4,4,1,1)) spectralslice (noise, ylim = c(-120, 5),fs=22050) spectralslice (bandpass, ylim = c(-120, 5),fs=22050) abline (v = c(3000,7000), lwd = 2, col = 2) spectralslice (lowpass, ylim = c(-120, 5),fs=22050) abline (v = 6000, lwd = 2, col = 2) spectralslice (highpass, ylim = c(-120, 5),fs=22050) abline (v = 6000, lwd = 2, col = 2)