code: def make_padded_frequency_series(vec,filter_N=None):
      
      if filter_N is None:
          power = ceil(log(len(vec),2))+1
          N = 2 ** power
      else:
          N = filter_N
      n = N/2+1
  
  
      if isinstance(vec,FrequencySeries):
          vectilde = FrequencySeries(zeros(n, dtype=complex_same_precision_as(vec)),
                                     delta_f=1.0,copy=False)
  	if len(vectilde) < len(vec):
  	    cplen = len(vectilde)
          else:
              cplen = len(vec)
          vectilde[0:cplen] = vec[0:cplen]
          delta_f = vec.delta_f
  
  
      if isinstance(vec,TimeSeries):
          vec_pad = TimeSeries(zeros(N),delta_t=vec.delta_t,
                           dtype=real_same_precision_as(vec))
          vec_pad[0:len(vec)] = vec
          delta_f = 1.0/(vec.delta_t*N)
          vectilde = FrequencySeries(zeros(n),delta_f=1.0,
                                 dtype=complex_same_precision_as(vec))
          fft(vec_pad,vectilde)
  
      vectilde = FrequencySeries(vectilde * DYN_RANGE_FAC,delta_f=delta_f,dtype=complex64)
      return vectilde
docs: Pad a TimeSeries with a length of zeros greater than its length, such
      that the total length is the closest power of 2. This prevents the effects
      of wraparound.