def detect_format(filename):
    """Detect file format of the channels based on extension.

    Parameters
    ----------
    filename : Path
        name of the filename

    Returns
    -------
    str
        file format
    """
    filename = Path(filename)

    if filename.suffix == '.csv':
        recformat = 'csv'
    elif filename.suffix == '.sfp':
        recformat = 'sfp'

    else:
        recformat = 'unknown'

    return recformat
Detect file format of the channels based on extension.

    Parameters
    ----------
    filename : Path
        name of the filename

    Returns
    -------
    str
        file format