From 8159e9b1ab697c291f6f154665f47660575ca7c9 Mon Sep 17 00:00:00 2001 From: dj2ls Date: Sun, 19 Dec 2021 15:14:52 +0100 Subject: [PATCH] moved codec2 to tnc folder preparation for migration to codec2 module for the entire TNC --- test/001_highsnr_stdio_audio/test_multimode_rx.py | 4 ++-- test/001_highsnr_stdio_audio/test_multimode_tx.py | 4 ++-- test/001_highsnr_stdio_audio/test_rx.py | 5 +++-- test/001_highsnr_stdio_audio/test_tx.py | 4 ++-- {test => tnc}/codec2.py | 3 ++- 5 files changed, 11 insertions(+), 9 deletions(-) rename {test => tnc}/codec2.py (99%) diff --git a/test/001_highsnr_stdio_audio/test_multimode_rx.py b/test/001_highsnr_stdio_audio/test_multimode_rx.py index 0f14182d..8a0ffa94 100755 --- a/test/001_highsnr_stdio_audio/test_multimode_rx.py +++ b/test/001_highsnr_stdio_audio/test_multimode_rx.py @@ -9,8 +9,8 @@ import sys import ctypes from ctypes import * import pathlib -sys.path.insert(0,'..') -import codec2 +sys.path.insert(0,'../..') +from tnc import codec2 import numpy as np #--------------------------------------------GET PARAMETER INPUTS diff --git a/test/001_highsnr_stdio_audio/test_multimode_tx.py b/test/001_highsnr_stdio_audio/test_multimode_tx.py index ae0308c7..22f77004 100644 --- a/test/001_highsnr_stdio_audio/test_multimode_tx.py +++ b/test/001_highsnr_stdio_audio/test_multimode_tx.py @@ -11,8 +11,8 @@ import threading import audioop import argparse import sys -sys.path.insert(0,'..') -import codec2 +sys.path.insert(0,'../..') +from tnc import codec2 import numpy as np # GET PARAMETER INPUTS diff --git a/test/001_highsnr_stdio_audio/test_rx.py b/test/001_highsnr_stdio_audio/test_rx.py index 5e90b435..f29ea33d 100644 --- a/test/001_highsnr_stdio_audio/test_rx.py +++ b/test/001_highsnr_stdio_audio/test_rx.py @@ -17,8 +17,9 @@ import threading import sys import argparse import numpy as np -sys.path.insert(0,'..') -import codec2 +sys.path.insert(0,'../..') +from tnc import codec2 + #--------------------------------------------GET PARAMETER INPUTS parser = argparse.ArgumentParser(description='Simons TEST TNC') diff --git a/test/001_highsnr_stdio_audio/test_tx.py b/test/001_highsnr_stdio_audio/test_tx.py index 1eeac6a7..581eae2d 100644 --- a/test/001_highsnr_stdio_audio/test_tx.py +++ b/test/001_highsnr_stdio_audio/test_tx.py @@ -9,8 +9,8 @@ import pyaudio import time import argparse import sys -sys.path.insert(0,'..') -import codec2 +sys.path.insert(0,'../..') +from tnc import codec2 import numpy as np # GET PARAMETER INPUTS diff --git a/test/codec2.py b/tnc/codec2.py similarity index 99% rename from test/codec2.py rename to tnc/codec2.py index 6ce6e252..5126d167 100644 --- a/test/codec2.py +++ b/tnc/codec2.py @@ -139,7 +139,8 @@ class resampler: print("create 48<->8 kHz resampler") self.filter_mem8 = np.zeros(self.MEM8, dtype=np.int16) self.filter_mem48 = np.zeros(self.MEM48) - + + def resample48_to_8(self,in48): assert in48.dtype == np.int16 # length of input vector must be an integer multiple of api.FDMDV_OS_48