plot of BER for QPSK modulated DWT and IDWT code
3 views (last 30 days)
Show older comments
dear all i am working on PSK modulated OFDM system by using DWT and IDWT. i am not able to get the proper graph of the BER of the QPSK modulated OFDM System. i request to rectify my mistake in obtaining the correct graph of PSK modulated OFDM System
M = 4; % QPSK signal constellatio
N = 64; % number of subcarriers
fft_size = N; % have 128 data poexitint
fspacing=15000;
fs=15000*fft_size;
Ts = 1/fs; % Sampling period of channel
Fd = 0; % Max Doppler frequency shift
nbits = 100;
nDWTsym = ceil(nbits/N) ;% number of symbols for DWT system
nsym = nbits;
snr = 0:8;
% nSymDWT=ceil(nbits/N);% number of symbols for DWT system
% ------------------%
% TRANSMITTER
% ------------------%
data_source=randsrc(1, fft_size*(nsym-2), 0:M-1); %the data source
% qpsk_mod=pskmod(sp(:,i-1),M);
% qpsk_mod=pskmod(data_source,M);
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;
% DATADWT = serial_to_paralle.';
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,[]);
end
no_of_error_dwt=[];
ratio_dwt=[];
for ii=1:length(snr)
rx_dwt= [];
ntDWT1 = 1/sqrt(2)*[randn(1,length(ps1))+j*randn(1,length(ps1))];
%%% the transmitted signal is corrupted with addtive noise
ytDWT = ps1 + 10^(-snr(ii)/20)*ntDWT1; %%receive signal DWT
rx_signal_matrix_dwt = reshape(ps1,rdwt,cdwt);
[~, c] = size(rx_signal_matrix_dwt);
con_dwt=reshape( ytDWT, size(TXDWT,1), size(TXDWT,2));
% con_dwt=rx_signal;
for zz=1:rdwt
[DWT,cd]=dwt(con_dwt(zz,:),'haar');%% DWT
RXDWT(zz,:)=[DWT cd];% recieved data for DWT
end
%%% parallel to serial
RXDWT1 = reshape(RXDWT.',1,[]);% at DWT
% equalizer_dwt=RXDWT1./G(j,:);
% end
qpsk_demod=pskdemod(RXDWT1,M);
% counting the errors and ratio
[nDWT,nDWT]=biterr(data_source, qpsk_demod);
simBerDWT(ii)=nDWT;%% DWT system
end
figure (1)
semilogy(snr,simBerDWT,'mx-','LineWidth',2);
axis([0 8 10^-6 1]); grid on
legend( 'simulation for DWT(Haar)');
xlabel('SNR, dB') ; ylabel('Bit Error Rate')
title('BER for qpsk using DWT based ofdm ')
0 Comments
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!