eband->Am experiments using timpulse

master
David 2021-01-03 09:07:47 +10:30
parent 42959c762a
commit 19464deed2
3 changed files with 10 additions and 6 deletions

View File

@ -44,7 +44,7 @@ parser.add_argument('--epochs', type=int, default=5, help='Number of training ep
parser.add_argument('--eband_K', type=int, default=14, help='width of each spectral mag vector')
parser.add_argument('--nb_samples', type=int, default=1000000, help='Number of spectral mag vectors to train on')
parser.add_argument('--embedding_dim', type=int, default=16, help='dimension of embedding vectors (VQ dimension)')
parser.add_argument('--nb_embedding', type=int, default=127, help='number of embedded vectors (VQ size)')
parser.add_argument('--nb_embedding', type=int, default=128, help='number of embedded vectors (VQ size)')
parser.add_argument('--scale', type=float, default=0.005, help='apply this gain to features when read in')
parser.add_argument('--nnout', type=str, help='Name of output NN we have trained (.npy format)')
parser.add_argument('--mean', action='store_true', help='Extract mean from each chunk')
@ -332,11 +332,15 @@ while key != 'q':
plt.show(block=False)
plt.pause(0.0001)
print("n-next b-back q-quit", end='\r', flush=True);
print("n-next b-back x-next50 z-back50 q-quit", end='\r', flush=True);
key = getch.getch()
if key == 'n':
frame += nb_plots
if key == 'b':
frame -= nb_plots
if key == 'x':
frame += 50
if key == 'z':
frame -= 50
plt.close()

View File

@ -5,7 +5,7 @@
PATH=$PATH:~/codec2/build_linux/src:~/codec2/build_linux/misc
timpulse --randf0 --secs 60 > impulse.raw
timpulse --randf0 --secs 1200 --rande 4 --filter > impulse.raw
c2sim impulse.raw --bands impulse.f32 --modelout impulse.model
./model_to_sparse.py impulse.model impulse_sparse.f32 --nb_samples 6000
./eband_vq_am.py impulse.f32 impulse_sparse.f32 --nb_embedding 2
./model_to_sparse.py impulse.model impulse_sparse.f32
./eband_vq_am.py impulse.f32 impulse_sparse.f32 --nb_embedding 8 --epochs 5

View File

@ -33,7 +33,7 @@ nb_samples = args.nb_samples
# read in Codec 2 model file records and set up sparse rate L vectors --------------------
Wo, L, A, phase, voiced = codec2_model.read(args.modelfile, args.nb_samples)
assert(Wo.shape[0] >= nb_samples);
nb_samples = Wo.shape[0]
# Avoid harmonics above Fcutoff, as anti-alising filters tend to
# produce very small values that don't affect speech but contribute