From 3cd3a9f82068bea3a37e4efe0ee3752ecb044cce Mon Sep 17 00:00:00 2001 From: drowe67 Date: Thu, 13 Jul 2023 08:49:31 +0930 Subject: rm misc directory --- misc/timpulse.c | 128 -------------------------------------------------------- 1 file changed, 128 deletions(-) delete mode 100644 misc/timpulse.c (limited to 'misc/timpulse.c') diff --git a/misc/timpulse.c b/misc/timpulse.c deleted file mode 100644 index 8227c0d..0000000 --- a/misc/timpulse.c +++ /dev/null @@ -1,128 +0,0 @@ -/* - timpulse.c - David Rowe Dec 2019 - - Generate a synthetic speech signal from a sum of sinusoids. Generates a known test - signals for phaseNN and ampNN projects. -*/ - -#include -#include -#include -#include -#include - -#define FS 8000 - -int main(int argc, char *argv[]) { - short buf[FS] = {0}; - float f0 = 60.0; - float n0 = 0.0; - int Nsecs = 1; - int randf0 = 0; - int filter = 0; - int rande = 0; - - int o = 0; - int opt_idx = 0; - while( o != -1 ) { - static struct option long_opts[] = { - {"help", no_argument, 0, 'h'}, - {"n0", required_argument, 0, 'n'}, - {"f0", required_argument, 0, 'f'}, - {"secs", required_argument, 0, 's'}, - {"randf0", no_argument, 0, 'r'}, - {"rande", required_argument, 0, 'e'}, - {"filter", no_argument, 0, 'i'}, - {0, 0, 0, 0} - }; - - o = getopt_long(argc,argv,"hn:f:s:r",long_opts,&opt_idx); - - switch(o) { - case 'n': - n0 = atof(optarg); - break; - case 'f': - f0 = atof(optarg); - break; - case 's': - Nsecs = atoi(optarg); - break; - case 'r': - randf0 = 1; - break; - case 'i': - filter = 1; - break; - case 'e': - rande = atoi(optarg); - break; - case '?': - case 'h': - fprintf(stderr, - "usage: %s\n" - "[--f0 f0Hz] fixed F0\n" - "[--n0 samples] time offset\n" - "[--secs Nsecs] number of seconds to generate\n" - "[--randf0] choose a random F0 every second\n" - "[--rande Ndiscrete] choose a random frame energy every second, Ndiscrete values\n" - "\n", argv[0]); - exit(1); - break; - } - } - - int t = 0; - float A = 100.0; - - /* optionally filter with 2nd order system */ - float alpha = 0.25*M_PI, gamma=0.99; - float a[2] = {-2.0*gamma*cos(alpha), gamma*gamma}; - float mem[2] = {0}; - - for (int j=0; j