def METHOD_NAME(self, nbytes, x):
    ### 3.3.6.2 Downsampling and filtering input
    mf = int(16 * self.ms)
    r = len(x) // mf
    x_att = np.array([ np.sum(x[i*r:(i+1)*r]) for i in range(mf) ])
    x_hp = np.empty(mf)
    x_hp[0 ] = 0.375 * x_att[0 ] - 0.5 * self.xn1    + 0.125 * self.xn2
    x_hp[1 ] = 0.375 * x_att[1 ] - 0.5 * x_att[0   ] + 0.125 * self.xn1
    x_hp[2:] = 0.375 * x_att[2:] - 0.5 * x_att[1:-1] + 0.125 * x_att[0:-2]
    self.xn2 = x_att[-2]
    self.xn1 = x_att[-1]
    ### 3.3.6.3 Energy calculation
    nb = int(self.ms / 2.5)
    e_att = np.array([ np.sum(np.square(x_hp[40*i:40*(i+1)]))
                       for i in range(nb) ])
    a_att = np.empty(nb)
    a_att[0] = np.maximum(0.25 * self.an1, self.en1)
    for i in range(1,nb):
        a_att[i] = np.maximum(0.25 * a_att[i-1], e_att[i-1])
    self.en1 = e_att[-1]
    self.an1 = a_att[-1]
    ### 3.3.6.4 Attack Detection
    p_att = -1
    flags = [ (e_att[i] > 8.5 * a_att[i]) for i in range(nb) ]
    for (i, f) in enumerate(flags):
        if f: p_att = i
    f_att = p_att >= 0 or self.p_att - 1 >= nb // 2
    self.p_att = 1 + p_att
    return self.is_enabled(nbytes) and f_att