A wireless-based home rehabilitation system for monitoring 3D movements