This works by keeping a history of 'window_len' elements and the sum of them.
        Every clock last element will be subtracted and new added to the sum.
        More good infos: https://www.dsprelated.com/showarticle/58.php

        :param x: input to average
        :return: averaged output
        :rtype: Sfix

def main(self, x):
        """
        This works by keeping a history of 'window_len' elements and the sum of them.
        Every clock last element will be subtracted and new added to the sum.
        More good infos: https://www.dsprelated.com/showarticle/58.php

        :param x: input to average
        :return: averaged output
        :rtype: Sfix
        """
        # divide by window_pow
        div = x >> self.WINDOW_POW

        # add new element to shift register
        self.mem = [div] + self.mem[:-1]

        # calculate new sum
        self.sum = self.sum + div - self.mem[-1]
        return self.sum