4
$\begingroup$

Let $$\varphi(x):=\frac1{2\pi\sigma^2}e^{-\frac12\left(\frac{\|x\|}\sigma\right)^2}\;\;\;\text{for }x\in\mathbb R^2$$ for some $\sigma>0$. I want to numerically compute $$p(\omega):=\left|\hat\varphi(\omega)\right|^2\;\;\;\text{for }\omega\in[-1,1)^2.$$ Shouldn't be too complicated, I thought. For the numerical integration, I'm using $$[-a,a)=\bigcup_{i_1=-k_1}^{k_1-1}\bigcup_{i_2=-k_2}^{k_2-1}\left(\left[\frac{i_1}{k_1}a_1,\frac{i_1+1}{k_1}a_1\right)\times\left[\frac{i_2}{k_2}a_2,\frac{i_2+1}{k_2}a_2\right)\right)$$ for suitable chosen $a_1,a_2>0$ and $k_1,k_2\in\mathbb N$. This gives me the scheme $$\hat\varphi(\omega)\approx\frac{a_1a_2}{k_1k_2}\sum_{i_1=-k_1}^{k_1-1}\sum_{i_2=-k_2}^{k_2-1}e^{-{\rm i}2\pi\langle\omega,\left(\frac{i_1}{k_1}a_1,\:\frac{i_2}{k_2}a_2\right)}\varphi\left(\frac{i_1}{k_1}a_1,\frac{i_2}{k_2}a_2\right).$$ Plotting $p$ using this scheme and $a_1=a_2=k_1=k_2=100$, I obtain the following result:

enter image description here

Now, I already know that the analytical form of $\hat\varphi$ is $$\hat\varphi(\omega)=e^{-2\left(\pi\sigma\|\omega\|\right)^2}\;\;\;\text{for all }\omega\in\mathbb R^d,$$ where $d=2$ in our case. Plotting $p$ using this analytical form, I obtain this result:

enter image description here

They are obviously different. I think I should expect that the "spectrum is replicated" in the first result (can I somehow obtain the distance from the center until when the replication begins?). However, even if I cut out the centered spectrum, it doesn't match the one in the second result. So, is there anything wrong with the way I estimated $\hat\varphi$ in the numerical integration? All plots show $\sigma=1$.

$\endgroup$
4
  • 2
    $\begingroup$ This looks like a classic example of aliasing. See en.wikipedia.org/wiki/Nyquist_frequency $\endgroup$
    – whpowell96
    May 28 at 21:02
  • $\begingroup$ @whpowell96 Yes, that's causing the replication. But my main concern is why the circles have a different radius. Some kind of scaling is off here. I first noticed that my definition of $\varphi$ was wrong. The normalization factor was not correct. I've changed the scaling in my formula of $\hat\varphi$ accordingly and updated the pictures in the question. However, the results are still different. Is there still some mistake in one of my formulas? $\endgroup$
    – 0xbadf00d
    May 29 at 10:23
  • $\begingroup$ Don't really know it could help, but is quite similar to these situation $\endgroup$
    – Joako
    Jun 4 at 4:05
  • $\begingroup$ Are you only interested in identifying why there are issues with your integration scheme, or are you mainly looking for any integration scheme that gives convergent results for lots of smooth functions on the input domain? $\endgroup$
    – rajb245
    Jun 6 at 14:22

0

You must log in to answer this question.