% 2020.05.07. JR1 online gyakorlat
% 
clear all
close all
clc
s = [5 -3 0 9 -10]
polyval(s, 3)
polyval(s, [1 2 3])
x = 0 : 0.1 :10;
whos
x(1)
x(end)
x(4)
x(5)
plot(x, polyval(s, x), 'r-o');
y = polyval( [1 2 1],x);
whos
plot(x,y,'r-o')
y = polyval( conv([1 -1],[1 1]) ,x);
plot(x,y,'r-o')
R=2; C=0.4;
num = 1/(R*C)
den = [1 3/(2*R*C)]
om = 0:0.1:100;
H = polyval(num, j*om) ./ polyval( den, j*om);
K = abs(H);
whos
fi = angle(H);
close
plot( om, K, 'r-'); xlabel('om'); ylabel('|H|');
semilogx(om, K, 'r-'); xlabel('om'); ylabel('|H|');
KdB = 20*log10(K);
figure; semilogx( om, KdB, 'r-'); xlabel('om'); ylabel('|H|');
figure; semilogx( om, fi, 'r-'); xlabel('om'); ylabel('arc H');