Message Boards Message Boards

0
|
392 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

What would the right approach to perform a 2D discrete convolution for this problem ?

Posted 24 days ago

I am trying to perform a 2D discrete convolution of two terms; one a Gaussian and a differentiated Green's function containing Hankel function of first kind and zero order. The convolution is defined as $$p(x,y,t) = f(x,y) * \frac{d}{dt} G(x,y,t)$$ where,

  • $f(x,y) = \epsilon e^{ -\alpha (x^2 + y^2) }$
  • $\frac{d}{dt}G(x,y,t) = \frac{\omega}{4} \frac{1}{c_0^2 } H_0^{(1)}\left [k\sqrt{x^2+y^2} \right ] e^{-i \omega t}$

The common parameters in these terms are

  • $\epsilon=0.5$,
  • $\alpha = \frac{log(2)}{2}$
  • $\omega = \frac{2\pi}{30}$
  • $c = 340.2626486$
  • $ k = \omega/c$
  • $t = 90$

These terms are from a paper in acoustics. I have tried to perform a discrete convolution but it fails to produced any output except the warning TerminatedEvaluation["RecursionLimit"]. I have attached the workbook which contains the usage of the commandDiscreteConvolve and the convolving variables I have used are $\xi$ and $\eta$.

What would be right way to perform a convolution for these terms? Are there any gotchas which I need to be aware of ?

POSTED BY: Ishan Nande
2 Replies

It seems that you are attempting a continuous convolution, not a discrete one. For lack of an NConvolve, you may try something like this:

cnvlv[x_?NumericQ, y_?NumericQ] :=
  NIntegrate[f[\[Xi], \[Eta]] DiffG[x - \[Xi], y - \[Eta]],
   {\[Xi], -Infinity, Infinity},
   {\[Eta], -Infinity, Infinity}];
cnvlv[5, 1]
POSTED BY: Gianluca Gorni

You are not talking about the discrete convolution. In Mathematica the discrete convolution is performed by ListConvolve.

You might try to tabulate your functions over some discrete x / y region an then in deed perform a discrete convolution via ListConvolve.

POSTED BY: Robert Nowak
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