Implementation of a sampling method for embedded systems