to plot BER curve for IDWT
2 次查看(过去 30 天)
显示 更早的评论
i am not able to plot the proper ber curve .this is my piece of code which is attached for your reference
clc;
clear all;
close all;
PSK = 4; SNR = -5;
M_rx = 1; % No. of Rx antennas
SNRs = -50:20; % signal-to-noise ratios: -10dB … 20dB
bit_errors = zeros(length(SNRs), 1); % BER with respect to SNR
%implementation of the The transmitter
data = randi([0 PSK-1],64,1000);
symbol = pskmod(data, PSK, 0, 'Gray');
% symbol = qammod(data, PSK, 0, 'Gray');
%to Perform parallel to serial conversion
pstx=reshape(symbol,1,[]);
%to perform IDWT operation
AC =pstx; %% approximation coefficients
DC = zeros(size(pstx));%% detailed (wavelet) coefficients
IDWT=idwt(AC,DC,'haar').';% IDWT process
%implementation of the receiver
for SNR_idx = 1:length(SNRs)
received_symbol = awgn(IDWT, SNRs(SNR_idx)).';
[ca cd]=dwt(received_symbol,'haar' );
%to perform parallel to serial conversion
psrx=reshape(ca,64,1000);
estimated_data = pskdemod(psrx, PSK, 0, 'Gray');
% estimated_data = qamdemod(received_symbol, PSK, 0, 'Gray');
[no_of_error(SNR_idx), bit_errors(SNR_idx)]=biterr(data,estimated_data);
end
semilogy(SNRs , bit_errors); % plot with logarithmic y-axis
grid on; % show a grid
xlabel('SNR [dB]');
ylabel('BER'); % label x- and y-axis
2 个评论
Raymond Norris
2020-10-16
Hi,
I would suggest posting a bit more detail about what you mean by "not able to plot the proper BER curve." Are you getting errors or the curve doesn't look right? For starters, AC appears to be complex and not real, which is causing problems with your call to idwt.
Raymond
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Propagation and Channel Models 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!