def PadLDVBlanks(fv, num_dim):
    """
    Pad LDV vector with blanks to ensure it's of the proper length.

    The LDV vector may not contain a entry for each distance, thus the vector
    length will be less than the max length.  Need to pad all missing distance
    dimensions with a value of 0. Thus making all vectors of the same length of
    'max_dim'.

    @return FV padded with blanks
    """

    # Generate a vector of the desired length with a count of 0 for each distance.
    #
    new_vec = [[i, 0] for i in range(0, num_dim)]

    # Fill in this vector with the values from the frequency vector.
    #
    for block in fv:
        distance = block[0]
        count = block[1]
        if distance < num_dim:
            new_vec[distance] = [distance, count]

    return new_vec