0

我制作了一个如下所示的一维复杂图像“c”并使用 ShowImage 来显示它。我的问题是如何理解 Y 轴。
对于像素 1 (30+40i),看起来 Y 轴上的值表示 log(modulus(30+40i))=3.9。但是在像素 3 (0.3+0.4i) 中似乎没有遵循这个规则。

ComplexImage c := ComplexImage("c", 8, 3, 1) 
c[0, 0, 1, 1] = complex(30, 40)
c[0, 1, 1, 2] = complex(3, 4)
c[0, 2, 1, 3] = complex(0.3, 0.4)
ShowImage(c)

在此处输入图像描述

4

2 回答 2

1

虽然实际上不是脚本问题,但非常有趣的观察!事实证明,绘制或显示的值"Log of modulus"真的是:

log( modulus( C ) + 1 )

重要的是要知道,脚本命令log()采用自然对数。命令log10()会以 10 为基数做一个。

complexNumber c1 = complex(30,40)
complexNumber c2 = complex(3,4)
complexNumber c3 = complex(0.3,0.4)

result("\n Complex values:\n" )
result( "c1 = \t"+c1+"\n")
result( "c2 = \t"+c2+"\n")
result( "c3 = \t"+c3+"\n")

result("\n Modulus values:\n" )
result( "c1 = \t"+modulus(c1)+"\n")
result( "c2 = \t"+modulus(c2)+"\n")
result( "c3 = \t"+modulus(c3)+"\n")

result("\n Log of Modulus values:\n" )
result( "c1 = \t"+log10(modulus(c1))+"\n")
result( "c2 = \t"+log10(modulus(c2))+"\n")
result( "c3 = \t"+log10(modulus(c3))+"\n")

result("\n Log of Modulus + 1 values:\n" )
result( "c1 = \t"+log(modulus(c1) + 1)+"\n")
result( "c2 = \t"+log(modulus(c2) + 1)+"\n")
result( "c3 = \t"+log(modulus(c3) + 1)+"\n")

这给了你:

 Complex values:
c1 =    30 + 40 i
c2 =    3 + 4 i
c3 =    0.3 + 0.4 i

 Modulus values:
c1 =    50
c2 =    5
c3 =    0.5

 Log of Modulus values:
c1 =    1.69897
c2 =    0.69897
c3 =    -0.30103

 Log of Modulus +1 values:
c1 =    3.93183
c2 =    1.79176
c3 =    0.405465
于 2016-05-01T14:20:30.023 回答
0
compleximage ComplexImage( string title, number size,
number width, number height )

宽度和高度以像素为单位

number x = 512, y = 512
compleximage myImage := ComplexImage( "My Image", 16, x, y )
myImage = complex( irow, icol )
ShowImage( myImage )

此示例创建一个 512 x 512 像素、16 字节的复杂图像,标题为“我的图像”。然后它将图像中的所有像素设置为表达式 complex( irow, icol )。这个表达式是一个复杂的图像表达式,其中实部是每个像素的行号,虚部是每个像素的列号。最后它显示图像。

于 2016-05-01T11:31:11.667 回答