class_docstr: fft tools for arma processes
  
  This class contains several methods that are providing the same or similar
  returns to try out and test different implementations.
  
  Notes
  -----
  TODO:
  check whether we do not want to fix maxlags, and create new instance if
  maxlag changes. usage for different lengths of timeseries ?
  or fix frequency and length for fft
  
  check default frequencies w, terminology norw  n_or_w
  
  some ffts are currently done without padding with zeros
  
  returns for spectral density methods needs checking, is it always the power
  spectrum hw*hw.conj()
  
  normalization of the power spectrum, spectral density: not checked yet, for
  example no variance of underlying process is used
class_docstr_tok: ["fft","tools","for","arma","processes","This","class","contains","several","methods","that","are","providing","the","same","or","similar","returns","to","try","out","and","test","different","implementations",".","Notes","--","--","-","TODO",":","check","whether","we","do","not","want","to","fix","maxlags",",","and","create","new","instance","if","maxlag","changes",".","usage","for","different","lengths","of","timeseries","?","or","fix","frequency","and","length","for","fft","check","default","frequencies","w",",","terminology","norw","n_or_w","some","ffts","are","currently","done","without","padding","with","zeros","returns","for","spectral","density","methods","needs","checking",",","is","it","always","the","power","spectrum","hw","*","hw.conj","(",")","normalization","of","the","power","spectrum",",","spectral","density",":","not","checked","yet",",","for","example","no","variance","of","underlying","process","is","used"]
docstr: spectral density for frequency using polynomial roots
  
  builds two arrays (number of roots, number of frequencies)
  
  Parameters
  ----------
  arroots : ndarray
      roots of ar (denominator) lag-polynomial
  maroots : ndarray
      roots of ma (numerator) lag-polynomial
  w : array_like
      frequencies for which spd is calculated
  
  Notes
  -----
  this should go into a function
docstr_tok: ["spectral","density","for","frequency","using","polynomial","roots","builds","two","arrays","(","number","of","roots",",","number","of","frequencies",")","Parameters","--","--","--","--","--","arroots",":","ndarray","roots","of","ar","(","denominator",")","lag-polynomial","maroots",":","ndarray","roots","of","ma","(","numerator",")","lag-polynomial","w",":","array_like","frequencies","for","which","spd","is","calculated","Notes","--","--","-","this","should","go","into","a","function"]
code: def _spdroots(self, arroots, maroots, w):
      """spectral density for frequency using polynomial roots
  
      builds two arrays (number of roots, number of frequencies)
  
      Parameters
      ----------
      arroots : ndarray
          roots of ar (denominator) lag-polynomial
      maroots : ndarray
          roots of ma (numerator) lag-polynomial
      w : array_like
          frequencies for which spd is calculated
  
      Notes
      -----
      this should go into a function
      """
      w = np.atleast_2d(w).T
      cosw = np.cos(w)
      # Greene 5th edt. p626, section 20.2.7.a.
      maroots = 1.0 / maroots
      arroots = 1.0 / arroots
      num = 1 + maroots**2 - 2 * maroots * cosw
      den = 1 + arroots**2 - 2 * arroots * cosw
      # print 'num.shape, den.shape', num.shape, den.shape
      hw = 0.5 / np.pi * num.prod(-1) / den.prod(-1)  # or use expsumlog
      return np.squeeze(hw), w.squeeze()
  
imports: import numpy
  import numpy.fft
  from scipy import signal
  from statsmodels.tsa.arima_process import ArmaProcess
label_desc: Use image node_id 12 for calling the ArmaFft obj's underlying member method code with example usage: obj._spdroots(arroots, maroots, w) and returns: np,  w