[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 
address):

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

To:
tshort at eprisolutions.com


Tom,

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
    filters")
            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
    defined...why?
        if (any(stop))
            type = ""

Thank you for any explanation you can provide.

M



More information about the R-help mailing list