Message Boards Message Boards

0
|
1939 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Unexpected results multiplying polynomials by DFT

I have been studying Fourier matrices and have used the following code to compute a simple polynomial multiplication:

A = {3, 7, 0, 0}
B = {-1, 2, 1, 0}
A1 = 2 FourierMatrix[4] . A
B1 = 2 FourierMatrix[4] . B
.5 InverseFourier[A1*B1]

the results are as expected ({-3., -1., 17., 7.}) but when I try to multiply larger polynomials such as

A = {3, 7, 0, 1,0,0,0,0}
B = {-1, 2, 1, 0,0,0,0,0}
A1 =  sqrt[8]FourierMatrix[8] . A
B1 =  sqrt[8]FourierMatrix[8] . B
1/8InverseFourier[A1*B1]

I get wild results that don't seem to reflect the correct coefficients. What am I missing?

POSTED BY: Bruce Samuels
3 Replies

(1) Sqrt, not sqrt

(2) 1/Sqrt[8] as factor for the final InverseFourier

POSTED BY: Daniel Lichtblau

My word, is that all it was?! I assume that the very small numbers be treated as zeros due to some computer resolution. Thank you!

POSTED BY: Bruce Samuels

Yes, that's all it was. And yes again, more or less. The imaginary fuzz is from machine double precision round-off error. This term, from numerical analysis, corresponds reasonably well to the stated "computer resolution".

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract