cheb1ord               package:signal               R Documentation

_C_h_e_b_y_s_h_e_v _t_y_p_e-_I _f_i_l_t_e_r _o_r_d_e_r _a_n_d _c_u_t_o_f_f

_D_e_s_c_r_i_p_t_i_o_n:

     Compute discrete Chebyshev type-I filter order and cutoff for the
     desired response characteristics.

_U_s_a_g_e:

     cheb1ord(Wp, Ws, Rp, Rs)

_A_r_g_u_m_e_n_t_s:

  Wp, Ws: pass-band and stop-band edges. For a low-pass or high-pass
          filter, 'Wp' and 'Ws' are scalars. For a band-pass or
          band-rejection filter, both are vectors of length 2. For a
          low-pass filter, Wp < Ws. For a high-pass filter, Ws > Wp.
          For a band-pass (Ws[1] < Wp[1] < Wp[2] < Ws[2]) or
          band-reject (Wp[1] < Ws[1] < Ws[2] < Wp[2]) filter design,
          'Wp' gives the edges of the pass band, and 'Ws' gives the
          edges of the stop band. Frequencies are normalized to [0,1],
          corresponding to the range [0, Fs/2]. 

      Rp: allowable decibels of ripple in the pass band. 

      Rs: minimum attenuation in the stop band in dB. 

_V_a_l_u_e:

     An object of class 'FilterOfOrder' with the following list
     elements: 

       n: filter order 

      Wc: cutoff frequency 

      Rp: allowable decibels of ripple in the pass band 

    type: filter type, one of "low", "high", "stop", or "pass" 

     This object can be passed directly to 'cheby1' to compute filter
     coefficients.

_A_u_t_h_o_r(_s):

     Original Octave version by Paul Kienzle, pkienzle@user.sf.net and
     by Laurent S. Mazet. Conversion to R by Tom Short.

_R_e_f_e_r_e_n_c_e_s:

     Octave Forge <URL: http://octave.sf.net>

_S_e_e _A_l_s_o:

     'cheby1', 'FilterOfOrder', 'buttord'

_E_x_a_m_p_l_e_s:

     Fs = 10000
     chord = cheb1ord(1000/(Fs/2), 1200/(Fs/2), 0.5, 29)
     plot(c(0, 1000, 1000, 0, 0), c(0, 0, -0.5, -0.5, 0),
          type = "l", xlab = "Frequency (Hz)", ylab = "Attenuation (dB)")
     ch1 = cheby1(chord)
     plot(c(0, 1000, 1000, 0, 0), c(0, 0, -0.5, -0.5, 0),
          type = "l", xlab = "Frequency (Hz)", ylab = "Attenuation (dB)",
          col = "red", ylim = c(-10,0), xlim = c(0,2000))
     hf = freqz(ch1, Fs = Fs)
     lines(hf$f, 20*log10(abs(hf$h)))

