def get_delay_shift_frac(delay,fs,data_type=0):
    """
    Compute integer and fractional shift.
    
    Parameters
    ----------
     delay : float
         value for the delay [s].
     fs : float
         sampling frequency [Hz].
     data_type : int
         0 for real, 1 for complex.
     
    Returns
    -------
     shift_int : int
         offset in number of samples.
     fractional_sample_delay : float
         fractional sample.
    
    Notes
    -----
     Data type is for being used with complex samples unpacked as a list of integers (in msvf),
      otherwise it should be left as zero.
    """
    shift = delay * fs

    fractional_sample_delay = shift%1
    shift_int = int(shift//1)
    if data_type==1:
        shift_int*=2
    
    
    if fractional_sample_delay>0.5:
        fractional_sample_delay-=1
        shift_int+=1
        if data_type==1:
            shift_int+=1

    
    
    return([shift_int,fractional_sample_delay])