## specify a filter with an arbitrary response
frequency = c(0, 500, 502.5, 5000, 5002.5, 7000, 7002.5, 11025)
power = c(0, 0, -50, -50, -10, -10, -70, -70)
## create the filter and verify that the frequency response is as desired
testfilter = makeFIR (frequency, power, verify = TRUE)
## create a vector of random noise
noise = rnorm (2000, 0, 200)
## filter the sound using the verify parameter in order to
## verify that the filtered sound has the desired spectral envelope
snd = FIRfilter (noise, testfilter, verify = TRUE)
Run the code above in your browser using DataLab