how can i add AWGN noise to signal

조회 수: 3 (최근 30일)
maryam muner
maryam muner 2022년 7월 27일
답변: Abderrahim. B 2022년 7월 27일
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