Commits

Miroslav Shubernetskiy committed 11c3bb5

Fixed normalization

Comments (0)

Files changed (1)

 
             return ns
 
-    def multiply(self, f1, f2):
+    def multiply(self, f1, f2, normalize):
         """
         Multiple the two sets of complex numbers.
 
         numbers : numpy.array
             The set of complex numbers which is a result of the multiplication
         """
-        return (f1 * f2) * 5
+        if normalize:
+            max = f2.max()
+            min = f2.min()
+            f2 = (f2 - min) / (max - min)
+        return (f1 * f2)
 
     def saveInverseFFT(self, f):
         """
     m.openImage(input2_path)
     in2 = m.computeImageFFT(0)
 
-    result = m.multiply(in1, in2)
+    result = m.multiply(in1, in2, True)
     m.saveInverseFFT(result)
 
     if DEBUG: