share
TeX - LaTeXHow to write a convolution and a Fourier transform
[+14] [2] user123551
[2017-01-31 18:30:51]
[ math-mode symbols ]
[ https://tex.stackexchange.com/questions/351420/how-to-write-a-convolution-and-a-fourier-transform ]

I want to write the following equation in LaTeX:

\begin{equation}
x(t) \ast h(t) = y(t) 

X(f) H(f) = Y(f) 
\end{equation}

I want \ast to denote the convolution. I know there is also the \star command. Does it matter which one I use to represent convolution? Then I want a Fourier-transform symbol, I mean the line with a coloured and an empty circle on either side, to connect the x(t) and X(f), h(t) and H(f), y(t) and Y(f) respectively. Is there a way of doing this ?

Don't know about the symbols (but you can look them up). I suggest you use the align or align* environment for display formulae with horizontal alignment. The amsmath package provides the environment. - user10274
(1) \ast and \star are quite different symbols. You can just use * for \ast, but I've never seen \star for a convolution. Can you point to some reference for the Fourier transform symbol you mention? - egreg
[+18] [2017-01-31 18:46:21] AboAmmar [ACCEPTED]

The \circledast symbol from amssymb package is usually used to denote the circular convolution process.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}

\begin{align*}
x(t) \circledast h(t) &= y(t) \\
X(f) H(f) &= Y(f) 
\end{align*}

\end{document}

enter image description here

For linear convolution, a simple * is more appropriate:

\begin{align*}
x(t)*h(t) &= y(t) \\
X(f) H(f) &= Y(f) 
\end{align*}

enter image description here

To draw connections between parts of the equations, TikZ package can be used with its tikzmark library to mark locations to begin and end your lines.

\documentclass{article}
\usepackage{amsmath,amssymb,tikz}
\usetikzlibrary{arrows.meta,tikzmark}
\begin{document}

\begin{align*}
x\tikzmark{x}(t)*h\tikzmark{h}(t) &= y\tikzmark{y}(t) \\[2em]
X(f) \, H(f) &= Y(f) 
\end{align*}

\begin{tikzpicture}[overlay,remember picture, > = {Circle[open,blue]}]
  \draw [<->] ([yshift=-.7ex]pic cs:x) -- ++(0,-2.2em);
  \draw [<->] ([yshift=-.7ex]pic cs:h) -- ++(0,-2.2em);
  \draw [<->] ([yshift=-.7ex]pic cs:y) -- ++(0,-2.2em);
\end{tikzpicture}

\end{document}

enter image description here


i never see this symbol for convolution (my professional life was very tied with use of convolutions ...). where you find it? - Zarko
I specifically used the symbol for circular convolution, may be I'll switch back to the linear one - AboAmmar
ok, thank you so much! - I have a couple of questions though: I am not in "math-mode" without \begin{equation}, right? Does this somehow influence the layout of the equation? I mean, do the variables look different from variables used in \begin{equation} ? Then, can you explain to me, why you are using a * in {align*} and what the & in front of the "=" sign does? - user123551
@Luk - Sure! variables in math-mode will differ from those in text mode, the former is the proper choice. The * in {align*} is to suppress numbering of lines and the & before = is to align the two = signs horizontally in both lines. - AboAmmar
@Luk - I edited to include the connecting lines, I'm not sure, though, about the precise shape you need for the lines. But, the idea will remain the same, regardless of the shape you need. - AboAmmar
allright, thx again! - user123551
I have an error, though: I can't find file `tikzlibraryarrows.meta.code.tex' \usetikzlibrary{arrows.meta,tikzmark} - user123551
1
[+2] [2021-07-26 13:08:53] someUsername

I just want to add that there is an easier way to get the symbol between the fourier transform pairs by using the trfsigns package.

\usepackage{trfsigns}
$g(x_1,x_2)* h(x_1,x_2)\laplace G(\omega_1,\omega_2)\cdot H(\omega_1,\omega_2)$

enter image description here


2