You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+54-3
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,58 @@
1
-
## hexfft
1
+

2
+
3
+
# hexfft
2
4
3
5
A Python package aiming to provide an easy and efficient interface to various implementations of the [Hexagonal Fast Fourier Transform](https://en.wikipedia.org/wiki/Hexagonal_fast_Fourier_transform).
4
6
5
-
### Install
7
+
## Get started
8
+
9
+
#### Plot hexagonally sampled 2D signals
10
+
```python
11
+
from hexfft import HexArray
12
+
from hexfft.plot import hexshow
13
+
import numpy as np
14
+
15
+
data = np.random.normal(size=(8, 6))
16
+
h = HexArray(data)
17
+
hexshow(h)
18
+
```
19
+

20
+
21
+
#### Perform FFT for rectangularly or hexagonally periodic signals
22
+
23
+
```python
24
+
from hexfft import fft, ifft
25
+
26
+
X = fft(h)
27
+
X_hx = fft(h, periodicity="rect") # or "hex"
28
+
```
29
+
30
+
#### Operate on a 3D stack
31
+
32
+
```python
33
+
from hexfft importFFT
34
+
35
+
shape = (32, 32)
36
+
37
+
fftobj = FFT(shape, periodicity="hex") # or "rect"
38
+
x = np.random.normal(size=(10, 32, 32))
39
+
X = fftobj.forward(x)
40
+
xx = fftobj.inverse(X)
41
+
42
+
...
43
+
```
44
+
45
+
#### Example notebooks
46
+
47
+
[1 - `HexArray` and visualization](https://github.com/chris-langfield/hexfft/blob/main/examples/HexArray.ipynb)
48
+
49
+
[2 - FFT with rectangular periodicity](https://github.com/chris-langfield/hexfft/blob/main/examples/RectangularPeriodicity.ipynb)
50
+
51
+
[3 - FFT with hexagonal periodicity](https://github.com/chris-langfield/hexfft/blob/main/examples/HexagonalPeriodicity.ipynb)
> R. M. Mersereau, "The processing of hexagonally sampled two-dimensional signals," in Proceedings of the IEEE, vol. 67, no. 6, pp. 930-949, June 1979, doi: 10.1109/PROC.1979.11356
24
75
25
-
> Ehrhardt, J. C. (1993). Hexagonal fast Fourier transform with rectangular output. In IEEE Transactions on Signal Processing (Vol. 41, Issue 3, pp. 1469–1472). Institute of Electrical and Electronics Engineers (IEEE). https://doi.org/10.1109/78.205759
76
+
> J. C. Ehrhardt, “Hexagonal fast Fourier transform with rectangular output,” IEEE Transactions on Signal Processing, vol. 41, no. 3. Institute of Electrical and Electronics Engineers (IEEE), pp. 1469–1472, Mar. 1993. doi: 10.1109/78.205759.
0 commit comments