Generating an OFDMA signals from an OFDM
10 ビュー (過去 30 日間)
古いコメントを表示
Hi All ,
I have a task in designing resource allocation algorithms using an OFDMA system ..
however I need some help in generating the OFDMA sub carriers and converting my OFDM signal into OFDMA multicarriers ..
I'm using a 16QAM modulation scheme and planning to have 4 subcarriers for my OFDMA sysem for a start ..
This is my normal OFDM code with multipath channels and fading .. I just need some help in generating the OFDMA signal after I create the normal OFDM
clear all
N=256; %128 subcarries
M=16; %QAM order
cp=16; %length of the cyclic prefix... Is increasing the cyclic prefix size gonna increase the efficiency?
scale = 1/sqrt(10);
hMod = modem.qammod(M); %QAM Modulator
hDemod = modem.qamdemod(hMod); %QAM demodulator
loops = 100;
SNR =0:5:35;
t1= cputime ;
% transmited signal. Contains N data points ranging from 0 to M-1
ber=zeros(5,length(SNR));
%%Creating the Rayleigh Multipath Channels
Ch = rayleighchan(1/1000,10);
Ch.ResetBeforeFiltering = 0;
sig = 1i*ones(loops,1);
h1 = filter(Ch,sig);
h2 = 0.1072*filter(Ch,sig);
h3 = 0.0120*filter(Ch,sig);
h4 = 0.0052*filter(Ch,sig);
% Delay Values
l1 = 4;
l2 = 7;
l3= 16;
for j=1:length(SNR)%Change SNR
%tx=transmited_data;
for ik=1:loops%number of loops
tx = randi([0 M-1],1,N); % generate random data
sig=modulate(hMod, tx)*scale; % Modulate QAM modulated signal, devide by the square root of 10 to bring the average power of the signal to 1
ofdm=sqrt(N).*ifft(sig,N); % generate OFDM signal IFFT on the parrellel data,multiply by sqrt(N) to adjust to the matlab computation ,
ofdm_cp = [ofdm(N-cp+1:N) ofdm]; % Add cyclic prefix
%%Adding Multipath to OFDM delayed signals signal + Adding
% Rayleigh Channels
ofdm_1 = ofdm_cp(cp+1: N+cp).*h1(ik);
ofdm_2 = ofdm_cp(cp-l1+1: N+cp-l1).*h2(ik);
ofdm_3 = ofdm_cp(cp-l2+1 : N+cp-l2).*h3(ik);
ofdm_4 = ofdm_cp(cp-l3+1 : N+cp-l3).*h4(ik);
% Sum to one signal
ofdm_total = sum([ofdm_1;ofdm_2;ofdm_3;ofdm_4]);
% Create channel impulse respones
cha_imp =[h1(ik) zeros(1,3) h2(ik) zeros(1,3) h3(ik) zeros(1,8) h4(ik)];
% apply AWGN to summation of ofdm signals
rxSig = awgn(ofdm_total,SNR(j));% Add white noise with SNR(j) and fading
sig_Recovered = fft(rxSig,N)./sqrt(N)./fft(cha_imp,N); % Recevier
rx = demodulate(hDemod,sig_Recovered/scale); % Dmodulate
[~, BER]= biterr(tx,rx); % Calculate bit error rate
ber(1,j) =ber(1,j)+BER; % Save BER
end
end
(cputime-t1)/60
%figure
semilogy(SNR,ber/loops,'r'); % Plot BEr curve
1 件のコメント
Dipsikha Roy
2021 年 1 月 1 日
can u help me how to implement in matlab to generate one OFDM symbol say 1 ms long and all the ofdm carriers should be within that one symbol. Like this generate symbol by symbol transmission.
I have already written a piece of code like this
clc
close
M =8; %here we initialize the number of constellation point of qam
no_of_data_points = 1024;
fs=10^6;
data_source= abs(round(randn(1,8)));%here we take random normal function
figure(1);
stem(data_source);
grid on;
xlabel('Data Points','Fontsize',14);
ylabel('transmitted data phase representation','Fontsize',14);
title('Transmitted Data','Fontsize',14); %here we plot that transmitted data
qam_modulated_data = qammod(data_source, M,'bin'); %here we perform 8bit qam on the random normal function
data = 0:M-1;
scatterplot(qam_modulated_data,1,0,'r*');
grid on
for k=1:M
text(real(qam_modulated_data(k))-0.4,imag(qam_modulated_data(k))+0.4,num2str(data(k)));
end
axis([-4 4 -2 2])
qm = abs(qam_modulated_data);
figure(3);
stem(qm)
title('MODULATED TRANSMITTED DATA','Fontsize',14);%here we plot those constellation point
y=ifft(qam_modulated_data);
figure(4);
x=1:M;
stem(x*(1/fs),abs(y));
grid on;
xlabel('time(microsec)');
ylabel('amplitude of fft');
title('without hermitian ifft','Fontsize',14);
qam_modulated_data1(1:(M/2))=qam_modulated_data(1:(M/2)); %here we introduce another array named qam_modulated_data1 where first four element is first four constellation point
qam_modulated_data1(((M/2)+1):M)=-qam_modulated_data(1:(M/2));% in my qam_modulated_data1 array last four point is Hermitian of first four point
figure(5);
stem(qam_modulated_data1);
xlabel('frequency(MHZ)','Fontsize',14);
ylabel('amplitude','Fontsize',14);
title('Hermitian symmetry','Fontsize',14);
y1=ifft(qam_modulated_data1); %here we apply fast Fourier transform on the data of qam_modulated_data1 array
figure(6);
x=1:M;
stem(x*(1/fs),abs(y1)); %here we plot that fft result
grid on;
xlabel('time(microsec)','Fontsize',14);
ylabel('amplitude','Fontsize',14);
title('odd frequency suppressed output','Fontsize',14);
y1c=conj(y1);
real_y1=y1.*y1c ;
figure(7);
x=1:M;
stem(x*(1/fs),real_y1);
grid on;
xlabel('time(microsec)','Fontsize',14);
ylabel('amplitude of real values of ifft','Fontsize',14);
title('real value of ifft','Fontsize',14);
z=fft(y1);
figure(8);
x=1:M;
stem(x*fs,z); %here we plot that fft result
grid on;
xlabel('frequency(MHZ)','Fontsize',14);
ylabel('amplitude','Fontsize',14);
title('fft output','Fontsize',14);
qam_modulated_data2(1:(M/2))=z(1:(M/2));
qam_modulated_data2(((M/2)+1):M)=qam_modulated_data(((M/2)+1):M);
figure(9);
stem(qam_modulated_data2);
xlabel('frequency(MHZ)','Fontsize',14);
ylabel('amplitude','Fontsize',14);
title('reverse Hermitian symmetry','Fontsize',14);
receieved_data=qamdemod(qam_modulated_data2,M);
figure(10)
x=1:M;
stem(x*(1/fs),receieved_data); %here we plot that fft result
grid on;
xlabel('time(microsec)','Fontsize',14);
ylabel('amplitude','Fontsize',14);
title('received data','Fontsize',14);
what changes I need to do now.please help,
回答 (2 件)
Xiaolin Ma
2012 年 2 月 10 日
Hi, I also want to study resource allocation in OFDMA systems. Your code is useful in terms of generating,encoding and decoding signals. I have tried to test it,and it works.
But, I find that other contributed code regarding to resource allocation doesn't implement OFDM signal modulation and demodulation process.They just focus on channel response and resource allocation algorithm.I don't know why.
What do you think about how to implement resource allocation in OFDMA systems? Have you sucess to implement your OFDMA system?
Regards.
0 件のコメント
Mohammed salman
2012 年 5 月 7 日
Hi this is nice topic I try to implement band-AMC and PUSC permutation, can any one help I mean how to start to specify appropriate carriers to be allocated in subchannls, thank u in advance.
1 件のコメント
参考
カテゴリ
Help Center および File Exchange で Test and Measurement についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!