Cognitive radio for coexistence of heterogeneous wireless networks