As far as I know, convolution theorem stated that $$ x[n] * y[n] = X(e^{j \omega}) Y(e^{j \omega}) $$ $$ X(e^{j \omega}) * Y(e^{j \omega}) = x[n] y[n] $$
I tried a simple experiment using GNU Octave which code is provided in the following
x = zeros(1,31);
h = zeros(1,31);
x(14:18) = [20 -30 40 -30 20];
h(14:18) = [1/5 1/5 1/5 1/5 1/5];
So now, we have
x = Columns 1 through 20: 0 0 0 0 0 0 0 0 0 0 0 0 0 20 -30 40 -30 20 0 0 Columns 21 through 31: 0 0 0 0 0 0 0 0 0 0 0
h = Columns 1 through 10: 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 Columns 11 through 20: 0.00000 0.00000 0.00000 0.20000 0.20000 0.20000 0.20000 0.20000 0.00000 0.00000 Columns 21 through 30: 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 Column 31: 0.00000
Next, the following code demonstrates whether $ x[n] * y[n] = X(e^{j \omega}) Y(e^{j \omega}) $
conv_result = round( conv(x,h,shape="same") );
freq_product_result = round( ifft( fft(x) .* fft(h) ) );
Then the results are
conv_result = Columns 1 through 25: 0 0 0 0 0 0 0 0 0 0 0 4 -2 6 0 4 0 6 -2 4 0 0 0 0 0 Columns 26 through 31: 0 0 0 0 0 0
freq_product_result = Columns 1 through 25: 0 6 -2 4 0 -0 0 -0 0 -0 0 -0 -0 0 -0 -0 0 0 -0 0 -0 0 -0 0 -0 Columns 26 through 31: -0 4 -2 6 0 4
Indeed both have the $\{4 , -2 , 6 , 0 , 4 , 0 , 6, -2, 4\}$ pattern, but the pattern doesn't appear at the same column index. Is my experiment correct? Should both the result be identical? I think I still don't understand the concept completely.