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
#!/usr/bin/env python | |
import sys | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import wave | |
import scipy.signal as signal | |
import math | |
LIMIT_DB = 20 | |
MAX_DB = 85 |
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
#!/usr/bin/env python | |
import numpy as np | |
from scipy.io.wavfile import write | |
import matplotlib.pyplot as plt | |
sample_rate = 44100 | |
duration = 10 | |
def generate_blue_noise(duration, sample_rate): |
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
#!/usr/bin/env python | |
from PIL import Image, ImageDraw, ImageFont | |
import matplotlib.colors as mcolors | |
import colorsys | |
import cv2 | |
import numpy as np | |
from scipy.spatial import KDTree | |
height = 100 | |
width = 600 |
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
import os | |
import sys | |
import cv2 | |
import numpy as np | |
from scipy.io import wavfile | |
from scipy.signal import firwin, lfilter | |
from scipy.signal.windows import hamming | |
import matplotlib.pyplot as plt | |
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
import os | |
import sys | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.io import wavfile | |
import cv2 | |
def wav_to_image_with_rgb(wav_file, image_file): | |
sample_rate, data = wavfile.read(wav_file) |
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
import os | |
import sys | |
import cv2 | |
import numpy as np | |
from scipy.io import wavfile | |
import matplotlib.pyplot as plt | |
def image_to_audio(image_path, output_wav, output_spectrogram): | |
img = cv2.imread(image_path, cv2.IMREAD_GRAYSCALE) |
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
import os | |
import sys | |
import cv2 | |
import numpy as np | |
from scipy.io import wavfile | |
def image_to_audio(image_path, output_wav): | |
img = cv2.imread(image_path, cv2.IMREAD_GRAYSCALE) | |
height, width = img.shape |
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
#!/usr/bin/env python | |
from PIL import Image, ImageDraw, ImageFont | |
import matplotlib.colors as mcolors | |
import colorsys | |
import cv2 | |
import numpy as np | |
from scipy.spatial import KDTree | |
height = 100 | |
# width = 400 |
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
#!/usr/bin/env python | |
from PIL import Image, ImageDraw, ImageFont | |
import matplotlib.colors as mcolors | |
import colorsys | |
import numpy as np | |
from scipy.spatial import KDTree | |
height = 200 | |
width = 400 | |
txt_x = 2 |
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
from PIL import Image, ImageDraw | |
height = 300 | |
width = 600 | |
txt_x = 2 | |
txt_y = 2 | |
txt_color = "red" | |
def color_save(text, color_rgb): |
NewerOlder