6
6
from __future__ import division
7
7
import numpy as np
8
8
from numpy .core .umath_tests import inner1d # element-wise inner product
9
- import scipy .signal as sig
9
+ from scipy .signal import besselap , sosfilt , zpk2sos
10
10
from .. import defs
11
11
from .. import util
12
12
@@ -307,8 +307,8 @@ def nfchoa_25d_plane(x0, r0, npw, max_order=None, c=None, fs=44100, normalize=Tr
307
307
weight = 2
308
308
sos = {}
309
309
for m in range (0 , max_order + 1 ):
310
- _ , p , _ = sig . besselap (m , norm = 'delay' )
311
- # TODO: modify "sig. besselap" for very high orders (>150)
310
+ _ , p , _ = besselap (m , norm = 'delay' )
311
+ # TODO: modify "besselap" for very high orders (>150)
312
312
s0 = np .zeros (m )
313
313
sinf = (c / r0 )* p
314
314
z0 = np .exp (s0 / fs )
@@ -318,7 +318,7 @@ def nfchoa_25d_plane(x0, r0, npw, max_order=None, c=None, fs=44100, normalize=Tr
318
318
k = _normalize_digital_filter_gain (s0 , sinf , z0 , zinf , fs = fs )
319
319
else :
320
320
k = 1
321
- sos [m ] = sig . zpk2sos (z0 , zinf , k , pairing = 'nearest' )
321
+ sos [m ] = zpk2sos (z0 , zinf , k , pairing = 'nearest' )
322
322
# TODO: normalize the SOS filters individually?
323
323
phaseshift = phipw + np .pi - phi0
324
324
return delay , weight , sos , phaseshift
@@ -373,8 +373,8 @@ def nfchoa_25d_point(x0, r0, xs, max_order=None, c=None, fs=44100, normalize=Tru
373
373
weight = 1 / 2 / np .pi / r
374
374
sos = {}
375
375
for m in range (0 , max_order + 1 ):
376
- _ , p , k = sig . besselap (m , norm = 'delay' )
377
- # TODO: modify "sig. besselap" for very high orders (>150)
376
+ _ , p , k = besselap (m , norm = 'delay' )
377
+ # TODO: modify "besselap" for very high orders (>150)
378
378
s0 = (c / r )* p
379
379
sinf = (c / r0 )* p
380
380
z0 = np .exp (s0 / fs )
@@ -384,7 +384,7 @@ def nfchoa_25d_point(x0, r0, xs, max_order=None, c=None, fs=44100, normalize=Tru
384
384
k = _normalize_digital_filter_gain (s0 , sinf , z0 , zinf , fs = fs )
385
385
else :
386
386
k = 1
387
- sos [m ] = sig . zpk2sos (z0 , zinf , k , pairing = 'nearest' )
387
+ sos [m ] = zpk2sos (z0 , zinf , k , pairing = 'nearest' )
388
388
# TODO: normalize the SOS filters individually?
389
389
phaseshift = phi0 - phi
390
390
return delay , weight , sos , phaseshift
@@ -427,11 +427,11 @@ def nfchoa_driving_signals(delay, weight, sos, phaseshift, signal, max_order=Non
427
427
L = len (signal )
428
428
d = np .zeros ((L , N ), dtype = 'comp
7804
lex128' )
429
429
430
- modal_response = sig . sosfilt (sos [0 ], signal )
430
+ modal_response = sosfilt (sos [0 ], signal )
431
431
for l in range (N ):
432
432
d [:, l ] += modal_response
433
433
for m in range (1 , max_order + 1 ):
434
- modal_response = sig . sosfilt (sos [np .abs (m )], signal )
434
+ modal_response = sosfilt (sos [np .abs (m )], signal )
435
435
for l in range (N ):
436
436
d [:, l ] += modal_response * 2 * np .cos (m * phaseshift [l ])
437
437
t_offset = delay [0 ]
0 commit comments