# highpass_fft_filter#

kikuchipy.filters.highpass_fft_filter(shape: Tuple[int, int], cutoff: , cutoff_width: = None) [source]#

Return a frequency domain high-pass filter transfer function in 2D.

Used in .

Parameters:
shape

Shape of function.

cutoff

Cut-off frequency.

cutoff_width

Width of cut-off region. If not given (default), it is set to half of the cutoff frequency.

Returns:
window

2D transfer function.

Notes

The high-pass filter transfer function is defined as

$\begin{split}w(r) = e^{-\left((c - r)/(\sqrt{2}w_c/2)\right)^2}, w(r) = \begin{cases} 0, & r < c - 2w_c\\ 1, & r > c, \end{cases}\end{split}$

where $$r$$ is the radial distance to the window centre, $$c$$ is the cut-off frequency, and $$w_c$$ is the width of the cut-off region.

Examples

>>> import numpy as np
>>> import kikuchipy as kp
>>> w1 = kp.filters.Window(
...     "highpass", cutoff=1, cutoff_width=0.5, shape=(96, 96)
... )
>>> w2 = kp.filters.highpass_fft_filter(
...     shape=(96, 96), cutoff=1, cutoff_width=0.5
... )
>>> np.allclose(w1, w2)
True