def findfreqs(num, den, N):
ep = atleast_1d(roots(den)) + <NUM_LIT><EOL>tz = atleast_1d(roots(num)) + <NUM_LIT><EOL>if len(ep) == <NUM_LIT:0>:<EOL><INDENT>ep = atleast_1d(-<NUM_LIT:1000>) + <NUM_LIT><EOL><DEDENT>ez = r_['<STR_LIT>',<EOL>numpy.compress(ep.imag >= <NUM_LIT:0>, ep, axis=-<NUM_LIT:1>),<EOL>numpy.compress((abs(tz) < <NUM_LIT>) & (tz.imag >= <NUM_LIT:0>), tz, axis=-<NUM_LIT:1>)]<EOL>integ = abs(ez) < <NUM_LIT><EOL>hfreq = numpy.around(numpy.log10(numpy.max(<NUM_LIT:3> * abs(ez.real + integ) +<EOL><NUM_LIT> * ez.imag)) + <NUM_LIT:0.5>)<EOL>lfreq = numpy.around(numpy.log10(<NUM_LIT:0.1> * numpy.min(abs(real(ez + integ)) +<EOL><NUM_LIT:2> * ez.imag)) - <NUM_LIT:0.5>)<EOL>w = logspace(lfreq, hfreq, N)<EOL>return w<EOL>
Find an array of frequencies for computing the response of a filter.

Parameters
----------
num, den : array_like, 1-D
    The polynomial coefficients of the numerator and denominator of the
    transfer function of the filter or LTI system.  The coefficients are
    ordered from highest to lowest degree.
N : int
    The length of the array to be computed.

Returns
-------
w : (N,) ndarray
    A 1-D array of frequencies, logarithmically spaced.

Examples
--------
Find a set of nine frequencies that span the "interesting part" of the
frequency response for the filter with the transfer function

    H(s) = s / (s^2 + 8s + 25)

>>> findfreqs([1, 0], [1, 8, 25], N=9)
array([  1.00000000e-02,   3.16227766e-02,   1.00000000e-01,
         3.16227766e-01,   1.00000000e+00,   3.16227766e+00,
         1.00000000e+01,   3.16227766e+01,   1.00000000e+02])