Questions tagged [convolution]

For questions about applying convolutions to data. This can include the process of convolving two functions together or seeking a kernel matrix to convolve with a grid of data (often done in image processing).

Filter by
Sorted by
Tagged with
0 votes
0 answers
70 views

Convolution in Fourier space with Python

I am trying to implement following step into the my cosmological particle mesh code. From the PM code, I obtained the 3D array for density and used the following code in python, but I'm not sure, if ...
FunThom's user avatar
0 votes
0 answers
9 views

Is the following the correct implementation of VGG network?

As exercise I am implementing few fundamental networks. Specifically right now I am implementing VGG The code I've got at the moment is the following: class MyVGG(nn.Module): ...
user8469759's user avatar
0 votes
0 answers
63 views

How expensive is it to compute an image convolution

I was wondering how computationally expensive it is to compute an image convolution. That is, to convolve an NxN image with a 3x3 or 5x5 convolution filter? It seems like this would be a costly ...
krishnab's user avatar
  • 297
0 votes
0 answers
68 views

difference in notation of integral operator

I'm reading paper 1 and on page 4 they define the integral operator $\mathcal{K}$ as $$ (\mathcal{K}(a;\phi)v_t)(x) := \int_D \kappa(x,y,a(x),a(y);\phi)v_t(y)dy $$ Now in an another paper from the ...
NNN's user avatar
  • 762
2 votes
2 answers
245 views

How to plan convoluted measurements

I have a physical function $f(x)$ which I intend to measure. Problem is that I cannot read it directly, but through a response function $g(x)$ which is known to me with great accuracy and any one ...
i_prob_should_know_this's user avatar
0 votes
0 answers
100 views

About Convolution Theorem

...
Deepak Kallepalli's user avatar
1 vote
0 answers
117 views

Convolution/weighted average of two arrays in Python

I have an equation that I need to calculate numerically, but I am having doubts about my approach. I am cross-posting this question from Stack Exchange, because I am not getting any responses. This is ...
theWrongAlice's user avatar
1 vote
1 answer
210 views

Computing convolution on non-uniform sample

How to efficiently convolve the function $h(t)=H(t)e^{-t}$ with a function $x(t)$ sampled non-uniformly, i.e. $\{x(t_0), x(t_1), ..., x(t_{N-1})\}$? $H(t)$ is the Heaviside step function, and the ...
Firman's user avatar
  • 181
2 votes
1 answer
110 views

Padding length and error analysis of discrete convolution by FFT

The standard algorithm for discrete convolution of two vectors $x\in \mathbb{R}^{n}$ and $y \in \mathbb{R}^{m}$ is (in essence) a FFT of the two input vectors, multiplication of the two elementwise, ...
user14717's user avatar
  • 2,155
1 vote
0 answers
158 views

Deconvolution of sinc function in spectrum calculation in FTS

In Fourier transform spectroscopy (FTS) I am calculating a broadband interferogram (e.m. frequency 190-300 GHz top-hat), then back-retrieving the spectrum by FT. Here in the figure, you can see the ...
Raizen's user avatar
  • 61
4 votes
3 answers
523 views

Why not use the convolution theorem for explicit timestepping?

Consider the advection equation \begin{equation} \frac{\partial C}{\partial t} + u\frac{\partial C}{\partial x} + v\frac{\partial C}{\partial y} = 0 \end{equation} I want to do a forward time, center ...
nalzok's user avatar
  • 181
2 votes
0 answers
463 views

Numerical evaluation of Duhamel's integration

I am trying to numerically evaluate the following Duhamel's integration: $$ x = \frac{-1}{\omega_d} \int_0^t \ddot{x}_g (\tau) e^{-\zeta \omega_n(t - \tau)} \sin{\left( \omega_d (t - \tau) \right)} d\...
Quang Thinh Ha's user avatar
0 votes
1 answer
74 views

What's the relationship of machine learning and mechanical simulation?

What's the relationship of machine learning and mechanical simulation? Particularly, machine learning is about learning from a large sample and predicting based on filters tuned on that. Mechanical ...
mavavilj's user avatar
  • 427
4 votes
3 answers
846 views

Convolute a gaussian kernel with a large array of off-grid centroids without looping? (how to make "A Thousand (Gaussian) Points of Light" )

For a finite object size diffraction simulator, I need to generate arrays which are the sum of thousands of instances of a Gaussian (or other) 2D kernel at centroids that will not fall in any ...
uhoh's user avatar
  • 1,048
1 vote
1 answer
339 views

How to generate the convolution of f(x, y) with a parametric function g(t), x(t), y(t) in Python? (Something better than this brute-force sum)

The answer to Convolute a gaussian kernel with a large array of off-grid centroids without looping? (how to make "A Thousand (Gaussian) Points of Light" ) involves summing a 3D array over ...
uhoh's user avatar
  • 1,048
0 votes
1 answer
70 views

Compute efficiently a 1D function relying on a 2D convolution

Let $X = [0,1]$, $h$ the Gaussian function (i.e. $\forall x \in X, h(x) = e^{-\frac{x}{2}}$) and $p \in L^2(X^2)$ I would like to compute numerically the following function : $$ \forall x \in X, \...
Bast's user avatar
  • 11
0 votes
0 answers
516 views

How to take convolution of two arrays in Python by using NumPy?

Generally, we know that if we have this relation between Fourier transforms of three functions in frequency domain as: $$\mathfrak{F}\{\mathsf{P}(t)\} = \mathfrak{F}\{\mathsf{Z}(t)\}\mathfrak{F}\{\...
Mithridates the Great's user avatar
3 votes
1 answer
301 views

Problem implementing convolutions exactly with the FFT

I'm trying to perform convolutions as defined mathematically $f \star g (\tau)= \int_{\mathcal{R}}f(t-\tau)g(t) dt$ in a numerical simulation. Hence, my signal is a sampling of points $f(x_i)$. I ...
Comrad dau's user avatar
1 vote
2 answers
720 views

Convolution in Python

I have an integral of a convolution between two functions. How can I calculate this in Python? It is a continuum convolution.
Brenda Pinheiro's user avatar
4 votes
1 answer
233 views

Computation of triple nested loops as a convolution product?

I'm trying to compute efficiently the following \begin{equation} A_j = \sum_{l'=1}^{\infty}\sum_{k= 0}^{K-1} L_{l'}T_ke^{2\pi i \frac{k}{K}j}\epsilon_{l',k} \end{equation} for $j = 0,1, \ldots, K-2,K-...
HansimGlück's user avatar
5 votes
0 answers
133 views

Levinson Recursion for Non Square Toeplitz Matrices

Given a rectangular Toeplitz Matrix $ H $, how could one solve: $$ y = H x $$ For instance, $ H $ can be Linear Convolution Matrix of the filter $ h $: $$ H = \begin{bmatrix} {h}_{1} & 0 & ...
Royi's user avatar
  • 332
2 votes
0 answers
39 views

Computing convolution of two characteristic function over a 1D Cartesian mesh

I am trying to compute the convolution of two characteristic functions over a Cartesian mesh. First, I define my Cartesian mesh of the interval $[0,1]$ as follows $$ x_{i} = i \Delta x, i = 0, 1, 2\...
NumericalKid's user avatar
1 vote
0 answers
49 views

FFT convolution works only with certain domain length

in my quest to understand how I can use FFT to compute integrals (see my other question click, still no answer there), I came across the fact that a convolution of two functions can be calculated by ...
reloh100's user avatar
  • 153
1 vote
1 answer
66 views

Accelerating Conjugate Gradients fitting for small localized kernel (like cubic B-spline)

Question: Is there some pre-conditioner for Conjugate-Gradient (CG) cheap enough, that it is worth using even if my operator is very local (i.e. already has a low number of non-zero elements), as it ...
Prokop Hapala's user avatar
3 votes
1 answer
256 views

Calculating the Convolution Using DFT (FFT)

I have the following convolution as part of a numerical simulation. $$T(r)=\int \mathrm{d}^3r_2\, p(r_2)f(r_2)\alpha(r-r_2)\, .$$ My problem is that the analytical expressions for $f$ and $p$ do ...
lattitude's user avatar
  • 131