📄 anapitros.c
字号:
/* psps - prints ESPS data files * * This material contains proprietary software of Entropic Speech, Inc. * Any reproduction, distribution, or publication without the the prior * written permission of Entropic Speech, Inc. is strictly prohibited. * Any public distribution of copies of this work authorized in writing by * Entropic Speech, Inc. must bear the notice * * "Copyright 1986, 1987 Entropic Speech, Inc." * * psps - dumps an ESPS data file on standard output. This verison by * Alan Parker, based on the SDS version by Joe Buck. */#ifdef SCCS static char *sccs_id = "@(#)anapitros.c 1.1 6/12/87 ESI";#endif#include <stdio.h>#include <sps/sps.h>#define MAX(a,b) ((a>b) ? a : b)void tab();int idx_ok();voidprint_ana(indent,hdr)int indent;struct header *hdr;{ struct ana_header *h = hdr->hd.ana; int i; printf("\n"); tab(indent); (void) printf("---ANA Header---\n"); tab(indent); (void) printf("start: %ld, nan: %ld, frmlen: %d\n", h->start, h->nan, (int) h->frmlen); tab(indent); (void) printf("order_vcd: %d, order_unvcd: %d, p_offset: %d\n", (int) h->order_vcd, (int) h->order_unvcd, (int) h->p_offset); tab(indent); if(idx_ok(h->piq_method,quant_methods)) (void) printf("piq_method: %s\n",quant_methods[h->piq_method]); else (void) printf("piq_method: invalid code %d\n",(int)h->piq_method); tab(indent); if(idx_ok(h->rcq_method,quant_methods)) (void) printf("rcq_method: %s\n",quant_methods[h->rcq_method]); else (void) printf("rcq_method: invalid code %d\n",(int)h->rcq_method); tab(indent); if(idx_ok(h->pwq_method,quant_methods)) (void) printf("pwq_method: %s\n",quant_methods[h->pwq_method]); else (void) printf("pwq_method: invalid code %d\n",(int)h->pwq_method); tab(indent); if(idx_ok(h->lpq_method,quant_methods)) (void) printf("lpq_method: %s\n",quant_methods[h->lpq_method]); else (void) printf("lpq_method: invalid code %d\n",(int)h->lpq_method); tab(indent); if(idx_ok(h->win_type,win_type_codes)) (void) printf("win_type: %s\n",win_type_codes[h->win_type]); else (void) printf("win_type: invalid code %d\n",(int)h->win_type); tab(indent); if(idx_ok(h->coh_method,coh_est_methods)) (void) printf("coh_method: %s\n",coh_est_methods[h->coh_method]); else (void) printf("coh_method: invalid code %d\n",(int)h->coh_method); tab(indent); (void) printf("src_sf: %g\n",h->src_sf); tab(indent); if(idx_ok(h->a_method,spec_ana_methods)) (void) printf("a_method: %s\n",spec_ana_methods[h->a_method]); else (void) printf("a_method: invalid code %d\n",(int)h->a_method); tab(indent); (void) printf("dcrem: %g, psynch: %d, maxpulses: %d\n", h->dcrem, (int)h->psynch, (int)h->maxpulses); tab(indent); (void) printf("maxlpc: %d, maxraw: %d, matsiz: %d\n", (int)h->maxlpc, (int)h->maxraw, (int)h->matsiz); tab(indent); (void) printf("rms_fullscale: %lf, sinc_flg: %d\n", h->rms_fullscale, (int)h->sinc_flg); for (i=0; i<ANA_SPARES; i++) if (h->spares[i] != 0) { tab(indent); (void) printf("spares[%d]: 0x%x\n", i, (int) h->spares[i]); } pr_zfunc(indent,"pre_emp",h->pre_emp); return;}voidprint_pitch(indent, hdr)int indent;struct header *hdr;{ struct pit_header *h = hdr->hd.pit; int i; printf("\n"); tab(indent); (void) printf("---Pitch File Header---\n"); tab(indent); (void) printf("start: %ld, nan: %ld, stepsz: %d\n", h->start, h->nan, (int) h->stepsz); tab(indent); (void) printf("u_pflt_order: %d, v_pflt_order: %d\n", (int) h->u_pflt_order, (int) h->v_pflt_order); tab(indent); if(idx_ok(h->win_type,win_type_codes)) (void) printf("win_type: %s\n",win_type_codes[h->win_type]); else (void) printf("win_type: invalid code %d\n",(int)h->win_type); tab(indent); if(idx_ok(h->coh_method,coh_est_methods)) (void) printf("coh_method: %s\n",coh_est_methods[h->coh_method]); else (void) printf("coh_method: invalid code %d\n",(int)h->coh_method); tab(indent); (void) printf("src_sf: %g\n",h->src_sf); tab(indent); (void) printf("dcrem: %s\n", (h->dcrem ? "YES":"NO")); tab(indent); if(idx_ok(h->p_method,pitch_methods)) (void) printf("p_method: %s\n",pitch_methods[h->p_method]); else (void) printf("p_method: invalid code %d\n",(int)h->p_method); tab(indent); (void) printf("pt_wsize: %d, uv_thresh: %g\n",(int)h->pt_wsize, h->uv_thresh); tab(indent); (void) printf("min_pp: %d, max_pp: %d, wflt_order: %d\n", (int)h->min_pp, (int)h->max_pp, (int)h->wflt_order); tab(indent); (void) printf("coh_window_frac: %g, pb_offset: %d\n", h->coh_window_frac, (int)h->pb_offset); tab(indent); (void) printf("harmonic_mult: %g, tm_uv_thresh: %g\n", h->harmonic_mult, h->tm_uv_thresh); tab(indent); (void) printf("am_uv_thresh: %g, hp_thresh: %g, pulse_search: %d\n", h->am_uv_thresh, h->hp_thresh, (int)h->pulse_search); tab(indent); (void) printf("gain_halt: %g, min_coh_len: %d, max_coh_len: %d\n", h->gain_halt, (int) h->min_coh_len, (int) h->max_coh_len); tab(indent); if(idx_ok(h->coh_data,coh_data_codes)) (void) printf("coh_data: %s\n",coh_data_codes[h->coh_data]); else (void) printf("coh_data: invalid code %d\n",(int)h->coh_data); for (i=0; i<PIT_SPARES; i++) if (h->spares[i] != 0) { tab(indent); (void) printf("spares[%d]: 0x%x\n", i,(int) h->spares[i]); } pr_zfunc(indent,"prefilter",h->prefilter); pr_zfunc(indent,"lpf",h->lpf); return;}voidprint_ros(indent, hdr)int indent;struct header *hdr;{ int i,order; struct ros_header *h = hdr->hd.ros; printf("\n"); tab(indent); (void) printf("---Rosetta Speech Frame (ROS) Header---\n"); tab(indent); (void) printf("start: %ld, order_vcd: %d, order_unvcd: %d, ", h->start,h->order_vcd,h->order_unvcd); tab(indent); if(idx_ok(h->q_method,quant_methods)) (void) printf("q_method: %s\n",quant_methods[h->q_method]); else (void) printf("q_method: invalid code %d\n",(int)h->q_method); tab(indent); if(idx_ok(h->tf_method,ros_tf_method)) (void) printf("tf_method: %s\n",ros_tf_method[h->tf_method]); else (void) printf("tf_method: invalid code %d\n",(int)h->tf_method); if(idx_ok(h->piq_method,quant_methods)) (void) printf("piq_method: %s\n",quant_methods[h->piq_method]); else (void) printf("piq_method: invalid code %d\n",(int)h->piq_method); tab(indent); if(idx_ok(h->rcq_method,quant_methods)) (void) printf("rcq_method: %s\n",quant_methods[h->rcq_method]); else (void) printf("rcq_method: invalid code %d\n",(int)h->rcq_method); tab(indent); if(idx_ok(h->pwq_method,quant_methods)) (void) printf("pwq_method: %s\n",quant_methods[h->pwq_method]); else (void) printf("pwq_method: invalid code %d\n",(int)h->pwq_method); tab(indent); (void) printf("src_sf: %f, maxtype: %d, maxpulses: %d, maxpow: %d\n", h->src_sf,h->maxtype,h->maxpulses,h->maxpow); tab(indent); (void) printf("rms_fullscale: %g, ",h->rms_fullscale); tab(indent); (void) printf("frmlen_bits: %d\n",h->frmlen_bits); for (i=0; i<ROS_SPARES; i++) if (h->spares[i] != 0) { tab(indent); (void) printf("spares[%d]: 0x%x\n", i,(int) h->spares[i]); } tab(indent); if(h->maxtype != 0) { int j=16; for(i=0; i<h->maxtype; i++) { if(j>9) { tab(indent); (void) printf("\ntype_bits[%d]: ",i); j=0; } (void) printf("%5d",h->type_bits[i]); j++; } } order = h->order_unvcd; if(order != 0) { int j=16; for(i=0; i<order; i++) { if(j>9) { tab(indent); (void) printf("\nrc_ubits[%d]: ",i); j=0; } (void) printf("%5d",h->rc_ubits[i]); j++; } } order = h->order_vcd; if(order != 0) { int j=16; for(i=0; i<order; i++) { if(j>9) { tab(indent); (void) printf("\nrc_vbits[%d]: ",i); j=0; } (void) printf("%5d",h->rc_vbits[i]); j++; } } if(h->maxpulses != 0) { int j=16; for(i=0; i<h->maxpulses; i++) { if(j>9) { tab(indent); (void) printf("\npulse_bits[%d]: ",i); j=0; } (void) printf("%5d",h->pulse_bits[i]); j++; } } if(h->maxpow != 0) { int j=16; for(i=0; i<h->maxpow; i++) { if(j>9) { tab(indent); (void) printf("\npow_bits[%d]: ",i); j=0; } (void) printf("%5d",h->pow_bits[i]); j++; } } (void)printf("\n"); return;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -