I have programmed a model based on a research article. In order to validate it I need to recreate the same dataset as in the article.
My goal is to construct a signal by superposition of a large number, $N$, of sinusoidal functions with periods ranging between $T_{min}$ and $T_{max}$, with a constant amplitude and random phase (bandpass filter). The frequencies of these functions would be "chosen" in order to reach for the summed signal a given period $T_\Sigma$, way larger than $T_{max}$.
I have no problem to deduce from a sum of sinusoidal functions what would be the period of the signal : $T_\Sigma = lcm\left[T_1;T_i;T_N\right]$, where lcm is the least common multiple of every individual period.
But doing the opposite: building a list of numbers to achieve a given lcm seems harder to me...
To sum everything up, my signal would look like this:
$$\sum_{i=1}^N \sin\left(2\pi\frac{1}{T_i}t\right)$$ Where $T_{min}<T_i<T_{max}$
Thus the period of the summed signal would be $T_\Sigma = lcm\left[T_1;T_i;T_N\right]$.
Fixed value being $T_{min}$, $T_{max}$, $T_\Sigma$ and $N$, I need to find a relationship allowing me to pick every $T_i$.
Thank You !
Sidenote: yes, I know I could generate a bandpass signal based on filtered white noise, but then it would not have any "global" period, as it was performed in the article results I'm trying to reproduce.
Let the prime factorization of $T_\Sigma$ be $ p_1^{\alpha_1} p_2^{\alpha_2} \cdots p_q^{\alpha_q}. $
For each $p_i^{\alpha_i}$, you need at least one $T_j$ that is a positive multiple of $p_i^{\alpha_i}$. The positive multiple could be $p_i^{\alpha_i}$ itself, but if you never have a $T_j$ with at least $\alpha_i$ factors of $p_i$ then the LCM will not contain $\alpha_i$ factors of $p_i$ and will not be $T_\Sigma$.
A single $T_i$ could be a multiple of some $p_i^{\alpha_i}p_j^{\alpha_j}$, that is, it could cover two of the primes at once, so you do not necessarily need a different $T_i$ for every prime in the prime factorization. This is how you can deal with the case where $q > N,$ that is, if you have more distinct primes than distinct periods.
Note that if $T_\Sigma$ is a power of a prime, for example, if $T_\Sigma = 1024,$ the only way to achieve that period is for $T_\Sigma$ itself to be one of the periods in your list.
To satisfy the constraint that $T_\min \leq T_i \leq T_\max,$ you may have to multiply some of the $p_i^{\alpha_i}$ by other factors from the prime factorization in order to get a period between $T_\min$ and $T_\max.$ If $q > N$ you may have to try different combinations of $p_i^{\alpha_i}p_j^{\alpha_j}$ with other factors in order to find one that "fits." Note that if $p_i^{\alpha_i} > T_\max$ for any $i$ you are out of luck. But even if that does not happen, a particular problem still may be unsolvable for other reasons.
One approach might be to make a list of all factors of $T_\Sigma$ that are between $T_\min$ and $T_\max.$ There are only $\prod_i (\alpha_i + 1)$ factors, which you can generate systematically and discard any that are out of the desired range. You can also (for now) set aside any factor that is not a multiple of $p_i^{\alpha_i}$ for at least one $p_i.$ Check the list of factors to make sure each $p_i^{\alpha_i}$ divides at least one member of the list. Now choose a factor from the list that is a multiple of $p_1^{\alpha_1},$ a factor that is a multiple of $p_2^{\alpha_2},$ and so forth, up to $N$ factors, until all the distinct prime factors are accounted for. (If $q > N$ you will need to observe when a chosen factor accounts for multiple distinct prime factors or you will not succeed in accounting for all of them.)
It may help if you make a memo of what factors of $p_i^{\alpha_i}$ each number in the list has. But even with aids like that, if $q > N$ you might have to backtrack (discard the choices made so far and try new ones) in order to find factors that account for every distinct prime factor without using more than $N$ factors of $T_\Sigma.$
If you are able to construct a list of $N$ or fewer factors that account for every distinct prime factor of $T_\Sigma,$ you can fill out the list with any other factors of $T_\Sigma$ between $T_\min$ and $T_\max,$ whether or not each new factor is a multiple of some $p_i^{\alpha_i}$.