Skip to content
Snippets Groups Projects
Commit 2c9b8474 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

noise tuning, flip sign of speech signal

parent 80751bad
No related branches found
No related tags found
No related merge requests found
......@@ -244,13 +244,14 @@ int main(int argc, char **argv) {
if (training && ++gain_change_count > 2821) {
float tmp, tmp2;
speech_gain = pow(10., (-20+(rand()%40))/20.);
if (rand()&1) speech_gain = -speech_gain;
if (rand()%20==0) speech_gain *= .01;
if (rand()%100==0) speech_gain = 0;
gain_change_count = 0;
rand_resp(a_sig, b_sig);
tmp = (float)rand()/RAND_MAX;
tmp2 = (float)rand()/RAND_MAX;
noise_std = -log(tmp)-log(tmp2);
noise_std = ABS16(-1.5*log(1e-4+tmp)-.5*log(1e-4+tmp2));
}
biquad(x, mem_hp_x, x, b_hp, a_hp, FRAME_SIZE);
biquad(x, mem_resp_x, x, b_sig, a_sig, FRAME_SIZE);
......
#ifndef LPCNET_PRIVATE_H
#define LPCNET_PRIVATE_H
#include <stdio.h>
#include "common.h"
#include "freq.h"
#include "lpcnet.h"
......@@ -74,4 +75,6 @@ void compute_frame_features(LPCNetEncState *st, const float *in);
void decode_packet(float features[4][NB_TOTAL_FEATURES], float *vq_mem, const unsigned char buf[8]);
void process_single_frame(LPCNetEncState *st, FILE *ffeat);
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment