Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- N = 64
- n = linspace(1, N, N)
- k = 1
- h = zeros(N)
- h[1] = 1
- y = sin(2 * pi * n/N)
- Si = []
- Si.append(0.25*h[1])
- Si.append(0.5*h[1]+0.25*h[2])
- for elem in range(3,len(y)):
- Si.append(0.25*h[elem-2] + 0.5*h[elem-1] + 0.25*h[elem])
- Ss = []
- Ss.append(0.25*y[1])
- Ss.append(0.5*y[1]+0.25*y[2])
- for elem in range(3,len(y)):
- Ss.append(0.25*y[elem-2] + 0.5*y[elem-1] + 0.25*y[elem])
- subplot(2, 2, 1)
- stem(n, h)
- xlim(0, 80)
- ylim(0, 1)
- xlabel('Numer próbki')
- ylabel('Amplituda')
- title('Pobudzenie - impuls')
- subplot(2, 2, 2)
- stem(n, y)
- xlabel('Numer próbki')
- ylabel('Amplituda')
- title('Pobudzenie - sygnał sinusoidalny')
- subplot(2, 2, 3)
- stem(Si)
- xlabel('Numer próbki')
- ylabel('Amplituda')
- title('Odpowiedź impulsowa')
- subplot(2, 2, 4)
- stem(Ss)
- xlabel('Numer próbki')
- ylabel('Amplituda')
- title('Odpowiedź na pobudzenie sinusoidalne')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement