AWGN noise does not fit main function

조회 수: 16 (최근 30일)
Tauras Eicius
Tauras Eicius 2021년 3월 26일
편집: Tauras Eicius 2021년 3월 26일
Hello,
I have a task which asks to create a transfer function and then add noise to the output of it. I have created the transfer function, it works just fine:
G = tf([m,0,0],[m,b,k]);
% generating random input signal
u_min=100;
u_max=10;
n=101;
tt=[0:0.05:5];
u = (u_min+rand(1,n)*(u_max-u_min));
[y, t] = lsim(G,u,tt);
plot(t,y);
It looks like this:
Everything is fine until here. Now I would like to add some noise to this signal. I've defined my noise like this:
noisePower = 1;
noiseSignal = awgn(y, noisePower);
% adding noise to y (output)
The problem can be seen here. Every time noise just goes way too far, I want it to be the same lenght as my inital transfer function lenght.
plot(t,y, noiseSignal)
Perhaps I'm not applying the noise correctly? I just want this noise to be in the same range as transfer function.

답변 (0개)

카테고리

Help CenterFile 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