Hi everyone;
I need to add 5% noise to my signal (amplitude of noise = 0.05* signal amplitude) using "randn" as:
signal_noisy=signal+0.5*randn(signal) % (is it correct?)
is the genereated noise, whight gussion one?!
if I want to use "awgn" is it correct to say in this case SNR=13 ???
I realy appriciate your help here

 채택된 답변

Image Analyst
Image Analyst 2020년 7월 4일

0 개 추천

Try this:
% Make sample data.
x = linspace(0, 3*pi, 640);
period = 2*pi;
y = cos(2 * pi * x / period); % Noise-free signal.
% Noise is 5% of the signal value at each location,
% which means sigma is not a constant at each location.
amplitudes = y * 0.05;
noise = amplitudes .* randn(1, length(y));
% Add the noise to the noise-free signal.
yNoisy = y + noise;
% Plot everything.
plot(x, yNoisy, 'r.', 'MarkerSize', 8);
hold on;
plot(x, y, 'b-', 'LineWidth', 2);
grid on;

댓글 수: 3

atabak mostafavi
atabak mostafavi 2020년 7월 4일
great thank you; and would this method generate gussion ( flat spactrum ) noise since I am trying to model the measurement noise and it kinda important to be flat spactrum.
Image Analyst
Image Analyst 2020년 7월 4일
Yes, it's flat. The noise depends only on the signal and there is no spatial or time dependency on it, other than the signal itself of course.
atabak mostafavi
atabak mostafavi 2020년 7월 4일
thank you

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터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!

Translated by