import math


def vec_norm (Spectrum):
    """Compute normalisation coefficient for vector normalisation"""
    norm_squared =0
    for i in range(len(Spectrum)):
        norm_squared = norm_squared + math.pow(Spectrum[i],2);
    norm = math.sqrt(norm_squared)
    if norm == 0:
        norm = 1;
    return norm