dct1d flattend and unflatten