This notebook demonstrates automatic phase correction algorithms implemented for nmrglue. Two standard algorithms are implemented:

ACME algorithm by Chen Li et al. Journal of Magnetic Resonance 158 (2002) 164-168

Naive peak minima minimisation

The outputs for the two algorithms are shown below. Automatic phase correction can be used through the addition of an `autops`

function to the `proc_base`

set alongside the algorithm name to employ for scoring of phase. Custom algorithms can be provided via the same parameter.

```
import nmrglue as ng
dic, data = ng.bruker.read("/Users/mxf793/Data/THPNH/Extract/1d/103/")
data = ng.bruker.remove_digital_filter(dic, data)
```

```
%matplotlib inline
```

```
import matplotlib.pyplot as plt
plt.figure(figsize=(10,4))
plt.plot(data)
```

```
data_fft = ng.proc_base.fft(data)
plt.figure(figsize=(10,4))
plt.plot(data_fft)
```

```
data_pc_pm = ng.proc_base.autops(data_fft,'peak_minima')
```

```
plt.figure(figsize=(10,4))
plt.plot(data_pc_pm)
```

```
data_pc_acme = ng.proc_base.autops(data_fft,'acme')
```

```
plt.figure(figsize=(10,4))
plt.plot(data_pc_acme)
```