Created
November 17, 2025 08:15
-
-
Save Gro-Tsen/d13cf698e5693ef2d68fb50dbf808a4e to your computer and use it in GitHub Desktop.
Plot the Fourier transform of μ(n)/n
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| destdir = "." | |
| nbsamp = 403200 | |
| fft = FastFourierTransform(nbsamp) | |
| for i in range(nbsamp): | |
| fft[i] = N(moebius(i)/i) if i>0 else 0 | |
| fft.forward_transform() | |
| plot = list_plot([(N(i/nbsamp-1), N(fft[i][1])) for i in range(nbsamp)]+[(N(i/nbsamp), N(fft[i][1])) for i in range(nbsamp)], plotjoined=True, thickness=0.5, color="red") + list_plot([(N(i/nbsamp-1), N(fft[i][0])) for i in range(nbsamp)]+[(N(i/nbsamp), N(fft[i][0])) for i in range(nbsamp)], plotjoined=True, thickness=0.5) | |
| plot.save(filename=(destdir+"/moebius.png"), dpi=192, aspect_ratio=0.4) | |
| parplot = list_plot([(N(fft[i][0]), N(fft[i][1])) for i in range(nbsamp)], plotjoined=True, thickness=0.5, color="purple") | |
| parplot.save(filename=(destdir+"/moebius-curve.png"), dpi=192, aspect_ratio=1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment