def update_and_send_ElectrodeQualities(self, d_raw: np.ndarray, d_preproc: np.ndarray, ts: int):
    '[compute running estimate of electrode qality and stream it]\n\n        Args:\n            d_raw (np.ndarray): [description]\n            d_preproc (np.ndarray): [description]\n            ts (int): [description]\n        '
    (raw_power, preproc_power) = self.update_electrode_powers(d_raw, d_preproc)
    raw_amp = np.sqrt(raw_power)
    preproc_amp = np.sqrt(preproc_power)
    noise2sig = (np.maximum(float(1e-06), np.abs((raw_amp - preproc_amp))) / np.maximum(float(1e-08), preproc_amp))
    noise2sig[(raw_power < 1e-06)] = 100
    noise2sig[(preproc_amp > (raw_amp * 10))] = 100
    noise2sig = np.minimum(noise2sig, 100)
    if ((self.last_sigquality_ts is None) or (ts > (self.last_sigquality_ts + self.send_sigquality_interval))):
        print('SigQ:\nraw_power=({}/{})\npp_power=({}/{})\nnoise2sig={}'.format(raw_amp, d_raw.shape[0], preproc_amp, d_preproc.shape[0], noise2sig))
        print('Q', end='')
        self.sendMessage(SignalQuality(None, noise2sig))
        self.last_sigquality_ts = ts
        if (self.VERBOSITY > 2):
            import matplotlib.pyplot as plt
            plt.figure(10)
            ts = self.data_ringbuffer[:, (- 1)]
            idx = np.flatnonzero(ts)
            if (len(idx) > 0):
                ts = ts[idx[0]:]
                plt.subplot(211)
                plt.cla()
                plt.plot(np.diff(ts))
                plt.title('diff time-sample')
                plt.subplot(212)
                plt.cla()
                plt.plot(((ts - ts[0]) - ((np.arange(len(ts)) * 1000.0) / self.fs)))
                plt.title('regression against sample-number')
                plt.show(block=False)
[compute running estimate of electrode qality and stream it]

Args:
    d_raw (np.ndarray): [description]
    d_preproc (np.ndarray): [description]
    ts (int): [description]
def update_and_send_ElectrodeQualities(self, d_raw: np.ndarray, d_preproc: np.ndarray, ts: int):
    '[compute running estimate of electrode qality and stream it]\n\n        Args:\n            d_raw (np.ndarray): [description]\n            d_preproc (np.ndarray): [description]\n            ts (int): [description]\n        '
    (raw_power, preproc_power) = self.update_electrode_powers(d_raw, d_preproc)
    raw_amp = np.sqrt(raw_power)
    preproc_amp = np.sqrt(preproc_power)
    noise2sig = (np.maximum(float(1e-06), np.abs((raw_amp - preproc_amp))) / np.maximum(float(1e-08), preproc_amp))
    noise2sig[(raw_power < 1e-06)] = 100
    noise2sig[(preproc_amp > (raw_amp * 10))] = 100
    noise2sig = np.minimum(noise2sig, 100)
    if ((self.last_sigquality_ts is None) or (ts > (self.last_sigquality_ts + self.send_sigquality_interval))):
        print('SigQ:\nraw_power=({}/{})\npp_power=({}/{})\nnoise2sig={}'.format(raw_amp, d_raw.shape[0], preproc_amp, d_preproc.shape[0], noise2sig))
        print('Q', end=)
        self.sendMessage(SignalQuality(None, noise2sig))
        self.last_sigquality_ts = ts
        if (self.VERBOSITY > 2):
            import matplotlib.pyplot as plt
            plt.figure(10)
            ts = self.data_ringbuffer[:, (- 1)]
            idx = np.flatnonzero(ts)
            if (len(idx) > 0):
                ts = ts[idx[0]:]
                plt.subplot(211)
                plt.cla()
                plt.plot(np.diff(ts))
                plt.title('diff time-sample')
                plt.subplot(212)
                plt.cla()
                plt.plot(((ts - ts[0]) - ((np.arange(len(ts)) * 1000.0) / self.fs)))
                plt.title('regression against sample-number')
                plt.show(block=False)