Selective measurement of charge dynamics in an ensemble of nitrogen-vacancy centers in nanodiamond and bulk diamond