GEN create_gen (int run, int size, double* in, double* out, int rate, int mode) { GEN a = (GEN) malloc0 (sizeof (gen)); a->run = run; a->size = size; a->in = in; a->out = out; a->rate = (double)rate; a->mode = mode; // tone a->tone.mag = 1.0; a->tone.freq = 1000.0; // two-tone a->tt.mag1 = 0.5; a->tt.mag2 = 0.5; a->tt.f1 = + 900.0; a->tt.f2 = + 1700.0; // noise srand ((unsigned int)time (0)); a->noise.mag = 1.0; // sweep a->sweep.mag = 1.0; a->sweep.f1 = -20000.0; a->sweep.f2 = +20000.0; a->sweep.sweeprate = +4000.0; // sawtooth a->saw.mag = 1.0; a->saw.f = 500.0; // triangle a->tri.mag = 1.0; a->tri.f = 500.0; // pulse a->pulse.mag = 1.0; a->pulse.pf = 0.25; a->pulse.pdutycycle = 0.25; a->pulse.ptranstime = 0.002; a->pulse.tf = 1000.0; calc_gen (a); return a; }
void setSamplerate_gen (GEN a, int rate) { decalc_gen (a); a->rate = rate; calc_gen (a); }
void get_mblks() { calc_num_mblks(); calc_gen(); }