##// END OF EJS Templates
p.367 "Digital Signal Processing with FPGA"
paul -
r1:c74d16760597 default
parent child
Show More
@@ -0,0 +1,14
1 # compute the two scaled butterfly equations
2
3 class ButterflyProcessor(object):
4 """docstring for ClassName"""
5 def __init__(self, arg):
6 super(ButterflyProcessor, self).__init__()
7 self.arg = arg
8
9 def butterfly(self):
10 Dre = ( Are + Bre ) / 2
11 Dim = ( Aim + Bim ) / 2
12 Ere = ( Are - Bre ) / 2
13 Eim = ( Aim - Bim ) / 2
14
@@ -0,0 +1,13
1 # compute the complex twiddle factor multiplication R + jI = (X + jY) x (C + jS)
2
3 class EfficientComplexMultiplier(object):
4 """docstring for ClassName"""
5 def __init__(self, arg):
6 super(EfficientComplexMultiplier, self).__init__()
7 self.arg = arg
8
9 def multiply(self, X, Y, C, C_plus_S, C_minus_S):
10 Z = C * ( X - Y)
11 R = C_minus_S * Y + Z
12 I = C_plus_S * X - Z
13 return [R, I]
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
@@ -0,0 +1,7
1 from efficient_complex_multiplier import EfficientComplexMultiplier
2
3 efficientComplexMultiplier = EfficientComplexMultiplier(0)
4 res = efficientComplexMultiplier.multiply(70, 50, 121, 160, 82)
5 print res
6 print res[0]/128
7 print res[1]/128 No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now