Você está na página 1de 11

# DCA0118 - PROCESSAMENTO DIGITAL DE SINAIS

TRABALHO LISTA 01
ALUNO: TIAGO ROCHA GONALVES

15 de Fevereiro, 2015

Questes:

a)

b)

c)
d)

e)

f)

g)

h)

i)

O cdigo fonte das questes referentes aos grficos acima mostrado abaixo:
Letra A

Letra B

## x=[-5, -4, -3 ,-2 ,-1 ,0 ,1 ,2 ,3 , 4, 5]

ab = [1**x[i] for i in range(len(x))]
print ab

## x=[-5, -4, -3 ,-2 ,-1 ,0 ,1 ,2 ,3 , 4, 5]

ab = [(-1)**x[i] for i in range(len(x))]
print ab

stem(x,ab)

stem(x,ab)

Letra C

Letra G

## x=[-5, -4, -3 ,-2 ,-1 ,0 ,1 ,2 ,3 , 4, 5]

ab = [0.5**x[i] for i in range(len(x))]
print ab

x = linspace(0,9,10)
y=3*cos(pi*x)
stem(x,y)
print y

stem(x,ab)

Letra D

Letra H

## from pylab import *

from pylab import *
x=[-5, -4, -3 ,-2 ,-1 ,0 ,1 ,2 ,3 , 4, 5]
ab = [(-0.5)**x[i] for i in range(len(x))]
print ab
stem(x,ab)

x = linspace(0,9,10)
y=10*sin(x*pi/4)
stem(x,y)
print y

Letra E

Letra I

## x=[-5, -4, -3 ,-2 ,-1 ,0 ,1 ,2 ,3 , 4, 5]

a = [(2)**-x[i] for i in range(len(x))]
print a
stem(x,a)

x = linspace(0,9,10)
y=4*cos(x*pi/5 - pi/4)
stem(x,y)
print y

Letra F
from pylab import *
x=[-5, -4, -3 ,-2 ,-1 ,0 ,1 ,2 ,3 , 4, 5]
ab = [(-2)**x[i] for i in range(len(x))]
print ab
stem(x,ab)

a)

b)

c)

d)

e)

f)

O cdigo fonte das questes referentes aos grficos acima mostrado abaixo
Letra A
from pylab import *

## z = [(-1)*y[i] for i in range(len(x))]

stem(x,z)

n= num.array([-4,-3,-2,-1,0,1,2,3])
d2 = (0.75*n + num.ones(8))
for i in range (len(d2)):
d3[i]= d2[i]-round(d2[i])
if d3[i]!=0:
d2[i]=0
y[i]=0

Letra B

stem (d2,y)

## from pylab import *

import numpy as num
import pylab as py

Letra E

y = (-3,1,2,-2,3,-1)
x = (-3,-2,-1,0,1,2)

y= num.array([-3,1,2,-2,3,-1])
n= num.array([-3,-2,-1,0,1,2])
d = 2*num.ones(6)
n2 = d-n
stem(n2,y)
Letra C
import numpy as num
import pylab as py
y= num.array([0,-3,1,2,-2,3,-1,0])
n= num.array([-4,-3,-2,-1,0,1,2,3])
d = (3*n - num.ones(8))
stem(d,y)
Letra D
import numpy as num
import pylab as py

## import numpy as num

import pylab as py
y= num.array([0,-3,1,2,-2,3,-1,0])
n= num.array([-4,-3,-2,-1,0,1,2,3])
d2 =(-1)*((n+4*num.ones(8))/(2*num.ones(8)))
for i in range (len(d2)):
d3[i]= d2[i]-round(d2[i])
if d3[i]!=0:
d2[i]=0
y[i]=0
stem (d2,y)

Letra F
import numpy as num
import pylab as py
y= num.array([0,-3,1,2,-2,3,-1,0,0])
n= num.array([-4,-3,-2,-1,0,1,2,3,4])
n2=n*n
stem (n2,y)

y= num.array([0,-3,1,2,-2,3,-1,0])

a)

b)

c)

d)

e)

f)

O cdigo fonte das questes referentes aos grficos acima mostrado abaixo:

Letra A

Letra D

## import matplotlib.pyplot as plt

from pylab import *

## import numpy as num

import pylab as py
y= num.array([-1,0.333,0,1,-0.666,-1,0])
n= num.array([-2,-1,0,1,2,3,4])
d2 = (0.75*n + num.ones(7))
for i in range (len(d2)):
d3[i]= d2[i]-round(d2[i])
if d3[i]!=0:
d2[i]=0
y[i]=0
stem (d2,y)

y = (-1,1/3,0,1,-2/3,-1,0)
x = (-2,-1,0,1,2,3,4)
z = [(-1)*y[i] for i in range(len(x))]
stem(x,z)
Letra B
from pylab import *
import numpy as num
y= num.array([-1,0.333,0,1,-0.666,-1,0])
n= num.array([-2,-1,0,1,2,3,4])
d = 2*num.ones(7)
n2 = d-n
stem(n2,y)
Letra C
import numpy as num
import pylab as py
y= num.array([-1,0.333,0,1,-0.666,-1,0])
n= num.array([-2,-1,0,1,2,3,4])
d = (3*n - num.ones(7))
stem(d,y)

Letra E
import numpy as num
import pylab as py
y= num.array([-1,0.333,0,1,-0.666,-1,0])
n= num.array([-2,-1,0,1,2,3,4])
d2 =(-1)*((n+4*num.ones(7))/(2*num.ones(7)))
for i in range (len(d2)):
d3[i]= d2[i]-round(d2[i])
if d3[i]!=0:
d2[i]=0
y[i]=0
stem (d2,y)

Letra F
import numpy as num
import pylab as py
x= num.array([-1,0.333,0,1,-0.666,-1,0])
n= num.array([-2,-1,0,1,2,3,4])
n2=n*n
stem (n2,x)
print n2

a)

b)

c)

d)

O cdigo fonte das questes referentes aos grficos acima mostrado abaixo. Importante notar
que para essa questo foi considerado a frmula de Euler na forma de cosseno e seno:

Letra A

Letra C

## from numpy import *

from pylab import *

## from numpy import *

from pylab import *

n = linspace(0,pi,50)
a=0.5
b=pi/6
y = cos((a+i*b)*n) + i*sin((a+i*b)*n)

n = linspace(0,pi,30)
a=-0.5
b=pi/4
y = (cos((a+i*b)*n) + i*sin((a+i*b)*n))

stem(n,y)

stem(n,y)

Letra B

Letra D

## from numpy import *

from pylab import *

## from numpy import *

from pylab import *

n = linspace(0,pi,100)
a=1
b=pi/4
y = cos((a+i*b)*n) + i*sin((a+i*b)*n)
stem(n,y)

n = linspace(0,pi,60)
a=0
b=pi/6
y = (cos((a+i*b)*n) + i*sin((a+i*b)*n))
stem(n,y)

Referncias Bibliogrficas
[1] Paulo S. Motta Pires - Notas de Aula da Disciplina Processamento Digitai de Sinais - UFRN,
02/2015.
[2] Aprendendo Python - Disponvel em <http://homepages.dcc.ufmg.br/~joaoreis/Site%20de
%20tutoriais/aprendendopython/index.html> Acesso em 14 de Fevereiro de 2015.