def _string_to_Hz(string):
    """Convert a string to a frequency in [Hz]."""
    if isinstance(string, float):
        return string
    if isinstance(string, int):
        return string
    factor = {'GHz': 1e9, 'MHz': 1e6, 'kHz': 1e3, 'Hz': 1e0}
    raw = string
    for key in ['GHz', 'MHz', 'kHz', 'Hz']:
        raw = raw.replace(key, '')
    for key in ['GHz', 'MHz', 'kHz', 'Hz']:
        if key in string:
            return float(raw) * factor[key]