mirror of
https://github.com/romanz/amodem.git
synced 2026-03-17 07:05:59 +08:00
use list comprehensions instead of map()
This commit is contained in:
@@ -13,7 +13,7 @@ def send(config, dst, src=None, verbose=False):
|
||||
calibration_symbols = int(1.0 * config.Fs)
|
||||
t = np.arange(0, calibration_symbols) * config.Ts
|
||||
signals = [np.sin(2 * np.pi * f * t) for f in config.frequencies]
|
||||
signals = map(common.dumps, signals)
|
||||
signals = [common.dumps(s) for s in signals]
|
||||
|
||||
try:
|
||||
for signal in itertools.cycle(signals):
|
||||
|
||||
@@ -18,7 +18,7 @@ class Interpolator(object):
|
||||
filt = h[index::resolution]
|
||||
filt = filt[::-1]
|
||||
self.filt.append(filt)
|
||||
lengths = map(len, self.filt)
|
||||
lengths = [len(f) for f in self.filt]
|
||||
self.coeff_len = 2*width
|
||||
assert set(lengths) == set([self.coeff_len])
|
||||
assert len(self.filt) == resolution
|
||||
|
||||
Reference in New Issue
Block a user