Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
#This is Python3 executable
import os.path
from numpy import array, hstack, vstack, clip
from PIL import Image
import numpy as np
import subprocess
import re
#SOX_EXEC = r"C:\Program Files\sox-14-4-2\sox.exe"
@dmishin
dmishin / sumsin_mpmath.py
Created October 31, 2015 11:50
Experiments with S(x) = sin(x) + sin(2x)/2 + sin(4x)/4 + ...
"""Experiments with the 'sumsin' function: maximization and plotting
S(x) = sin(x) + sin(2x)/2 + sin(4x)/4 + ...
it appears that S(x) reaches maximum at
xmax = 0.8905302010175791857059461558*7027*
whereas
36pi/127=0.8905302010175791857059461558*9025*
Plots of the function: