# 银河

SKYIV STUDIO

 博客园 :: 首页 :: 博问 :: 闪存 :: :: :: 订阅 :: 管理 ::

a = (aN-1aN-2...a1a0)10 = aN-1x10N-1 + aN-2x10N-2 + ... + a1x101 + a0x100

b = (bN-1bN-2...b1b0)10 = bN-1x10N-1 + bN-2x10N-2 + ... + b1x101 + b0x100

c = a x b = c2N-2x102N-2 + c2N-3x102N-3 + ... + c1x101 + c0x100

ck = a0xbk + a1xbk-1 + ... + ak-2xb2 + ak-1xb1
+ akxb0 + ak+1xb-1 + ... + aN-2xb-(N-2-k) + aN-1xb-(N-1-k)

a = (678)10 = 6x102 + 7x101 + 8x100

b = (432)10 = 4x102 + 3x101 + 2x100

c0 = a0xb0 + a1xb-1 + a2xb-2 = 8x2 + 7x0 + 6x0 = 16 + 0 + 0 = 16

c1 = a0xb1 + a1xb0 + a2xb-1 = 8x3 + 7x2 + 6x0 = 24 + 14 + 0 = 38

c2 = a0xb2 + a1xb1 + a2xb0 = 8x4 + 7x3 +6x2 = 32 + 21 + 12 = 65

c3 = a0xb3 + a1xb2 + a2xb1 = 8x0 + 7x4 + 6x3 = 0 + 28 + 18 = 46

c4 = a0xb4 + a1xb3 + a2xb2 = 8x0 + 7x0 + 6x4 = 0 + 0 + 24 = 24

c = a x b = 104xc4 + 103xc3 + 102xc2 + 101xc1 + 100xc0
= 10000x24 + 1000x46 + 100x65 + 10x38 + 1x16
= 292896

1. 分别求出向量 {ai} 和向量 {bj} 的离散傅里叶变换 {Ai} 和 {Bj}。
2. 将 {Ai} 和 {Bj} 逐项相乘得到向量 {Ck}。
3. 对 {Ck} 求离散傅里叶逆变换，得到的向量 {ck} 就是向量 {ai} 和向量 {bj} 的卷积。
4. 对的向量 {ck} 进行适当的进位就得到了大整数 a 和 b 的乘积 c。

{ a7, a6, a5, a4, a3, a2, a1, a0 } = { 0, 0, 0, 0, 0, 6, 7, 8 }

{ b7, b6, b5, b4, b3, b2, b1, b0 } = { 0, 0, 0, 0, 0, 4, 3, 2 }

ω = e-2πi/N = e-2πi/8 = e-πi/4 = cos(-π/4) + i sin(-π/4) = √2 / 2 - i √2 / 2 ≈ 0.7-0.7i

ω8 = ω0 = e0 = 1

ω9 = ω1 = e-πi/4 = cos(-π/4) + i sin(-π/4) ≈ 0.7-0.7i

ω10 = ω2 = e-πi/2 = cos(-π/2) + i sin(-π/2) = -i

ω11 = ω3 = e-3πi/4 = cos(-3π/4) + i sin(-3π/4) ≈ -0.7-0.7i

ω12 = ω4 = e-πi = cos(-π) + i sin(-π) = -1

ω13 = ω5 = e-5πi/4 = cos(-5π/4) + i sin(-5π/4) ≈ -0.7+0.7i

ω14 = ω6 = e-3πi/2 = cos(-3π/2) + i sin(-3π/2) = i

ω15 = ω7 = e-7πi/4 = cos(-7π/4) + i sin(-7π/4) ≈ 0.7+0.7i

A0 = a00x0 + a11x0 + a22x0 = 8xω0 + 7xω0 + 6xω0 = 8x1 + 7x1 + 6x1 = 21

A1 = a00x1 + a11x1 + a22x1 = 8xω0 + 7xω1 + 6xω2 ≈ 8x1 + 7x(0.7 - 0.7i) + 6x(-i) = 12.9-10.9i

A2 = a00x2 + a11x2 + a22x2 = 8xω0 + 7xω2 + 6xω4 = 8x1 + 7x(-i) + 6x(-1) = 2-7i

A3 = a00x3 + a11x3 + a22x3 = 8xω0 + 7xω3 + 6xω6 ≈ 8x1 + 7x(-0.7 - 0.7i) + 6xi = 3.1+1.1i

A4 = a00x4 + a11x4 + a22x4 = 8xω0 + 7xω4 + 6xω8 = 8x1 + 7x(-1) + 6x1 = 7

A5 = a00x5 + a11x5 + a22x5 = 8xω0 + 7xω5 + 6xω10 ≈ 8x1 + 7x(-0.7 + 0.7i) + 6x(-i) = 3.1-1.1i

A6 = a00x6 + a11x6 + a22x6 = 8xω0 + 7xω6 + 6xω12 = 8x1 + 7xi + 6x(-1) = 2+7i

A7 = a00x7 + a11x7 + a22x7 = 8xω0 + 7xω7 + 6xω14 ≈ 8x1 + 7x(0.7 + 0.7i) + 6xi = 12.9+10.9i

B0 = b00x0 + b11x0 + b22x0 = 2xω0 + 3xω0 + 4xω0 = 2x1 + 3x1 + 4x1 = 9

B1 = b00x1 + b11x1 + b22x1 = 2xω0 + 3xω1 + 4xω2 ≈ 2x1 + 3x(0.7 - 0.7i) + 4x(-i) = 4.1-6.1i

B2 = b00x2 + b11x2 + b22x2 = 2xω0 + 3xω2 + 4xω4 = 2x1 + 3x(-i) + 4x(-1) = -2-3i

B3 = b00x3 + b11x3 + b22x3 = 2xω0 + 3xω3 + 4xω6 ≈ 2x1 + 3x(-0.7 - 0.7i) + 4xi = -0.1+1.9i

B4 = b00x4 + b11x4 + b22x4 = 2xω0 + 3xω4 + 4xω8 = 2x1 + 3x(-1) + 4x1 = 3

B5 = b00x5 + b11x5 + b22x5 = 2xω0 + 3xω5 + 4xω10 ≈ 2x1 + 3x(-0.7 + 0.7i) + 4x(-i) = -0.1-1.9i

B6 = b00x6 + b11x6 + b22x6 = 2xω0 + 3xω6 + 4xω12 = 2x1 + 3xi + 4x(-1) = -2+3i

B7 = b00x7 + b11x7 + b22x7 = 2xω0 + 3xω7 + 4xω14 ≈ 2x1 + 3x(0.7 + 0.7i) + 4xi = 4.1+6.1i

{ A7, A6, A5, A4, A3, A2, A1, A0 } = { 12.9+10.9i, 2+7i, 3.1-1.1i, 7, 3.1+1.1i, 2-7i, 12.9-10.9i, 21 }

{ B7, B6, B5, B4, B3, B2, B1, B0 } = { 4.1+6.1i, -2+3i, -0.1-1.9i, 3, -0.1+1.9i, -2-3i, 4.1-6.1i, 9 }

= { -13.6+123.4i, -25-8i, -2.4-5.8i, 21, -2.4+5.8i, -25+8i, -13.6-123.4i, 189 }

ω = e2πi/N = e2πi/8 = eπi/4 = cos(π/4) + i sin(π/4) = √2 / 2 + i √2 / 2 ≈ 0.7+0.7i

ω0 = e0 = 1

ω1 = eπi/4 = cos(π/4) + i sin(π/4) ≈ 0.7+0.7i

ω2 = eπi/2 = cos(π/2) + i sin(π/2) = i

ω3 = e3πi/4 = cos(3π/4) + i sin(3π/4) ≈ -0.7+0.7i

ω4 = eπi = cos(π) + i sin(π) = -1

ω5 = e5πi/4 = cos(5π/4) + i sin(5π/4) ≈ -0.7-0.7i

ω6 = e3πi/2 = cos(3π/2) + i sin(3π/2) = -i

ω7 = e7πi/4 = cos(7π/4) + i sin(7π/4) ≈ 0.7-0.7i

c0 = (1/N) x ( C00x0 + C11x0 + C22x0 + C33x0
+ C44x0 + C55x0 + C66x0 + C77x0 )
= (1/8) x ( 189xω0 + (-13.6-123.4i)xω0 + (-25+8i)xω0 + (-2.4+5.8i)xω0
+ 21xω0 + (-2.4-5.8i)xω0 + (-25-8i)xω0 + (-13.6+123.4i)xω0 )
= 0.125 x ( 189x1 + (-13.6-123.4i)x1 + (-25+8i)x1 + (-2.4+5.8i)x1
+ 21x1 + (-2.4-5.8i)x1 + (-25-8i)x1 + (-13.6+123.4i)x1 )
= 0.125 x 128 = 16

c1 = (1/N) x ( 8xc1 = C00x1 + C11x1 + C22x1 + C33x1
+ C44x1 + C55x1 + C66x1 + C77x1 )
= (1/8) x ( 189xω0 + ( -13.6-123.4i)xω1 + (-25+8i)xω2 + (-2.4+5.8i)xω3
+ 21xω4 + (-2.4-5.8i)xω5 + (-25-8i)xω6 + (-13.6+123.4i)xω7 )
≈ 0.125 x ( 189x1 + (-13.6-123.4i)x(0.7+0.7i) + (-25+8i)x(i) + (-2.4+5.8i)x(-0.7+0.7i)
+ 21x(-1) + (-2.4-5.8i)x(-0.7-0.7i) + (-25-8i)x(-i) + (-13.6+123.4i)x(0.7-0.7i) )
= 0.125 x 300.96 = 37.62 ≈ 38

c2 = (1/N) x ( C00x2 + C11x2 + C22x2 + C33x2
+ C44x2 + C55x2 + C66x2 + C77x2 )
= (1/8) x ( 189xω0 + (-13.6-123.4i)xω2 + (-25+8i)xω4 + (-2.4+5.8i)xω6
+ 21xω8 + (-2.4-5.8i)xω10 + (-25-8i)xω12 + (-13.6+123.4i)xω14 )
= 0.125 x ( 189x1 + (-13.6-123.4i)x(i) + (-25+8i)x(-1) + (-2.4+5.8i)x(-i)
+ 21x1 + (-2.4-5.8i)x(i) + (-25-8i)x(-1) + (-13.6+123.4i)x(-i) )
≈ 0.125 x 518.4 = 64.8 ≈ 65

c3 = (1/N) x ( C00x3 + C11x3 + C22x3 + C33x3
+ C44x3 + C55x3 + C66x3 + C77x3 )
= (1/8) x ( 189xω0 + (-13.6-123.4i)xω3 + (-25+8i)xω6 + (-2.4+5.8i)xω9
+ 21xω12 + (-2.4-5.8i)xω15 + (-25-8i)xω18 + (-13.6+123.4i)xω21 )
≈ 0.125 x ( 189x1 + (-13.6-123.4i)x(-0.7+0.7i) + (-25+8i)x(-i) + (-2.4+5.8i)x(0.7+0.7i)
+ 21x(-1) + (-2.4-5.8i)x(0.7-0.7i) + (-25-8i)x(i) + (-13.6+123.4i)x(-0.7-0.7i) )
= 0.125 x 364.32 = 45.54 ≈ 46

c4 = (1/N) x ( C00x4 + C11x4 + C22x4 + C33x4
+ C44x4 + C55x4 + C66x4 + C77x4 )
= (1/8) x ( 189xω0 + (-13.6-123.4i)xω4 + (-25+8i)xω8 + (-2.4+5.8i)xω12
+ 21xω16 + (-2.4-5.8i)xω20 + (-25-8i)xω24 + (-13.6+123.4i)xω28 )
= 0.125 x ( 189x1 + (-13.6-123.4i)x(-1) + (-25+8i)x1 + (-2.4+5.8i)x(-1)
+ 21x1 + (-2.4-5.8i)x(-1) + (-25-8i)x1 + (-13.6+123.4i)x(-1) )
= 0.125 x 192 = 24

c5 = (1/N) x ( C00x5 + C11x5 + C22x5 + C33x5
+ C44x5 + C55x5 + C66x5 + C77x5 )
= (1/8) x ( 189xω0 + (-13.6-123.4i)xω5 + (-25+8i)xω10 + (-2.4+5.8i)xω15
+ 21xω20 + (-2.4-5.8i)xω25 + (-25-8i)xω30 + (-13.6+123.4i)xω35 )
≈ 0.125 x ( 189x1 + (-13.6-123.4i)x(-0.7-0.7i) + (-25+8i)x(i) + (-2.4+5.8i)x(0.7-0.7i)
+ 21x(-1) + (-2.4-5.8i)x(0.7+0.7i) + (-25-8i)x(-i) + (-13.6+123.4i)x(-0.7+0.7i) )
= 0.125 x 3.04 = 0.38 ≈ 0

c6 = (1/N) x ( C00x6 + C11x6 + C22x6 + C33x6
+ C44x6 + C55x6 + C66x6 + C77x6 )
= (1/8) x ( 189xω0 + (-13.6-123.4i)xω6 + (-25+8i)xω12 + (-2.4+5.8i)xω18
+ 21xω24 + (-2.4-5.8i)xω30 + (-25-8i)xω36 + (-13.6+123.4i)xω42 )
= 0.125 x ( 189x1 + (-13.6-123.4i)x(-i) + (-25+8i)x(-1) + (-2.4+5.8i)x(i)
+ 21x1 + (-2.4-5.8i)x(-i) + (-25-8i)x(-1) + (-13.6+123.4i)x(i) )
= 0.125 x 1.6 = 0.2 ≈ 0

c7 = (1/N) x ( C00x7 + C11x7 + C22x7 + C33x7
+ C44x7 + C55x7 + C66x7 + C77x7 )
= (1/8) x ( 189xω0 + (-13.6-123.4i)xω7 + (-25+8i)xω14 + (-2.4+5.8i)xω21
+ 21xω28 + (-2.4-5.8i)xω35 + (-25-8i)xω42 + (-13.6+123.4i)xω49 )
≈ 0.125 x ( 189x1 + (-13.6-123.4i)x(0.7-0.7i) + (-25+8i)x(-i) + (-2.4+5.8i)x(-0.7-0.7i)
+ 21x(-1) + (-2.4-5.8i)x(-0.7+0.7i) + (-25-8i)x(i) + (-13.6+123.4i)x(0.7+0.7i) )
= 0.125 x 3.68 = 0.46 ≈ 0

{ c7, c6, c5, c4, c3, c2, c1, c0 } = { 0, 0, 0, 0, 24, 46, 65, 38, 16 }

2 x log2B + log2N + 几个 x log2log2N < 53

(189 x 1) + (((-13.6) - (123.4 * i)) x i) + (((-25) + (8 * i)) x (-1)) + (((-2.4) + (5.8 * i)) x (-i)) + (21 x 1) + (((-2.4) - (5.8 * i)) x i) + (((-25) - (8 * i)) x (-1)) + (((-13.6) + (123.4 * i)) x (-i)) = 518.4 - 1.77635684 × 10-15 i