def get_channel_type(channel_name, sigtypes_filename):
    """Returns type of channel

    Arguments
    ---------
    channel_name: name of channel (e.g. "II", "V", etc.)

    sigtypes_filename: file mapping channel names to channel
    types

    Returns
    -------
    Type of channel (e.g. "ECG", "BP", "PLETH", "Resp")
    """

    channel_types_dict = {}
    with open(sigtypes_filename, "r") as f:
        for line in f:
            splitted_line = line.split("\t")
            channel = splitted_line[-1].rstrip()
            channel_type = splitted_line[0]
            channel_types_dict[channel] = channel_type

    if channel_name in channel_types_dict.keys():
        return channel_types_dict[channel_name]

    raise Exception("Unknown channel name")