title: Python scipy.signal.remez high pass filter design yields strange transfer function
body: <p>I'm trying to design equiripple high-pass filters using python's scipy.signal.remez function. However, the resulting transfer functions look very strange to me with ~ 15 db peaking in the pass band and only 6 dB stop band attenuation. The corresponding low-pass design looks ok (~ 0.1 dB pass band ripple and 40 dB stop band attenuation):</p>
  
  <pre><code>#!/usr/bin/env python
  # -*- coding: iso-8859-15 -*-
  # Minimum working example for remez (equiripple) filter designs:
  from __future__ import division, print_function
  import numpy as np
  import scipy.signal as sig
  import matplotlib.pyplot as plt
  F_PB = 0.1  # corner frequency of pass band
  F_SB = 0.15 # corner frequency of stop band
  W_PB = 1    # weight factor for pass band 
  W_SB = 1    # weight factor for stop band
  L = 40 # filter order
  #b = sig.remez(L, [0, F_PB, F_SB, 0.5], [1, 0], [W_PB, W_SB], Hz = 1) # low pass
  b = sig.remez(L, [0, F_PB, F_SB, 0.5], [0, 1], [W_PB, W_SB], Hz = 1) # high pass
  # Calculate H(w), w = 0 ... pi, 1024 Pts.
  [w, H] = sig.freqz(b, worN = 1024)
  # Translate w to normalized frequencies F = 0 ... 0.5:                   
  F = w / (2 * np.pi)   
  plt.figure(1)
  plt.plot(F, 20 * np.log10(abs(H)))
  plt.title(r'Magnitude transfer function in dB')
  plt.show()
  </code></pre>
  
  <p>Can anybody explain to me what's going on?</p>
  
  <p>Cheers, Christian</p>