本文整理匯總了Python中Plotter.Plotter.plotRealAndImaginary方法的典型用法代碼示例。如果您正苦於以下問題:Python Plotter.plotRealAndImaginary方法的具體用法?Python Plotter.plotRealAndImaginary怎麽用?Python Plotter.plotRealAndImaginary使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Plotter.Plotter
的用法示例。
在下文中一共展示了Plotter.plotRealAndImaginary方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: sorted
# 需要導入模塊: from Plotter import Plotter [as 別名]
# 或者: from Plotter.Plotter import plotRealAndImaginary [as 別名]
import cmath
problems = {
'a': {
'func': lambda n: cmath.cos(2 * cmath.pi * (n / 64) ),
'N': 64
},
'b': {
'func': lambda n: cmath.cos(2 * cmath.pi * (n / 32) ),
'N': 32
},
'c': {
'func': lambda n: cmath.cos(2 * cmath.pi * ((n*3)/64)),
'N': 64
},
'd': {
'func': lambda n: cmath.cos(2 * cmath.pi * ((n*4)/16)),
'N': 16
},
'f': {
'func': lambda n: cmath.sin(2 * cmath.pi * ((n)/64)),
'N': 64
}
}
for p in sorted(list(problems.keys())):
func = problems[p]['func']
N = problems[p]['N']
Plotter.plotRealAndImaginary( DFT.dft(func, N), N, "problem 3: part "+ p )
Plotter.show()
示例2:
# 需要導入模塊: from Plotter import Plotter [as 別名]
# 或者: from Plotter.Plotter import plotRealAndImaginary [as 別名]
0,
1.0/(2**0.5)
]
d = [ +1,
-1,
+1,
-1,
+1,
-1,
+1,
-1
]
e = [ +1,
+1,
+1,
+1,
-1,
-1,
-1,
-1
]
N = 8
for i in [(a, 'a'), (b, 'b'), (c, 'c'), (d, 'd'), (e, 'e')]:
func = i[0]
name = i[1]
Plotter.plotRealAndImaginary( DFT.dft(func, N), N, "problem 2: part "+name)
Plotter.show()
示例3: a
# 需要導入模塊: from Plotter import Plotter [as 別名]
# 或者: from Plotter.Plotter import plotRealAndImaginary [as 別名]
from DFTsolver import DFT
from Plotter import Plotter
import cmath
def a(n):
return {
0: 1,
1: -1,
2: 2,
3: 3,
}[n]
N = 4
Plotter.plotRealAndImaginary( DFT.dft(a, N), N, "class problem")
Plotter.show()