Created
August 26, 2017 01:12
-
-
Save kelvinpalves/b362b5e43946af9cbcd7e91990277ebe to your computer and use it in GitHub Desktop.
Aula 04
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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