Skip to content

Instantly share code, notes, and snippets.

@kelvinpalves
Last active September 1, 2017 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kelvinpalves/10691c5f0a5f2fa0d5b9d76db6744c6a to your computer and use it in GitHub Desktop.
Save kelvinpalves/10691c5f0a5f2fa0d5b9d76db6744c6a to your computer and use it in GitHub Desktop.
Sinal Orignal + Sinal com ruído Gaussiano + Soma do sinal e ruído + Soma do sinal e um ruído em rajada.
function aula4 ()
n = [0:pi/32:4*pi];
sa = cos(n);
sb = 2*cos(n*pi);
s = sa + sb;
r = rand(size(s));
rs = r + s;
raj = r;
for x = 50:60
if mod (x, 2) == 0
raj(x) = raj(x) * 5;
else
raj(x) = raj(x) * (-5);
end
end
raj = raj + s;
%graficos
subplot(4,1,1), plot(n,s);
axis([0 10 -5 5]);
xlabel('sinal original');
subplot(4,1,2), plot(n,r);
axis([0 10 -5 5]);
xlabel('ruido gaussiano');
subplot(4,1,3), plot(n,rs);
axis([0 10 -5 5]);
xlabel('sinal com ruido gaussiano');
subplot(4,1,4), plot(n, raj);
axis([0 10 -5 5]);
xlabel('rajada');
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment