4

I have seen in a book the following "square hat" symbol to denote the discrete Fourier transform: DFT notation

I would like to use the same symbol, but I cannnot find the corresponding command. Can anyone help me, please?

6

Here's one you can tailor and which fits to the argument:

\documentclass{article}
\usepackage{stackengine}
\def\rlwd{.4pt}
\def\rlht{1.1pt}
\def\shatvrule{\rule{\rlwd}{\rlht}}
\def\shat#1{%
  \setbox0=\hbox{$#1$}%
  \stackon[0pt]{\stackon[1pt]{\ensuremath{#1}}{%
    \shatvrule\kern\wd0\kern-\rlwd\kern-\rlwd\shatvrule}}%
    {\rule{\wd0}{\rlwd}}%
}
\begin{document}
$\shat u(\omega,t) = \shat{XYZ}$
\end{document}

enter image description here

The 1pt is the gap below the hat to the letter, which can be changed, the \rlht is the height of the vertical strut, and \rlwd is the rule thickness.

If you need it to work across math styles, here is a slight variation:

\documentclass{article}
\usepackage{stackengine}
\usepackage{scalerel}
\def\rlwd{.4pt}
\def\rlht{1.1pt}
\def\shatvrule{\rule{\rlwd}{\rlht}}
\def\shat#1{%
 \ThisStyle{%
  \setbox0=\hbox{$\SavedStyle#1$}%
  \stackon[0pt]{\stackon[1pt]{\ensuremath{\SavedStyle#1}}{%
    \shatvrule\kern\wd0\kern-\rlwd\kern-\rlwd\shatvrule}}%
    {\rule{\wd0}{\rlwd}}%
 }%
}
\begin{document}
$\shat u(\omega,t) = \shat{XYZ}$

$\scriptscriptstyle\shat u(\omega,t) = \shat{XYZ}$
\end{document}

enter image description here

And if I wanted to get really fancy, I could introduce variable rule height, thickness and stacking gap, all of which scale with the math style, as described at the bottom of this answer: wavy division sign wanted. Without reiterating that code, the result would look like

enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.