[PD] get sample length for setting array size