import torch


def get_harmonic_frequencies(frequencies, n_harmonics):
    """Create integer multiples of the fundamental frequency.

    Args:
    frequencies: Fundamental frequencies (Hz). Shape [batch_size, time, 1].
    n_harmonics: Number of harmonics.

    Returns:
    harmonic_frequencies: Oscillator frequencies (Hz).
        Shape [batch_size, time, n_harmonics].
    """
    f_ratios = torch.linspace(1.0, float(n_harmonics), int(n_harmonics)).to(frequencies.device)
    f_ratios = f_ratios[None, None, :]
    harmonic_frequencies = frequencies * f_ratios
    return harmonic_frequencies