Joint Dynamic Resource Allocation and Waveform Adaptation in Cognitive Radio Networks