Text this: Cognitive radio based optimal sensing for resource allocation in smart cities/villages