From 1ff777d226c09181b50a8c0c1cdf225c1a5b3b8d Mon Sep 17 00:00:00 2001 From: babetoduarte Date: Sat, 14 Oct 2017 17:03:27 -0500 Subject: [PATCH] Added basic comment descriptions to the scripts and to some of the source files. There's still much to be done, but it's a start. --- amodem/alsa.py | 3 +++ amodem/async.py | 2 ++ amodem/audio.py | 2 ++ amodem/calib.py | 2 ++ amodem/common.py | 2 ++ amodem/detect.py | 2 ++ amodem/dsp.py | 2 ++ amodem/equalizer.py | 2 ++ scripts/plot.py | 4 ++++ scripts/record.py | 3 +++ scripts/resample.py | 5 +++++ 11 files changed, 29 insertions(+) diff --git a/amodem/alsa.py b/amodem/alsa.py index 749669c..2fec92a 100644 --- a/amodem/alsa.py +++ b/amodem/alsa.py @@ -3,6 +3,9 @@ import logging log = logging.getLogger(__name__) +"""Code which adds Linux ALSA support for interfaces, +recording and playing. +""" class Interface(object): diff --git a/amodem/async.py b/amodem/async.py index 9391d5d..688dc20 100644 --- a/amodem/async.py +++ b/amodem/async.py @@ -4,6 +4,8 @@ import logging log = logging.getLogger() +"""Asynchronous Reading capabilities for amodem. +""" class AsyncReader(object): def __init__(self, stream, bufsize): diff --git a/amodem/audio.py b/amodem/audio.py index eafc728..f2d4a8c 100644 --- a/amodem/audio.py +++ b/amodem/audio.py @@ -4,6 +4,8 @@ import time log = logging.getLogger(__name__) +"""Audio capabilities for amodem. +""" class Interface(object): def __init__(self, config, debug=False): diff --git a/amodem/calib.py b/amodem/calib.py index 9473d8d..01ee34b 100644 --- a/amodem/calib.py +++ b/amodem/calib.py @@ -10,6 +10,8 @@ import subprocess log = logging.getLogger(__name__) +"""Calibration capabilities for amodem. +""" def volume_controller(cmd): def controller(level): diff --git a/amodem/common.py b/amodem/common.py index eee5415..ef863c6 100644 --- a/amodem/common.py +++ b/amodem/common.py @@ -9,6 +9,8 @@ log = logging.getLogger(__name__) scaling = 32000.0 # out of 2**15 +"""Commom utilities and procedures for amodem. +""" def load(fileobj): ''' Load signal from file object. ''' diff --git a/amodem/detect.py b/amodem/detect.py index 4f14050..069365e 100644 --- a/amodem/detect.py +++ b/amodem/detect.py @@ -9,6 +9,8 @@ import collections log = logging.getLogger(__name__) +"""Signal detection capabilities for amodem. +""" class Detector(object): diff --git a/amodem/dsp.py b/amodem/dsp.py index ce789c5..eab59db 100644 --- a/amodem/dsp.py +++ b/amodem/dsp.py @@ -2,6 +2,8 @@ import numpy as np from . import common +"""Digital Signal Processing capabilities for amodem. +""" class FIR(object): def __init__(self, h): diff --git a/amodem/equalizer.py b/amodem/equalizer.py index 9f7bd10..2ec481e 100644 --- a/amodem/equalizer.py +++ b/amodem/equalizer.py @@ -5,6 +5,8 @@ from . import levinson import numpy as np import itertools +"""Audio equalizing capabilities for amodem. +""" class Equalizer(object): diff --git a/scripts/plot.py b/scripts/plot.py index a6fc795..3546856 100755 --- a/scripts/plot.py +++ b/scripts/plot.py @@ -5,6 +5,10 @@ from amodem import common from amodem.config import Configuration import sys +"""Script that exposes pylab's spectogram plotting +capabilities to the command line. It implements this +for amodem.config Configurations. +""" def spectrogram(t, x, Fs, NFFT=256): ax1 = pylab.subplot(211) diff --git a/scripts/record.py b/scripts/record.py index 49caab9..8126f40 100755 --- a/scripts/record.py +++ b/scripts/record.py @@ -3,6 +3,9 @@ import argparse from amodem import audio from amodem.config import Configuration +"""Script that records audio through an interface +and stores it into an amodem.config Configuration. +""" def run(args): config = Configuration() diff --git a/scripts/resample.py b/scripts/resample.py index bb6ab6d..5e33a30 100755 --- a/scripts/resample.py +++ b/scripts/resample.py @@ -3,6 +3,11 @@ from amodem.sampling import resample import argparse import sys +"""Script that exposes the amodem.resample() function +to the command line, taking parameters via standard +inputs and returning results via standard outputs. +""" + def main(): p = argparse.ArgumentParser()