def compute_voltages(df_samples, sig):
    """Compute the voltage of extrema and zero-crossings.

    Parameters
    ---------
    df_samples : pandas.DataFrame
        Contains cycle points locations for each spike.
    sig : 1d array
        Voltage time series.

    Returns
    -------
    volt_trough : 1d array
        Voltage at the trough.
    volt_last_peak : 1d array
        Voltage at the last peak.
    volt_next_peak : 1d array
        Voltage at the next peak.
    volt_decay : 1d array
        Voltage at the decay before the trough.
    volt_rise : 1d array
        Voltage at the rise after the trough.
    """

    volt_trough = sig[df_samples['sample_trough'].values]
    volt_last_peak = sig[df_samples['sample_last_peak'].values]
    volt_next_peak = sig[df_samples['sample_next_peak'].values]
    volt_decay = sig[df_samples['sample_decay'].values]
    volt_rise = sig[df_samples['sample_rise'].values]

    return volt_trough, volt_last_peak, volt_next_peak, volt_decay, volt_rise