# Per Window Normalization

I have PPG signal that should be normalized, with offline processing I'd just do $z$-normalization, $$\displaystyle \frac{x- \mu_x}{\sigma_x} \quad \text{where } x \text{ is the signal.}$$ The problem is that I get the data in chunks and I'm not sure what would be the effect on the signal when normalizing only chunks of the data at any given point. Any ideas or suggestions on how to approach this would be highly appreciated.

Thanks, Jack

• I think you misplaced a bracket. It should be $\frac{x- \mu_x}{\sigma_x}$. – Gilles Aug 14 '15 at 12:03

In several application the mean is removed by using a high pass filter. A first order high pass filter has the following structure: $$y[k] = x[k] - x[k-1] + \beta y[k-1]$$ or $$y[k] = \beta x[k] - \beta x[k-1] + \beta y[k-1]$$ where $0<\beta<1$ determines the steepness of the high pass filter, larger $\beta$ leads to a steeper/sharper filter.

NOTE: Multiplying $x[k]$ and $x[k-1]$ by $\beta$ (as in the second equation) ensures that the gain per frequency is at most one. Due to the next normalization step, using this $\beta$ for $x$ is redundant.

Normalization of the signals energy can be performed with a recursive estimation of the signal energy: $$P_x[k] = \alpha y[k]y[k] + (1-\alpha) P_x[k-1]$$ where $y[n]$ is the zero mean signal and $0<\alpha<1$ is a forgetting factor. Small values for $\alpha$ lead to large time-constants of the recursive filter.

The normalized output output $z[k]$ is calculated as follows: $$z[k] = \frac{y[k]}{\sqrt{P_x[k]}}$$

The signal $z[k]$ is a zero-mean signal with unit variance. You can scale your variance to a desired level $\sigma^2$ by applying the gain $\sqrt{\sigma^2}$ to signal $z[k]$.

NOTE1: A signal in the rang [0,1] always has a non-zero mean if the signal is not zero all the time.

NOTE2: In order to guarantee the signal levels to be in a specified range such as [-1,1], either a compression technique has to be applied or you have to know the original abolute maxima and minima such that you can scale to the desired range.

NOTE3: The variance in combination with the distribution only tells something about the majority of the samples.

• Thanks. How would you go about designing a high pass filter that can normalize a signal to certain range? Say, [0,1] or [-1,1] – Jack Aug 14 '15 at 16:33
• The high pass filter is only used for removing the mean. When you limit your signal to the range [0,1], then you will have a mean (for a symmetric distribution the mean will be 0.5. The power estimate $P_x[k]$ can be used to normalize the variance of $x[k]$ via $\tilde{x}[k]=\frac{x[k]}{\sqrt{P_x[k]}}$ – Brian Aug 14 '15 at 18:24
• Brian, do you really mean to put the $\beta$ as coefficients of the $x$ terms in your first equation? I've generally only seen $\beta$ on the $y$ term (see, for example this). – Peter K. Aug 14 '15 at 20:54
• The advantage of putting $\beta$ as coefficients of the $x$ terms is that the gain becomes at most one for all frequencies. Especially due to the latter normalization this step is not really necessary here. – Brian Aug 14 '15 at 23:15