@classmethod
def read_from_file(cls, filename):
    """
             gets a file name and load the file as a Signal class

            :param filename: signal file name
            :return: instance of Signal class

             """
    x_vec = []
    y_vec = []
    with open(filename) as signal_file:
        for line in signal_file:
            if '#' in line:
                continue
            values = line.split()
            if len(values) > 1:
                try:
                    x = float(values[0])
                    y = float(values[1])
                    x_vec.append(x)
                    y_vec.append(y)
                except ValueError:
                    continue
    return cls(x_vec, y_vec)
