I've been exploring the Fourier transform of functions of the type
$$f_n(p,q) =\sin{\left(\frac{p\pi}{q}n^2\right)}$$
where $n$ are positive integers. When plotting $n$ on the x-axis vs $f_n(p,q)$ on the y-axis for some fixed value of $p$ and $q$, (example shown for $p=3,\ q=5$,
Plot of $f_n(3,5)$ for n = {0,1,2,...100}
It is clear that the plot is $q$-periodic. Now my observation is that the Fourier transform of any such function consists of exactly $q-1$ peaks, each separating the range $[-\pi, \pi]$ into $q$ sections of equal width. Each peak of the Fourier transform is therefore at
$$\omega_m =-\pi+\frac{m\pi}{q}$$
where $m$ goes from $1$ to $q-1$.
Plot of Fourier transform of $f_n(3,5)$
It is clear to me that since our function is periodic, its Fourier transform has finitely many exactly defined peaks (even though I struggle with the mathematical formalism to show this), but I fail to explain/understand why there are exactly $q-1$ peaks and why they're evenly spaced on $[-\pi, \pi]$.
Now my question is whether anyone can explain/derive why this particular behaviour happens.
Thanks so much already!