I am trying to find the coefficients of multiplications of 2 $N$-variate polynomials using $N$-dimensional fast Fourier transform (FFT) on MATLAB.
My approach so far is as follows: Based on this post, I learned to do it for the multiplication of 2 1-dimensional polynomials. It is simply
y1 = [1 0 0 0];
y2 = [0 2 0 0];
ifft(fft(y1).*fft(y2));
for $y_1=1$ and $y_2=2x$, whereby $x$ is the input.
How about when it is multivariate, say $y_1=1+2x_1$ and $y_2=x_1+4{x_1}^2x_2$, whereby $x_1$ and $x_2$ are the inputs? How can I make use of the MATLAB function fftn?
I actually managed to find the answer to the question and would like to share it here. First we construct the polynomial in $2$-dimensional matrix - because 2 variables are involved.
Then we use the functions fftn() and ifftn() to find the coefficients
This will give you the following results:
which resembles $x_1 + 4{x_1}^2x_2 + 8{x_1}^3x_2 + 2{x_1}^2$ in matrix.