So I have a discretized magnitude spectrum $S \in \mathbb{R}^n$ ($n$ number of bins), and a set of frequencies $f_1, f_2, ..., f_m$ (not necessarily corresponding to any of the discretized bin frequencies).
I want to find a set of frequencies and amplitudes $g_1, ..., g_m, a_1, ..., a_m$ such that the earth mover distance between $S$ and $K = \sum_i a_i\delta(f - g_i)$ is minimized (in L1 cost), subject to each $g_i$ being close enough (within some given $\epsilon$) to the corresponding $f_i$.
In other words, as an attempt to formalize it, I want to
$min_{g_1, ..., g_m, a_1, ..., a_m, M} \int_{\mathbb{R} \times \mathbb{R}} |\omega_1 - \omega_2| dM(\omega_1, \omega_2)$
subject to
$M \in \mathcal{M}_+(\mathbb{R} \times \mathbb{R}), \int_\mathbb{R} dM(\cdot, \omega_2) = S, \int_\mathbb{R} dM(\omega_1, \cdot) = K$
and
$|f_i - g_i| \leq \epsilon$ for $\forall i \in \{0, 1, ..., m\}$ and $\sum_j S[j] = \sum_i a_i$
Everything looks linear except for $\int_\mathbb{R} dM(\omega_1, \cdot) = K$. Also, intuitively, $a_i$ can be decided once $g_i$ are decided, as the sum of magnitudes of bins whose corresponding frequency is closest to "centroid" $g_i$ out of all $g$. How should I proceed from here? Should I somehow relax my problem?