# $1/n$ octave complex smoothing

An excellent answer to this post explains how to do $1/n$ octave energy smoothing and mentions complex smoothing can be done as well, but it's tricky business because of phase wrapping.

How is phase wrapping solved in $1/n$ complex smoothing?

• One possible approach is to do magnitude smoothing via energy smoothing as described in the post, and then just keep the phase of each of original unsmoothed entries. But would that be correct? – SpeedCoder5 Jun 2 '14 at 23:36

Let $Z[i]$ be the complex valued frequency spectrum, where $i$ is the frequency index (FFT bin) and $0 \le i \le N - 1; N$ is the length of frequency bins. Then smoothed spectrum is given by $$Z_s[i] =\sum\limits_{j=i-\Delta/2}^{i+\Delta/2} W[j] * Z[j]$$ where $\Delta$ is the smoothing window and $W[j]$ is the smoothing coefficients. Here, $Z[j]$ is in complex form ($a + ib$) and $W[j]$ is real. So smoothed spectrum, $Z[i]_s$, contains both magnitude and phase information.
In general smoothing coefficients are normalized, such that, $\sum\limits_{j=0}^{n} W[j] = 1;$ where $n$ number of smoothing coefficients defined by $\Delta$.