how can i add AWGN noise to signal

3 次查看(过去 30 天)
Hello
I have a communcation system and i need to calculate the bit error rate by comparing the I/P stream with O/P stream
i added the AWGN noise using awgn(x,snr) function but it add random values with each run and the error rate is changing according to that. therefore i can't find thresold value for snr to calculate the correct bit error rate
how can i solve this issue?
thanks in advance

采纳的回答

Abderrahim. B
Abderrahim. B 2022-7-27
Perhaps setting random number generator will be helpful. use rng
MWs Example:
% Generate random data symbols and the 4-PSK modulated signal.
M = 4;
k = log2(M);
snr = 3;
data = randi([0 M-1],2000,1);
x = pskmod(data,M);
% Set the random number generator seed.
seed = 12345;
rng(seed);
y = awgn(x,snr);
% Compute the bit errors.
dataHat = pskdemod(y,M);
numErr1 = biterr(data,dataHat,k)
numErr1 = 300
% Reset the random number generator seed.
rng(seed);
% Demodulate the PSK signal and compute the bit errors.
y = awgn(x,snr);
dataHat = pskdemod(y,M);
numErr2 = biterr(data,dataHat,k)
numErr2 = 300
% Compare numErr1 to numErr2. The errors are equal even after you reset the random number generator seed.
isequal(numErr1, numErr2)
ans = logical
1

更多回答(0 个)

类别

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