Spectrum Sensing and Allocation for Cognitive Radio Networks