Skip to content

Commit 595dd24

Browse files
author
chris-langfield
committed
Merge branch 'main' of github.com:chris-langfield/hexfft
2 parents 51c1d03 + ef370db commit 595dd24

File tree

1 file changed

+54
-3
lines changed

1 file changed

+54
-3
lines changed

README.md

+54-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,58 @@
1-
## hexfft
1+
![Screenshot 2024-05-21 at 1 00 10 PM](https://github.com/chris-langfield/hexfft/assets/34426450/b4eff5e9-2375-4d2c-a77e-5009efb34495)
2+
3+
# hexfft
24

35
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).
46

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+
![Screenshot 2024-05-21 at 1 06 04 PM](https://github.com/chris-langfield/hexfft/assets/34426450/92d11a97-8b64-4d3f-9ac9-c612aa4b5437)
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 import FFT
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)
52+
53+
[4 - Basic filtering example](https://github.com/chris-langfield/hexfft/blob/main/examples/BasicFiltering.ipynb)
54+
55+
## Install
656

757
```
858
pip install hexfft
@@ -19,7 +69,8 @@ cd hexfft
1969
pytest tests/
2070
```
2171

72+
## Further reading
2273
---------------------------------------
2374
> 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
2475
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

Comments
 (0)