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
댓글 수: 0
채택된 답변
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)
% 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)
% Compare numErr1 to numErr2. The errors are equal even after you reset the random number generator seed.
isequal(numErr1, numErr2)
댓글 수: 0
추가 답변 (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!