BER OF M-ary PSK and M-ary QAM
7 次查看(过去 30 天)
显示 更早的评论
ABDUL
2020-10-1
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 个评论
ABDUL
2020-10-12
编辑:ABDUL
2020-10-12
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
2020-10-12
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.
Walter Roberson
2020-10-13
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
2020-10-13
编辑:ABDUL
2020-10-13
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
2020-10-13
编辑:Walter Roberson
2020-10-13
ireal = idwt(real(AC), real(DC), 'haar');
icpx = idwt(imag(AC), imag(AC), 'haar');
IDWT = complex(ireal, icpx);
ABDUL
2020-10-13
how we go ahead with the implemenation of the dwt as we have 1x98 data samples which are complex ?
Walter Roberson
2020-10-13
I do not understand where you got the 98 data samples from? You have been talking about 1 x 64.
ABDUL
2020-11-5
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
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Signal Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!发生错误
由于页面发生更改,无法完成操作。请重新加载页面以查看其更新后的状态。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- 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)
亚太
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)