[R] need help with SIGNAL module

Michael Tiemann michaeltiemann at mac.com
Thu Nov 6 17:21:31 CET 2008

I sent this message to the maintainer's email address listed on the 
signal package, but it bounced.  Perhaps somebody on this list has more 
insight into the signal package than I do (or knows the maintainer's new 

question about buttord function in R signal module
Michael Tiemann <michaeltiemann at mac.com>
Thu, 06 Nov 2008 07:18:58 -0500

tshort at eprisolutions.com


I was trying to compare lowpass and highpass filters and found that the 
buttord example in the manual worked as expected, namely the $type was 
"low".  But when I reversed the Wp and Ws parameters, it resulted in an 
object with an empty $type instead of $type being "high".  I looked at 
the source code and found an obvious reason why:

        if (length(Wp) == 2) {
            warning("buttord seems to overdesign bandpass and bandreject
            if (any(stop))
                type = "stop"
            else type = "pass"
        else {
    ## here we set to "high" or "low", as expected
            if (any(stop))
                type = "high"
            else type = "low"
    ## here we arbitrarily override the type if there is a stop band
        if (any(stop))
            type = ""

Thank you for any explanation you can provide.


More information about the R-help mailing list