From 90e4cb623c679a3f2470f22ac8557addc6b50e58 Mon Sep 17 00:00:00 2001 From: JayRodRock Date: Sat, 23 Feb 2019 23:57:57 -0700 Subject: [PATCH] Added treble 1000-...Hz and extend base to 20-1000 --- ImageFunctions.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/ImageFunctions.py b/ImageFunctions.py index 50c43b0..de2f5a6 100644 --- a/ImageFunctions.py +++ b/ImageFunctions.py @@ -5,13 +5,26 @@ import numpy as np def getBaseWeight(transform): freqs = np.fft.fftfreq(len(transform)) hz=[] - for i in range(0,len(freqs[:120])): + for i in range(0,len(freqs[:1000])): x=i * (44100/len(freqs)/2) hz.append(x) tf=zip(list(hz),list(transform)) tf=list(tf) print() - t1=[t[1] for t in tf if t[0]>20 and t[0]<120] + t1=[t[1] for t in tf if t[0]>20 and t[0]<1000] print(sum(t1)) - tfinal=int(sum(t1)*10) + tfinal=int(sum(t1)) + return(tfinal) +def getTrebleWeight(transform): + freqs = np.fft.fftfreq(len(transform)) + hz=[] + for i in range(0,len(freqs[1000:])): + x=i * (44100/len(freqs)/2) + hz.append(x) + tf=zip(list(hz),list(transform)) + tf=list(tf) + print() + t1=[t[1] for t in tf if t[0]>1000] + print(sum(t1)) + tfinal=sum(t1) return(tfinal) \ No newline at end of file -- 2.21.0