You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
BER OF M-ary PSK and M-ary QAM
1 view (last 30 days)
Show older comments
Dear All....
I am trying to write a program for the implementation of MIMO-OFDMby using wavelets transfrom . when i plot the BER Curve i am getting a straight line i am not able to get as a standard curve . any help will be appreciated.
Regards
Abdul Azeez
11 Comments
Walter Roberson
on 12 Oct 2020
ABDUL
on 12 Oct 2020
Edited: ABDUL
on 12 Oct 2020
hi.... find attached below code which i am trying to implement for the ofdm by using the wavelet transforms to plot the BER V/s SNR graph and the Peak to Average Power Ratio (PAPR) for the same . i am trying to plot the BER V/s SNR graph for which i am getting a straight line
Regards
Abdul Azeez
clc
clear all;
close all;
M = 4; % QPSK signal constellatio
N = 64; % number of subcarriers
fft_size = N; % have 128 data poexitint
nbits = 100;
nDWTsym = ceil(nbits/N) ;% number of symbols for DWT system
nsym = nbits;
snr = 0:8;
% ------------------%
% TRANSMITTER
% ------------------%
data_source=randsrc(1, fft_size*(nsym-2), 0:M-1); %the data source
sp = reshape(data_source,fft_size,nsym-2).';% s/p
% sp = reshape(qpsk_mod , fft_size, nsym-2);% s/p
[rdwt,cdwt] = size (sp);
tx_dwt= [];
for i=2:nsym-1
for uu=1:cdwt
qpsk_mod=pskmod(sp,M);
DATADWT=qpsk_mod;
AC = DATADWT(1:rdwt/2,uu); % approximation coefficients
DC = DATADWT(rdwt/2+1:rdwt,uu); % detailed (wavelet) coefficients
IDWT=idwt(AC,DC,'haar'); % IDWT process
TXDWT(:,uu)= IDWT; % transmitted data for DWT
end
%%% parallel to serial =======> to the channel
ps1 = reshape( TXDWT,1,[]);
ofdm_signal_dwt=TXDWT;
pilot = zeros(size(TXDWT));
Signal_Power_dwt = abs(ofdm_signal_dwt.^2);
Peak_Power = max(Signal_Power_dwt,[],2);
Mean_Power = mean(Signal_Power_dwt,2);
PAPR_dwt = 10*log10(Peak_Power./Mean_Power);
tx_dwt = [tx_dwt ofdm_signal_dwt];
end
figure (1)
[cdf0,PAPR0] = ccdf(PAPR_dwt,0.1);
semilogy(PAPR0,cdf0,'-b')
legend('DWT based MIMO OFDM System')
xlabel('PAPR0 [dB]');
ylabel('CCDF (Pr[PAPR>PAPR0])');
tt_dwt=reshape(TXDWT,1,[]);
tt_dwt =[ pilot tx_dwt pilot];
x_abs_dwt=abs(tt_dwt);
papr_dwt=10*log(max(x_abs_dwt.^2)/mean(x_abs_dwt.^2));
% ------------
% CHANNEL
% ------------
% ---------------
% RECEIVER
% ------------
no_of_error_dwt=[];
ratio_dwt=[];
for ii=1:length(snr)
rx_dwt= [];
rx_signal_matrix_dwt = reshape(ps1,rdwt,cdwt).';%98x64, 64x98
[~, c] = size(rx_signal_matrix_dwt);
for j=1:cdwt
A1=[];
received_symbol=[];
received_symbol_1=[];
con_dwt=[];
received_symbol_1=[];
DWT=[];
cd=[];
RXDWT=[];
channel = 1/sqrt(2)*[randn(1,length(rx_signal_matrix_dwt))+sqrt(-1)*randn(1,length(rx_signal_matrix_dwt))];
%%% the transmitted signal is corrupted with addtive noise
A1=channel.*rx_signal_matrix_dwt(j,:);
received_symbol = awgn(A1, snr(ii));
% equalization:
received_symbol = conj(channel).* received_symbol;
% Convert Data back to "parallel" form to perform IDWT
con_dwt=reshape(received_symbol, 1,rdwt);
[DWT,cd]=dwt(con_dwt,'haar');%% DWT
RXDWT=[DWT cd];% recieved data for DWT
%%% parallel to serial
RXDWT1 = reshape(RXDWT.',1,[]);% at DWT
qpsk_demod=pskdemod(RXDWT,M);
rx_dwt =[rx_dwt qpsk_demod];
end
% counting the errors and ratio
[nDWT,rDWT]=biterr(data_source, rx_dwt);
simBerDWT(ii)=rDWT;%% DWT system
end
figure (2)
theory_Pb_BPSK = (1/2)*erfc(sqrt(10.^(snr/10)));
semilogy(snr,theory_Pb_BPSK,'bs-','LineWidth',2);
hold on
semilogy(snr,simBerDWT,'mx-','LineWidth',2);
axis([0 8 10^-6 1]); grid on
legend('theory', 'simulation for DWT(Haar)','simulation for FFT');
xlabel('SNR, dB') ; ylabel('Bit Error Rate')
title('BER for qpsk using DWT based ofdm ')
Walter Roberson
on 12 Oct 2020
qpsk_mod=pskmod(sp,M);
pskmod returns complex values.
DATADWT=qpsk_mod;
AC = DATADWT(1:rdwt/2,uu); % approximation coefficients
DC = DATADWT(rdwt/2+1:rdwt,uu); % detailed (wavelet) coefficients
So AC and DC are complex values
IDWT=idwt(AC,DC,'haar'); % IDWT process
idwt() is restricted to operating on real values.
Your code cannot generate any line; it crashes long before the plotting.
ABDUL
on 12 Oct 2020
Edited: ABDUL
on 12 Oct 2020
is it possible to take ony real values for the qpsk modulated data and implement the wavelet transforms or by taking the absolute values of the psk mod values. is there any method by which i can implement the OFDM technique by using the wavelet transforms ?.
Walter Roberson
on 13 Oct 2020
Of course you can take real() or imag() or abs() of the qpsk modulated data, and do a wavelet transform on that.
The question would be whether you would get anything useful out of doing that.
qpsk uses constellations. With M = 16, you end up with 8 different real() values (4 unique values and their negatives), and cannot tell the difference between the two cases involving A +/- B*1i . And with a constellation, all of the values have the same absolute value: they all have the same magnitude, just with different vector rotations.
You would be safer taking real() and imag() and forming a vector twice as long. Possibly even doing dwt separately on the two parts.
... But I have no idea how this relates to OFDM.
ABDUL
on 13 Oct 2020
Edited: ABDUL
on 13 Oct 2020
when i try to implement the complex data of size 1x64 , by separting the real and imag parts the and computing the idwt of the data i will be getting the data of twice the size i.e., 1x64 for the real values and 1 x 64 for the imag values when i concatenate it i will be getting the data of size 1x 128 after performing the idwt operation how do i change the data to original data of size 1x 64 ?
Walter Roberson
on 13 Oct 2020
Edited: Walter Roberson
on 13 Oct 2020
ireal = idwt(real(AC), real(DC), 'haar');
icpx = idwt(imag(AC), imag(AC), 'haar');
IDWT = complex(ireal, icpx);
Walter Roberson
on 13 Oct 2020
I do not understand where you got the 98 data samples from? You have been talking about 1 x 64.
ABDUL
on 5 Nov 2020
hi...
if i change the wavelet to other wavelets like db2,db3, sym2, sym3 my data is getting reduced for eg if i have a data of 1x64 , Ac will have 1x32 and Dc will have 1x32 through haar wavelet i will be getting a size of 1x64 but when i use other wavelet like db2 i will be getting the size for 1x30 for Ac and for Dc i will be getting 1x30 the total size of the data will be 1x60 how to retain the same size as 1x64 only when i use the wavelet of db2 and other wavelets
Answers (0)
See Also
Categories
Find more on Discrete Multiresolution Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)