def onesided_2_twosided(data):
psd = np.concatenate((data[<NUM_LIT:0>:-<NUM_LIT:1>], cshift(data[-<NUM_LIT:1>:<NUM_LIT:0>:-<NUM_LIT:1>], -<NUM_LIT:1>)))/<NUM_LIT><EOL>psd[<NUM_LIT:0>] *= <NUM_LIT><EOL>psd[-<NUM_LIT:1>] *= <NUM_LIT><EOL>return psd<EOL>
Convert a two-sided PSD to a one-sided PSD

    In order to keep the power in the twosided PSD the same
    as in the onesided version, the twosided values are 2 times
    lower than the input data (except for the zero-lag and N-lag
    values).

    ::

        >>> twosided_2_onesided([10, 4, 6, 8])
        array([ 10.,   2.,   3.,   3., 2., 8.])