Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- import cmath
- N = int(input("Digite o tamanho do sinal (N): "))
- x = []
- X = []
- for i in range(N):
- aux = int(input("Digite o sinal na posição["+str(i)+"]: "))
- x.append(aux)
- for m in range(N):
- sumXR = 0
- sumXI = 0
- sumT = 0
- for n in range(N):
- SumXR = x[n]*math.cos(2 * math.pi * (m / N) * n)
- sumXI = -(x[n]*math.sin(2 * math.pi * (m / n) * n))
- sumT =+ complex(sumXR,sumXI)
- X.append(sumT)
- for m in range(N):
- print("X["+str(m)+"] = R: "+X[m].real+"I: "+X[m].imag)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement