update 19
This commit is contained in:
parent
aadc623326
commit
96f3250148
2 changed files with 5 additions and 3 deletions
|
@ -53,9 +53,9 @@ def c_render(cascade, precision=4096):
|
||||||
def c_render2(xs, cascade, phase=False):
|
def c_render2(xs, cascade, phase=False):
|
||||||
"""c_render optimized and specifically for first/second-order filters"""
|
"""c_render optimized and specifically for first/second-order filters"""
|
||||||
if phase:
|
if phase:
|
||||||
return c_render(xs, cascade, mode='phase')
|
return c_render3(xs, cascade, mode='phase')
|
||||||
else:
|
else:
|
||||||
return c_render(xs, cascade, mode='magnitude')
|
return c_render3(xs, cascade, mode='magnitude')
|
||||||
|
|
||||||
def c_render3(xs, cascade, mode='magnitude'):
|
def c_render3(xs, cascade, mode='magnitude'):
|
||||||
"""c_render optimized and specifically for first/second-order filters"""
|
"""c_render optimized and specifically for first/second-order filters"""
|
||||||
|
@ -71,7 +71,7 @@ def c_render3(xs, cascade, mode='magnitude'):
|
||||||
elif mode == 'phase' or mode == 'group delay':
|
elif mode == 'phase' or mode == 'group delay':
|
||||||
fmt = '-arctan2(imag({0}), real({0}))' # gross
|
fmt = '-arctan2(imag({0}), real({0}))' # gross
|
||||||
else:
|
else:
|
||||||
raise Exception("c_render(): unknown mode: {}".format(mode))
|
raise Exception("c_render3(): unknown mode: {}".format(mode))
|
||||||
|
|
||||||
ys = np.zeros(len(xs))
|
ys = np.zeros(len(xs))
|
||||||
for f in cascade:
|
for f in cascade:
|
||||||
|
|
|
@ -4,6 +4,8 @@ import numpy as np
|
||||||
# coefficients via https://gist.github.com/notwa/3be345efb6c97d757398
|
# coefficients via https://gist.github.com/notwa/3be345efb6c97d757398
|
||||||
# which is a port of http://ldesoras.free.fr/prod.html#src_hiir
|
# which is a port of http://ldesoras.free.fr/prod.html#src_hiir
|
||||||
|
|
||||||
|
# i don't think my terminology is correct.
|
||||||
|
|
||||||
halfband_c = {}
|
halfband_c = {}
|
||||||
|
|
||||||
halfband_c['16,0.1'] = [
|
halfband_c['16,0.1'] = [
|
||||||
|
|
Loading…
Reference in a new issue