def process_reference_file(filename):
    """

    Process the reference file and return a list of signal names.

    :param string filename
        Name of the reference file.
    
    :return list signal_reference
        List with the names of the reference file signals.

    """

    signal_reference = []
    with open(filename, 'r') as ref:
        for line in ref:
            line = line.split()
            if len(line) == 0: continue
            #
            if line[0]=='Channels' and line[1]=='Changed':
                break
            #
            if line[0]=='Channel':
                name = line[2]
                #inv_name = name.split('-')[1] + '-' + name.split('-')[0]
                #if name not in signal_reference:
                #    signal_reference.append(line[2])
                if name in signal_reference:
                    name = name + '_2'
                signal_reference.append(name)

    
    return signal_reference