how can i add AWGN noise to signal

6 visualizzazioni (ultimi 30 giorni)
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

Risposta accettata

Abderrahim. B
Abderrahim. B il 27 Lug 2022
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

Più risposte (0)

Prodotti


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by