Pulse shaping on BER

4 次查看(过去 30 天)
Rory Gilmor
Rory Gilmor 2022-10-4
回答: vidyesh 2024-9-15
I build a pam-2 modulation, then I make a pulse shaping with half sine (matched filter). Then I send it through the AWGN channel. At the end I do down sampling and demodulation. But i have problem with plotting BER. I don't understand what I'm doing wrong:
clc;
clear;
N=1e4;
N2 = 1e2;
M = 2;
range = 0:10;
error = zeros(1,length(range)); %BER
%
% half sine
Rc = 1e3; % Chip rate
T = 1/Rc; % inverse of chip rate
Tc = 0.5* T;
Fs = 2e3; % sampling frequency
dt = 1/Fs;
over = Fs/Rc; % sampling factor
sps = 10;
time = 0:dt/sps:2*T;
half_Sine = sin(pi*time/(2*T)).^3;
%% BER
for i = 1:length(range)
for n = 1:N2
% Modulation
x=randi([0 M-1],N,1);
h_mod = pammod(x,M);
over_data=upsample(h_mod,over);
txSig = conv(over_data,half_Sine, 'same');
% AWGN
Ps = mean(((txSig)).^2);
Sigma = sqrt(Ps * 10^(-range(i)/10) / 2);
Noise = randn(length(txSig), 1) * Sigma;
rx_SIG = Noise + txSig;
% Downsample
down = rx_SIG(1:over:end);
% Demodulation
hDemod = pamdemod(down,M);
% Errors
error(i) = error(i)+...
sum(hDemod~=x) / length(hDemod);
end
BER = error/n;
end
figure(1);
grid on
semilogy(range,BER);
title('BER');

回答(1 个)

vidyesh
vidyesh 2024-9-15
Hi Rory,
The issue lies in the below line of code:
txSig = conv(over_data,half_Sine, 'same');
Are you trying to simulate the channel or trying to modulate to a higher frequency by using convolution?
In either scenario, you will have to perform deconvolution at the receiever side. But the 'deconv' function is very sensitive to noise, so it may not give the desired results either.
For simulating the channel/modulation, refer the below examples and functions:
Utilizing the above functions or following the process used in the example will be a better option over using 'conv'

类别

Help CenterFile Exchange 中查找有关 Propagation and Channel Models 的更多信息

产品


版本

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by