diff --git a/gen_wave.py b/gen_wave.py index d2f6e0a..f91b75d 100644 --- a/gen_wave.py +++ b/gen_wave.py @@ -73,8 +73,8 @@ def generate(): # Slice the array like numpy would out = shapedSamples[offset-l*count:offset+l*count] - out = [i/(max(sf)+0.1) for i in out] - if max(out) > 1 or min(out) < -1: print("clipped") + out = [i/(max(out)) for i in out] + if max(out) > 1 or min(out) < -1: raise Exception("Clipped") if PLOT: # Plot the waveform diff --git a/src/waveforms.c b/src/waveforms.c index 88b08fc..64178c6 100644 --- a/src/waveforms.c +++ b/src/waveforms.c @@ -6,5 +6,5 @@ Released under the GNU GPL v3 license. */ -float waveform_biphase[24] = {0.00461068279303888, -1.1797407833720696e-17, -0.008233362130426566, 5.1112771849830444e-17, 0.017125393231287256, -3.975331531625189e-17, -0.047094831386039954, -2.1301970095005356e-17, 0.28256898831623967, 0.7282050708733819, 0.9889914591068393, 0.7282050708733819, 0.0, -0.7282050708733819, -0.9889914591068393, -0.7282050708733819, -0.28256898831623967, 2.1301970095005356e-17, 0.047094831386039954, 3.975331531625189e-17, -0.017125393231287256, -5.1112771849830444e-17, 0.008233362130426566, 1.1797407833720696e-17}; +float waveform_biphase[24] = {0.004662004662004664, -1.192872569837455e-17, -0.008325008325008324, 5.168171209081069e-17, 0.017316017316017313, -4.0195812562580885e-17, -0.04761904761904761, -2.153908398182045e-17, 0.2857142857142856, 0.7363107781851077, 1.0, 0.7363107781851077, 0.0, -0.7363107781851077, -1.0, -0.7363107781851077, -0.2857142857142856, 2.153908398182045e-17, 0.04761904761904761, 4.0195812562580885e-17, -0.017316017316017313, -5.168171209081069e-17, 0.008325008325008324, 1.192872569837455e-17};