Skip to content
Snippets Groups Projects

Minor fixes

Merged Oscar Gustafsson requested to merge generatorchecking into master
+ 7
5
@@ -60,6 +60,9 @@ def wdf_allpass(
Signal flow graph
"""
np_coefficients = np.squeeze(np.asarray(coefficients))
order = len(np_coefficients)
if not order:
raise ValueError("Coefficients cannot be empty")
if not np_coefficients:
raise ValueError("Coefficients cannot be empty")
if np_coefficients.ndim != 1:
@@ -70,7 +73,6 @@ def wdf_allpass(
output = Output()
if name is None:
name = "WDF allpass section"
order = len(np_coefficients)
odd_order = order % 2
if odd_order:
# First-order section
@@ -164,7 +166,8 @@ def direct_form_fir(
transposed_direct_form_fir
"""
np_coefficients = np.squeeze(np.asarray(coefficients))
if not np_coefficients:
taps = len(np_coefficients)
if not taps:
raise ValueError("Coefficients cannot be empty")
if np_coefficients.ndim != 1:
raise TypeError("coefficients must be a 1D-array")
@@ -179,7 +182,6 @@ def direct_form_fir(
if add_properties is None:
add_properties = {}
taps = len(np_coefficients)
prev_delay = input_op
prev_add = None
for i, coeff in enumerate(np_coefficients):
@@ -244,7 +246,8 @@ def transposed_direct_form_fir(
direct_form_fir
"""
np_coefficients = np.squeeze(np.asarray(coefficients))
if not np_coefficients:
taps = len(np_coefficients)
if not taps:
raise ValueError("Coefficients cannot be empty")
if np_coefficients.ndim != 1:
raise TypeError("coefficients must be a 1D-array")
@@ -259,7 +262,6 @@ def transposed_direct_form_fir(
if add_properties is None:
add_properties = {}
taps = len(np_coefficients)
prev_delay = None
for i, coeff in enumerate(reversed(np_coefficients)):
tmp_mul = ConstantMultiplication(coeff, input_op, **mult_properties)
Loading