PDS Siana
>> b = [4 5 6];
>> a.*b ans =
4 10 18
>> a./b ans =
0.2500 0.4000 0.5000
.......................................................................... linspace( , , > a = 1:5 a =
1 2 3 4 5
>> b = a' b =
1
2
3
4
5
................................. randn(3,4) ................................... eye(4) % gera uma matriz identidade 4 x 4
......................................................
plot(x,y) Ex.:
>> t = 0:0.01:2;
>> x = cos (2*pi*t);
>> plot (t,x);
..............................................................
Adicionando uma cor : plot (t,x, 'r*');
stem(t,x);
..................................................................................... t = 0:0.05:2;
>> x = cos (2*pi*t);
>> subplot(2,2,1); plot(t,x,'k--');
>> subplot(2,2,2); plot(t,x);
>> subplot(2,2,3); stem(t,x,'r');
>> subplot(2,2,4); stem(t,x,'fill');
…………………………………………………………………………………………………………………………………………………………
% Discretização do tempo
Fa = 5000; tf = 0.5; delta_t = 1/Fa; t = 0:delta_t:tf;
% Sinal Analógico f1 = 10; f2 = 20; x = cos(2*pi*f1*t) + 2*cos(2*pi*f2*t);
% Sinal Amostrado fs = 2*f2;
Ts = 1/fs; n = 0:1:tf*fs; nTs = n*Ts; xs = cos(2*pi*f1*(nTs)) + 2*cos(2*pi*f2*(nTs));
% Reconstruindo o sinal a partir de do sinal amostrado xa = xs * sinc(fs*(ones(length(nTs),1)*t-nTs'*ones(1,length(t))));
% Gráficos figure; subplot(3,1,1); plot(t, x, 'b'); grid; hold on axis([0 0.5 -3 4]); title('Sinal Original'); xlabel('Tempo (s)'); ylabel('Amplitude'); subplot(3,1,3); plot(t,xa, 'r'); grid; axis([0 0.5 -3 4]); title('Recuperação do Sinal a partir do sinal amostrado'); xlabel('Tempo (s)'); ylabel('Amplitude'); subplot(3,1,2); stem(nTs, xs, 'b'); grid; axis([0 0.5 -3 4]); title('Sinal Amostrado'); xlabel('Tempo (s)');ylabel('Amplitude');
...................................................................
>> % Frequência de amostragem
Fa = 512;
% Discretização do tempo (total 1s) t = 0:1/Fa:1;
f1