docstr: Compute mean squared error versus ideal response across frequency
  band.
    h -- coefficients
    bands -- list of (left, right) tuples relative to 1==Nyquist of
      passbands
docstr_tok: ["Compute","mean","squared","error","versus","ideal","response","across","frequency","band",".","h","--","coefficients","bands","--","list","of","(","left",",","right",")","tuples","relative","to","1==Nyquist","of","passbands"]
code: def mse(self, h, bands):
      """Compute mean squared error versus ideal response across frequency
      band.
        h -- coefficients
        bands -- list of (left, right) tuples relative to 1==Nyquist of
          passbands
      """
      w, H = freqz(h, worN=1024)
      f = w / np.pi
      passIndicator = np.zeros(len(w), bool)
      for left, right in bands:
          passIndicator |= (f >= left) & (f < right)
      Hideal = np.where(passIndicator, 1, 0)
      mse = np.mean(abs(abs(H) - Hideal) ** 2)
      return mse
  
imports: import numpy
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_equal, assert_, assert_allclose, assert_warns
  from pytest import raises
  import pytest
  from scipy.fft import fft
  from scipy.special import sinc
  from scipy.signal import kaiser_beta, kaiser_atten, kaiserord, firwin, firwin2, freqz, remez, firls, minimum_phase
label_desc: Use image node_id 3 for calling the TestFirwin obj's underlying member method code with example usage: obj.mse(h, bands) and returns: mse