clc;%DVB-T 2K Transmission
%The available bandwidth is 8 MHz
%2K is intended for mobile services
clear all;close all;%DVB-T Parameters
Tu=224e-6; %useful OFDM symbol period
T=Tu/2048; %baseband elementary period
G=0; %choice of 1/4, 1/8, 1/16, and 1/32
delta=G*Tu; %guard band duration
Ts=delta+Tu; %total OFDM symbol period
Kmax=2000; %number of subcarriers
Kmin=0;FS=4096; %IFFT/FFT length
q=10; %carrier period to elementary period ratio
fc=q*1/T; %carrier frequency
Rs=4*fc; %simulation period
t=0:1/Rs:Tu;%Data generator (A)
M=Kmax+1;rand('state',0);a=-1+2*round(rand(M,1)).'+i*(-1+2*round(rand(M,1))).';A=length(a);info=zeros(FS,1);figure(1);stem(a );info(1:(A/2)) = [ a(1:(A/2)).']; %Zero padding
info((FS-((A/2)-1)):FS) = [ a(((A/2)+1):A).'];%Subcarriers generation (B)
carriers=FS.*ifft(info,FS);tt=0:T/2:Tu;figure(2);subplot(211);stem(tt(1:400),real(carriers(1:400)));title('subcar generation');subplot(212);stem(tt(1:400),imag(carriers(1:400)));figure(3);f=(1:(FS))/(FS);subplot(211);plot(f,abs(fft(carriers,FS)/FS));figure(4);l=length(abs(fft(carriers)));w=hamming(l);stem(w);fs=4096/Tu;df=1/Tu;dalpha=2098/Tu;x=carriers;Np=pow2(nextpow2(fs/df));L=Np/4;P=pow2(nextpow2(fs/dalpha/L));N=P*L;% channelization
if length(x)<N x(N)=0;elseif length(x)>N x=x(1:N);endNN=(P-1)*L+Npxx=xxx=xx(:)p=ceil(P)X=zeros(Np,ceil(p))for k=0:p-1 X(:,k+1)=xx(k*L+1:k*L+Np);end
MATLAB: Sir,i am new to matlab . I received an error saying Index exceeds matrix dimensions..Here is the code for channelization.
cyclostationary based cooperative compressed wideband spectrum sensing in cognitive radio networks
Best Answer