Library specenv


[ Keywords | Classes | Data | Functions ]

Quick Index



Classes

Back to the top of specenv


Data

// SPECTRAL ENVELOPE DATA TYPES
typedef enum seScale;
typedef struct seSpecEnv;
typedef struct seFormant;
typedef struct sePreciseFormants;
typedef struct seRegion;
typedef struct seFuzzyFormants;
// FILE HANDLING
typedef enum seFileType;
typedef enum seFileMode;
typedef enum seFileAction;
typedef struct seFile;
// PARAMETERS
typedef enum seEstimationType;
typedef struct seDcepEstimation;
typedef enum seWindowType;
typedef struct seLpcEstimation;
typedef struct seFilterParameters;
typedef enum seIoFlags;
typedef struct seSpecEnvIO;
typedef enum seParaDefaultType;
// BASIC TYPE DEFINITIONS
typedef enum Boolean;
typedef enum seReturn;
typedef float Frequency;
typedef float Amplitude;
typedef float Phase;
typedef double Time;
// ERROR and MESSAGE HANDLING
typedef enum seErrorBehaviour;
typedef enum seMessageLevel;

Back to the top of specenv


Global Functions

// Allocation and Deallocation of Spectral Envelopes
seReturn seNewSpecEnv (seSpecEnv **env, int num, Frequency sr, seScale sc, Frequency bf);
seReturn seNewSpecEnvLike (seSpecEnv **env, seSpecEnv *envfrom);
seReturn seDeleteSpecEnv (seSpecEnv **env);
seReturn seReallocSpecEnv (seSpecEnv *env, int newnum);
// ACCESS and MANIPULATION
seReturn seSpecEnvCopy (seSpecEnv *from, seSpecEnv *to);
seReturn seSpecEnvConst (seSpecEnv *env, Amplitude ampl);
Amplitude seAtFreq (seSpecEnv *env, Frequency freq);
double seSpecEnvSum (seSpecEnv *env);
seReturn seResample (seSpecEnv *env1, seSpecEnv *env2);
// FILE HANDLING
seReturn seOpenFile (seFile *file);
seReturn seCloseFile (seFile *file);
seReturn seGuessFile (seFile *file);
seFileType seLookupType (const char *string);
seReturn seSetFile (seFile *f, const char *name, seFileType type, seFileMode mode);
// ESTIMATION PARAMETERS
seReturn seGetEstimationPara (seFile *infile, seDcepEstimation *out);
seReturn seGetDefaultDcepEstimation (seDcepEstimation *para, seParaDefaultType pdt);
seReturn sePrintDcepEstimationPara (seDcepEstimation *p, const char *source);
seReturn seGetDcepEstimationPara (seFile *infile, seDcepEstimation *out);
seReturn seGetDefaultLpcEstimation (seLpcEstimation *para, seParaDefaultType pdt);
seReturn sePrintLpcEstimationPara (seLpcEstimation *p, const char *source);
seReturn seGetLpcEstimationPara (seFile *infile, seLpcEstimation *out);
seReturn sePrintEstimationPara (seSpecEnvIO *p, const char *source);
seEstimationType seLoadEstimationPara (const char *fname, seDcepEstimation *dceppara, seLpcEstimation *lpcpara);
seReturn seReturnFromBool (Boolean boo);
Boolean seReturnToBool (seReturn status);
// ERROR and MESSAGE HANDLING
seReturn seInit ();
seReturn seDeInit ();
seReturn seSetError (seReturn stat, char *file, int line);
seReturn seGetError ();
seReturn seSetErrorLogFile (char *filename);
seReturn seSetErrorBehaviour (seErrorBehaviour flags);
seErrorBehaviour seGetErrorBehaviour ();
seReturn seSetMessageLevel (seMessageLevel msglev);
void db (seMessageLevel dblev, char *format, ...);
void sePrint (seMessageLevel dblev, char *format, ...);
void seMessage (seMessageLevel dblev, char *f1, char *f2, ...);
seReturn seClearError ();
void seErrorReturn (char *msg, ANYTYPE arg);
void seErrorReturn2 (char *msg1, char *msg2, ANYTYPE arg);
void seCheckStatus (char *msg, ANYTYPE arg);
void seRequire (Boolean action, char *message, ANYTYPE arg);
void seCheck (Boolean action, char *msg, ANYTYPE arg);
// UTILITY MACROS
int sectosamp (Time sec, float sr);
Time samptosec (int samp, float sr);
void New (type *obj, TYPE type);
void NewArray (type *arr, TYPE type, int num);
ANYTYPE min (ANYTYPE a, ANYTYPE b);
ANYTYPE max (ANYTYPE a, ANYTYPE b);
ANYTYPE limit (ANYTYPE a, ANYTYPE x, ANYTYPE b);
// UTILITY FUNCTIONS
char *itoa (int i);
char *ftoa (float f);
char *strtoNV (char *string_with_spaces);
char *machine (int flags);
int seSearchStringInList (const char *str, const char **list, int num);
seReturn seScanNumberOrBpf ( const char *str, float *num, PmBreakPoint *bpf);
// TIME FUNCTIONS
void seBeginTime (char *msg);
void sePrintTimeNum (float out_time, int number);
void seEndTime ();
// P A R T I A L S
seReturn sePartialsToEnvInit (seDcepEstimation *p);
seReturn sePartialsToEnvDeInit (seDcepEstimation *p);
seReturn sePartialsToEnv ( seDcepEstimation *p, seSpecEnv *env);
// L P C
seReturn seWindow (seWindowType wt, int n, float *win, float *gain);
seReturn seSignalToEnvInit (seLpcEstimation *p);
seReturn seSignalToEnvDeInit (seLpcEstimation *p);
seReturn seSignalToEnv (seLpcEstimation *p, seSpecEnv *env);
// I N T E R P O L A T I O N
Amplitude seInterpolateAtFreq (seSpecEnv *env1, seSpecEnv *env2, float factor, Boolean logscale, Frequency freq);
seReturn seInterpolate (seSpecEnv *env1, seSpecEnv *env2, float factor, Boolean logscal, seSpecEnv *env3);
seReturn seInterpolateTime (seSpecEnv *env1, Time time1, seSpecEnv *env2, Time time2, seSpecEnv *env3, Time time3, Boolean logscale);
// S Y N T H E S I S
seReturn seApplySpecEnv (seSpecEnv *env, PmPartialSet partials);
seReturn seFilterSignalInit (seFilterParameters *p);
seReturn seFilterSignalDeInit (seFilterParameters *p);
seReturn seFilterSignal (seFilterParameters *p, seSpecEnv *env);
// E N V E L O P E I / O
seReturn seWriteEnvInit ( seFile *out, int numio, seSpecEnvIO *iobuf, seIoFlags flags);
seReturn seWriteEnvDeinit( seFile *in, int iomax, seSpecEnvIO *iobuf);
seReturn seWriteEnv ( seFile *out, int numio, seSpecEnvIO *iobuf);
seReturn seReadEnvInit ( seFile *in, int iomax, seSpecEnvIO *iobuf, int *numiopresent, seIoFlags flags);
seReturn seReadEnvDeinit ( seFile *in, int iomax, seSpecEnvIO *iobuf);
seReturn seReadEnv ( seFile *in, int iomax, seSpecEnvIO *iobuf);
seReturn seReadEnvAtTime ( seFile *f, Time time, int iomax, seSpecEnvIO *iobuf);

Back to the top of specenv


typedef enum seScale;

#include "seclasses.h"

Frequency scaling of estimation

typedef enum { seScLinear, seScLog, seScNum }	seScale;

Back to the top of specenv


typedef struct seSpecEnv;

#include "seclasses.h"

Spectral envelope data structure

typedef struct 
{
    Frequency  	maxfreq;   /* upper border of env (maxfreq = sampling rate/2 */
    int	    	numenv;	   /* number of points in envelope */
    Amplitude  	*env;	   /* numenv spectral envelope amplitude values */
    
    Frequency	fstep;	   /* size of bin in env  (fstep = sr / numenv) */
    seScale 	scale;	   /* frequency scale for storage */
    Frequency	breakfreq; /* break frequency for log scale */
}   seSpecEnv;

Back to the top of specenv


typedef struct seFormant;

#include "seclasses.h"

Spectral envelope data structure

typedef struct 
{
    Frequency	centerfreq;
    Amplitude	amplitude;
    Frequency	bandwidth;
}   seFormant;

Back to the top of specenv


typedef struct sePreciseFormants;

#include "seclasses.h"

Precise formants data structure

typedef struct 
{
    int		numformants;	/* number of precise formants */
    seFormant	*formant;	/* numformants precise formants */
    seSpecEnv	residual;	/* residual spectral envelope */
}   sePreciseFormants;

Back to the top of specenv


typedef struct seRegion;

#include "seclasses.h"

Formant region data structure

typedef struct 
{
    Frequency	lower, center, upper;	/* region boundary frequencies (Hz) */
    float	salience;		/* how sure we are it is a formant */
}   seRegion;

Back to the top of specenv


typedef struct seFuzzyFormants;

#include "seclasses.h"

Fuzzy formant data structure

typedef struct 
{
    int		numregions;	/* number of precise formants */
    seRegion	*region;	/* numformants precise formants */
    seSpecEnv	specenv;	/* spectral envelope */
}   seFuzzyFormants;

Back to the top of specenv


seReturn seNewSpecEnv (seSpecEnv **env, int num, Frequency sr, seScale sc, Frequency bf);

#include "seclasses.h"

Create new spectral envelope in env.

in num
number of bins sr sampling rate, highest bin frequency is sr / 2 sc frequency scale bf break frequency in case of logarithmic scale
out env
address of specenv pointer(!). Will be set to NULL if something goes wrong. Call like this:

	seSpecEnv *env;
	seNewSpecEnv (&env, 512, 44100, seScLog, 5000);
  

seReturn  seNewSpecEnv     (seSpecEnv **env, int num, Frequency sr, 
			    seScale sc, Frequency bf);

Back to the top of specenv


seReturn seNewSpecEnvLike (seSpecEnv **env, seSpecEnv *envfrom);

#include "seclasses.h"

Create new spectral envelope in env with same parameters as envfrom.

out env
address of specenv pointer(!). Will be set to NULL if something goes wrong.
in envfrom
model spectral envelope

seReturn  seNewSpecEnvLike (seSpecEnv **env, seSpecEnv *envfrom);

Back to the top of specenv


seReturn seDeleteSpecEnv (seSpecEnv **env);

#include "seclasses.h"

Free spectral envelope

seReturn  seDeleteSpecEnv  (seSpecEnv **env);

Back to the top of specenv


seReturn seReallocSpecEnv (seSpecEnv *env, int newnum);

#include "seclasses.h"

Unconditionally reallocate storage for newnum bins.

seReturn  seReallocSpecEnv (seSpecEnv *env, int newnum);

Back to the top of specenv


seReturn seSpecEnvCopy (seSpecEnv *from, seSpecEnv *to);

#include "seclasses.h"

Copy spectral envelope data (check for same size if DEBUG)

seReturn  seSpecEnvCopy    (seSpecEnv *from, seSpecEnv *to);

Back to the top of specenv


seReturn seSpecEnvConst (seSpecEnv *env, Amplitude ampl);

#include "seclasses.h"

Set all bins of env to constant value ampl.

seReturn  seSpecEnvConst   (seSpecEnv *env, Amplitude ampl);

Back to the top of specenv


Amplitude seAtFreq (seSpecEnv *env, Frequency freq);

#include "seclasses.h"

Get (possibly interpolated) value of env at arbitrary frequency freq. For frequencies greater than maxfreq, quickly fade out the envelope, since it is not defined there.

Amplitude seAtFreq	  (seSpecEnv *env, Frequency freq);

Back to the top of specenv


double seSpecEnvSum (seSpecEnv *env);

#include "seclasses.h"

Return sum of all bins of env.

double    seSpecEnvSum	  (seSpecEnv *env);

Back to the top of specenv


seReturn seResample (seSpecEnv *env1, seSpecEnv *env2);

#include "seclasses.h"

Stretch env1 to env2 according to the parameters of env2 (numenv). Maxfreq will be copied from env1. Env2 must have been properly allocated with seNewSpecEnv.

seReturn  seResample	  (seSpecEnv *env1, seSpecEnv *env2);

Back to the top of specenv


typedef enum seFileType;

#include "sefiles.h"

File types known to the spectral envelope library

typedef enum 
{
    /* sound data */
    seFtSignal		= 0, 
    seFtSpectrum	= 1, 
    seFtPartialsBin	= 2,
    seFtPartialsAscii	= 3,

    /* envelopes (representation) */
    seFtEnvAscii	= 4,
    seFtEnvSdif		= 5,
    seFtEnvSvp		= 6,		/* SuperVP style binary envelopes */

    /* break-point-function */
    seFtBpf		= 7,

    /* images */
    seFtPgm		= 8,
    seFtJpeg		= 9,

    /* others */
    seFtGzip		= 10,
    seFtUnknown		= 11, /* seFtUnknown MUST be 3rd to last */

    /* actions for seSetFile */
    seFtGuess		= 12, /* guess file type from extension */

    seFtNum		= 13, /* seFtNum MUST be last in numbered list */

    /* bits to be or'ed with above numbered values */
    seFtGuessDefault	= 16, /* If type == x | seFtGuessDefault,
				 guess file type from extension.  If unknown,
				 take type x */
}   seFileType;

Back to the top of specenv


typedef enum seFileMode;

#include "sefiles.h"

File access modes

typedef enum { seFmRead, seFmWrite, seFmNum }  seFileMode;

Back to the top of specenv


typedef enum seFileAction;

#include "sefiles.h"

Read/Write Actions (unused?)

typedef enum { seFaBegin, seFaFrame, seFaEnd } seFileAction;

Back to the top of specenv


typedef struct seFile;

#include "sefiles.h"

File parameter structure where all information about a file is gathered

typedef struct
{
    const char	*name;
    const char	*realname;	/* Always contains a printable string */
    seFileType	type;
    seFileMode	mode;
    Boolean	compressed;
    FILE	*file;
    SdifFileT	*SDIF;
    Boolean	frameheaderread;
    Boolean	eof;
}   seFile;

Back to the top of specenv


seReturn seOpenFile (seFile *file);

#include "sefiles.h"

Open file, parameters given in file structure. Automatically handles gzip compression.

seReturn seOpenFile  (seFile *file);

Back to the top of specenv


seReturn seCloseFile (seFile *file);

#include "sefiles.h"

Close file

seReturn seCloseFile (seFile *file);

Back to the top of specenv


seReturn seGuessFile (seFile *file);

#include "sefiles.h"

Guess file type and compression from name.

in file->name
out file->type
file->compressed

seReturn seGuessFile (seFile *file);

Back to the top of specenv


seFileType seLookupType (const char *string);

#include "sefiles.h"

Lookup file type matching extension string, return seFtUnknown if none found.

seFileType seLookupType (const char *string);

Back to the top of specenv


seReturn seSetFile (seFile *f, const char *name, seFileType type, seFileMode mode);

#include "sefiles.h"

Initialise file structure f. If type is seFtGuess, guess file type from extension

seReturn seSetFile   (seFile *f, const char *name, seFileType type, 
		      seFileMode mode);

Back to the top of specenv


typedef enum seEstimationType;

#include "separa.h"

Estimation method and spectral envelope type

typedef enum { seEtNone     = 0, 
	       seEtDcep     = 1, 
	       seEtFreq     = 2, 
	       seEtPhase    = 3, 
	       seEtLpc      = 4, 
	       seEtGeneric  = 5,
	       seEtNum		/* seEtNum MUST be last */
} seEstimationType;

Back to the top of specenv


typedef struct seDcepEstimation;

#include "separa.h"

Discrete cepstrum parameter structure

typedef struct 
{
    /* in */
    seEstimationType type;
    Frequency	sr;		/* sampling rate f_s */
    int		numenv;		/* number of points for envelope */
    int	    	order;
    float   	regfact;	/* regularization factor */
    int	    	cloud;		/* use cloud smoothing */
    float   	safetymargin;   /* margin factor for border points */
    seScale 	scale;		/* frequency scale */
    Frequency	breakfreq;	/* break frequency for log scale */
    int	    	debuglevel;
    
    /* computed by init */
    float   	freq_shift;
    float   	ampl_factor;
    
    /* from input file */
    int	    	maxpartials;  	/* number of partials to allocate */
    int	    	numpartials;  	/* number of partials present */
    Frequency   *freq;	      	/* partial frequencies for amp and freq env */
    Amplitude	*ampl;	      	/* partial amplitudes for amp env */
    Phase	*phase;	      	/* partial phases for phase env */
      
    /* out */  
    float   	*coef;		/* cepstral coefficients */
    Time	time;		/* input time in processed file */
    int		streamid;	/* stream ID for SDIF file */
}   seDcepEstimation;

Back to the top of specenv


typedef enum seWindowType;

#include "separa.h"

Window type for LPC

typedef enum { seWtRectangle, seWtHamming, 
	       seWtHanning, seWtBlackman, seWtNum }	seWindowType;

Back to the top of specenv


typedef struct seLpcEstimation;

#include "separa.h"

LPC parameter structure

typedef struct 
{
    /* in */
    Frequency	sr;		  /* sampling rate f_s */
    int		numenv;		  /* number of points for envelope */
    int	    	order;
    float   	*signal;	  /* winsize samples */
    int	    	winsize;
    seWindowType wintype;
    int	    	debuglevel;
    
    /* init */
    float   	*window;    
    float   	winfactor;
    
    
    /* out */  
    float   	gain;
    float   	*a, *k, *r;	  /* lpc coefficients (number = order) */
    Time	time;		  /* input time in processed file */
    int		streamid;	  /* stream ID for SDIF file */
}   seLpcEstimation;

Back to the top of specenv


typedef struct seFilterParameters;

#include "separa.h"

Filter parameter structure

typedef struct
{
    Time	time;		  /* input time in processed file */
    Frequency   sr;
    int		winsize;
    float	*inbuf, *outbuf;  /* may point to the same memory */
    seSpecEnv	*trans;		  /* transfer function =
				     input env stretched to winsize */
    int	    	debuglevel;

    UDI_object	fftweights;
    UDI_object	zero, one;
    UDI_object	compfilter;
    UDI_object	realfilter;
    UDI_object	compsignal;
    UDI_object	realsignal;
} seFilterParameters;

Back to the top of specenv


typedef enum seIoFlags;

#include "separa.h"

Flags for seReadEnvInit

typedef enum { seIoNone		= 0, 
	       seIoAutoOpen	= 1,
	       seIoAutoAlloc	= 2,
	       seIoInterpolate	= 4,
	       seIoBuffer	= 8,
} seIoFlags;

Back to the top of specenv


typedef struct seSpecEnvIO;

#include "separa.h"

Structure for file I/O

typedef struct
{
    int			streamid;
    Time		time;
    seSpecEnv		*env;	     /* must be allocated for seReadEnvInit, 
					or seIoAutoAlloc must be set */
    Boolean		present;
    seIoFlags		flags;

    seEstimationType	type;
    seDcepEstimation	dcep;	     /* only one of dcep or lpc is valid, */
    seLpcEstimation	lpc;	     /* according to type */

    seSpecEnv		*last,    *current;	/* for interpolated reading */
    Time		lasttime, curtime;	/* times of above envs */
} seSpecEnvIO;

Back to the top of specenv


typedef enum seParaDefaultType;

#include "separa.h"

Default parameters (so far, there's only one type of default)

typedef enum { sePdtDefault, sePdtNum } seParaDefaultType;

Back to the top of specenv


seReturn seGetEstimationPara (seFile *infile, seDcepEstimation *out);

#include "separa.h"

Get general estimation parameters from file infile.

seReturn seGetEstimationPara        (seFile *infile,    seDcepEstimation *out);

Back to the top of specenv


seReturn seGetDefaultDcepEstimation (seDcepEstimation *para, seParaDefaultType pdt);

#include "separa.h"

Set para to default estimation parameters.

seReturn seGetDefaultDcepEstimation (seDcepEstimation *para, 
				     seParaDefaultType pdt);

Back to the top of specenv


seReturn sePrintDcepEstimationPara (seDcepEstimation *p, const char *source);

#include "separa.h"

Print discrete cepstrum estimation parameters.

in source
file name is just for printing

seReturn sePrintDcepEstimationPara  (seDcepEstimation *p, const char *source);

Back to the top of specenv


seReturn seGetDcepEstimationPara (seFile *infile, seDcepEstimation *out);

#include "separa.h"

Get discrete cepstrum estimation parameters from file infile.

seReturn seGetDcepEstimationPara    (seFile *infile,    seDcepEstimation *out);

Back to the top of specenv


seReturn seGetDefaultLpcEstimation (seLpcEstimation *para, seParaDefaultType pdt);

#include "separa.h"

Set para to default estimation parameters.

seReturn seGetDefaultLpcEstimation  (seLpcEstimation *para, 
				     seParaDefaultType pdt);

Back to the top of specenv


seReturn sePrintLpcEstimationPara (seLpcEstimation *p, const char *source);

#include "separa.h"

Print LPC estimation parameters.

in source
file name is just for printing

seReturn sePrintLpcEstimationPara   (seLpcEstimation *p, const char *source);

Back to the top of specenv


seReturn seGetLpcEstimationPara (seFile *infile, seLpcEstimation *out);

#include "separa.h"

Get general estimation parameters from file infile.

seReturn seGetLpcEstimationPara     (seFile *infile,    seLpcEstimation *out);

Back to the top of specenv


seReturn sePrintEstimationPara (seSpecEnvIO *p, const char *source);

#include "separa.h"

Print general estimation parameters.

in source
file name is just for printing

seReturn sePrintEstimationPara      (seSpecEnvIO *p, const char *source);

Back to the top of specenv


seEstimationType seLoadEstimationPara (const char *fname, seDcepEstimation *dceppara, seLpcEstimation *lpcpara);

#include "separa.h"

Load estimation parameters from file given by fname.

return estimation-types
found

seEstimationType seLoadEstimationPara (const char *fname, 
				       seDcepEstimation *dceppara, 
				       seLpcEstimation  *lpcpara);

Back to the top of specenv


typedef enum Boolean;

#include "seutil.h"

A boolean type.

Danger: bool seems to be a C++ standard type of pointer size (i.e. on alphas 8 bytes to store 1 bit!) and true and false are reserved words. --> we can't define enum { false, true } bool, but will define Boolean and reuse false and true from C++.

typedef enum { seFalse, seTrue }  Boolean;

Back to the top of specenv


typedef enum seReturn;

#include "seutil.h"

Status type to be returned by all se-Functions

typedef enum { seError, seOK }  seReturn;

Back to the top of specenv


seReturn seReturnFromBool (Boolean boo);

#include "seutil.h"

Convert boolean to status type

seReturn seReturnFromBool (Boolean boo);

Back to the top of specenv


Boolean seReturnToBool (seReturn status);

#include "seutil.h"

Convert status type to boolean

Boolean seReturnToBool (seReturn status);

Back to the top of specenv


typedef float Frequency;

#include "seutil.h"

Type alias for float to improve readability of the code

typedef float			Frequency;

Back to the top of specenv


typedef float Amplitude;

#include "seutil.h"

Type alias for float to improve readability of the code

typedef float			Amplitude;

Back to the top of specenv


typedef float Phase;

#include "seutil.h"

Type alias for float to improve readability of the code

typedef float			Phase;

Back to the top of specenv


typedef double Time;

#include "seutil.h"

Type alias for float to improve readability of the code

typedef double			Time;

Back to the top of specenv


typedef enum seErrorBehaviour;

#include "seutil.h"

Error behaviour flags

typedef enum { seEbNone = 0, seEbAbort = 1, 
	       seEbLog  = 2, seEbPrint = 4,
	       seEbNorm = seEbLog | seEbPrint,
	       seEbFull = seEbAbort | seEbLog | seEbPrint  /* default */
} seErrorBehaviour;

Back to the top of specenv


typedef enum seMessageLevel;

#include "seutil.h"

seMessageLevel specifies the threshold for messages to be printed. Any db call with dblev above the current debug level (set with seSetMessageLevel) will not print anything. (This is the (only) exception of the enum member naming convention, for the sake of shortness.)

typedef enum { db0, dbQuiet = db0,	/* nothing */
	       db1, dbError = db1,	/* error messages */
	       db2, dbWarn  = db2,	/* warning messages */
	       db3, dbMsg   = db3,	/* important messages (default) */
	       db4, dbInfo  = db4,	/* informational messages */
	       db5, dbVerb  = db5,	/* verbose information */
	       db6,			/* light debugging */
	       db7,			/* normal debugging */
	       db8,			/* heavy debugging */
	       db9,			/* you must be desperate */
	       dbNum /* number of message levels, MUST be last one */
} seMessageLevel;	

Back to the top of specenv


seReturn seInit ();

#include "seutil.h"

Initialise spectral envelope library

seReturn	 seInit ();

Back to the top of specenv


seReturn seDeInit ();

#include "seutil.h"

Deinitialise spectral envelope library

seReturn	 seDeInit ();

Back to the top of specenv


seReturn seSetError (seReturn stat, char *file, int line);

#include "seutil.h"

Set error flag

seReturn	 seSetError	     (seReturn stat, char *file, int line);

Back to the top of specenv


seReturn seGetError ();

#include "seutil.h"

Return last error status

seReturn	 seGetError	     ();

Back to the top of specenv


seReturn seSetErrorLogFile (char *filename);

#include "seutil.h"

Set error log file

seReturn	 seSetErrorLogFile   (char *filename);

Back to the top of specenv


seReturn seSetErrorBehaviour (seErrorBehaviour flags);

#include "seutil.h"

Set error behaviour

seReturn	 seSetErrorBehaviour (seErrorBehaviour flags);

Back to the top of specenv


seErrorBehaviour seGetErrorBehaviour ();

#include "seutil.h"

Get error behaviour

seErrorBehaviour seGetErrorBehaviour ();

Back to the top of specenv


seReturn seSetMessageLevel (seMessageLevel msglev);

#include "seutil.h"

Set reporting level

seReturn	 seSetMessageLevel (seMessageLevel msglev);

Back to the top of specenv


void db (seMessageLevel dblev, char *format, ...);

#include "seutil.h"

Debug output. (Note that db calls will vanish when compiling for release version!)

void 		 db	   (seMessageLevel dblev, char *format, ...);

Back to the top of specenv


void sePrint (seMessageLevel dblev, char *format, ...);

#include "seutil.h"

Print message, according to message level.

void 		 sePrint   (seMessageLevel dblev, char *format, ...);

Back to the top of specenv


void seMessage (seMessageLevel dblev, char *f1, char *f2, ...);

#include "seutil.h"

Print error message, file and line must have been set by seSetError before. f1 is the detailed message for the log file, f2 the brief message for stderr, both are used as formats for printf with the same arguments

void 		 seMessage (seMessageLevel dblev, char *f1, char *f2, ...);

Back to the top of specenv


seReturn seClearError ();

#include "seutil.h"

Clear error flag

seReturn seClearError ();

Back to the top of specenv


void seErrorReturn (char *msg, ANYTYPE arg);

#include "seutil.h"

Return from function with status seError, printing error message msg with printf argument arg

void seErrorReturn (char *msg, ANYTYPE arg);

Back to the top of specenv


void seErrorReturn2 (char *msg1, char *msg2, ANYTYPE arg);

#include "seutil.h"

Return from function with status seError, printing error messages msg1 and msg2 with printf argument arg.

in msg1
is detailed error message for log file, msg2 is for stderr

void seErrorReturn2 (char *msg1, char *msg2, ANYTYPE arg);

Back to the top of specenv


void seCheckStatus (char *msg, ANYTYPE arg);

#include "seutil.h"

If error flag is set, return from function with status seError, printing error message msg with printf argument arg

void seCheckStatus (char *msg, ANYTYPE arg);

Back to the top of specenv


void seRequire (Boolean action, char *message, ANYTYPE arg);

#include "seutil.h"

Evaluate expression action, if it returns false, return from function with status seError, printing error message message with printf argument arg

void seRequire (Boolean action, char *message, ANYTYPE arg);

Back to the top of specenv


void seCheck (Boolean action, char *msg, ANYTYPE arg);

#include "seutil.h"

Evaluate expression action, if it doesn't returns seOK, return from function with status seError, printing error message message with printf argument arg

void seCheck (Boolean action, char *msg, ANYTYPE arg);

Back to the top of specenv


int sectosamp (Time sec, float sr);

#include "seutil.h"

Convert seconds to number of samples according to sample rate sr.

int sectosamp (Time sec, float sr);

Back to the top of specenv


Time samptosec (int samp, float sr);

#include "seutil.h"

Convert number of samples to seconds according to sample rate sr.

Time samptosec (int samp, float sr);

Back to the top of specenv


void New (type *obj, TYPE type);

#include "seutil.h"

Allocation of one object of type type with check and seErrorReturn.

out obj
pointer to newly created object

void New (type *obj, TYPE type);

Back to the top of specenv


void NewArray (type *arr, TYPE type, int num);

#include "seutil.h"

Allocation of num objects of type type with check and seErrorReturn.

out arr
pointer to newly created objects

void NewArray (type *arr, TYPE type, int num);

Back to the top of specenv


ANYTYPE min (ANYTYPE a, ANYTYPE b);

#include "seutil.h"

(There's no standard place for min/max, so we define them once more.) Min of two expressions (possibly evaluated twice!).

ANYTYPE min (ANYTYPE a, ANYTYPE b);

Back to the top of specenv


ANYTYPE max (ANYTYPE a, ANYTYPE b);

#include "seutil.h"

(There's no standard place for min/max, so we define them once more.) Max of two expressions (possibly evaluated twice!).

ANYTYPE max (ANYTYPE a, ANYTYPE b);

Back to the top of specenv


ANYTYPE limit (ANYTYPE a, ANYTYPE x, ANYTYPE b);

#include "seutil.h"

Limit expression x at to be within range a, b.

ANYTYPE limit (ANYTYPE a, ANYTYPE x,  ANYTYPE b);

Back to the top of specenv


char *itoa (int i);

#include "seutil.h"

Integer to string

return
static string memory

char *itoa (int i);

Back to the top of specenv


char *ftoa (float f);

#include "seutil.h"

Float to string

return
static string memory

char *ftoa (float f);

Back to the top of specenv


char *strtoNV (char *string_with_spaces);

#include "seutil.h"

superseded by SdifStringToNV!!! changes str!

char *strtoNV (char *string_with_spaces);

Back to the top of specenv


char *machine (int flags);

#include "seutil.h"

Return output of uname() system function.

char *machine (int flags);

Back to the top of specenv


int seSearchStringInList (const char *str, const char **list, int num);

#include "seutil.h"

Return index of str in list of strings of length num, num if not found

int  seSearchStringInList (const char *str, const char **list, int num);

Back to the top of specenv


seReturn seScanNumberOrBpf ( const char *str, float *num, PmBreakPoint *bpf);

#include "seutil.h"

superseded by PmLoadBreakPointOrConst!!!

seReturn seScanNumberOrBpf (/*in */ const char *str, 
			    /*out*/ float *num, PmBreakPoint *bpf);

Back to the top of specenv


void seBeginTime (char *msg);

#include "seutil.h"

Initialise time printing

void seBeginTime (char *msg);

Back to the top of specenv


void sePrintTimeNum (float out_time, int number);

#include "seutil.h"

Print and compute relation between calculation time and real time.

void sePrintTimeNum (float out_time, int number);

Back to the top of specenv


void seEndTime ();

#include "seutil.h"

Deinitialise time printing

void seEndTime ();

Back to the top of specenv


seReturn sePartialsToEnvInit (seDcepEstimation *p);

#include "specenv.h"

Initialise discrete cepstrum estimation

seReturn sePartialsToEnvInit   (seDcepEstimation *p);

Back to the top of specenv


seReturn sePartialsToEnvDeInit (seDcepEstimation *p);

#include "specenv.h"

Deinitialise discrete cepstrum estimation

seReturn sePartialsToEnvDeInit (seDcepEstimation *p);

Back to the top of specenv


seReturn sePartialsToEnv ( seDcepEstimation *p, seSpecEnv *env);

#include "specenv.h"

Perform discrete cepstrum estimation

seReturn sePartialsToEnv       (/*in */ seDcepEstimation *p, 
				/*out*/ seSpecEnv *env);

Back to the top of specenv


seReturn seWindow (seWindowType wt, int n, float *win, float *gain);

#include "specenv.h"

Compute standard weighting windows

in wt
window type n length of window
out win
float vector [0 .. (n-1)] containing the window gain window factor 2 / sum (win)

seReturn seWindow (seWindowType wt, int n, float *win, float *gain);

Back to the top of specenv


seReturn seSignalToEnvInit (seLpcEstimation *p);

#include "specenv.h"

Initialise LPC spectral envelope estimation

seReturn seSignalToEnvInit    (seLpcEstimation *p);

Back to the top of specenv


seReturn seSignalToEnvDeInit (seLpcEstimation *p);

#include "specenv.h"

Deinitialise LPC spectral envelope estimation

seReturn seSignalToEnvDeInit  (seLpcEstimation *p);

Back to the top of specenv


seReturn seSignalToEnv (seLpcEstimation *p, seSpecEnv *env);

#include "specenv.h"

Perform LPC spectral envelope estimation

seReturn seSignalToEnv        (seLpcEstimation *p, seSpecEnv *env);

Back to the top of specenv


Amplitude seInterpolateAtFreq (seSpecEnv *env1, seSpecEnv *env2, float factor, Boolean logscale, Frequency freq);

#include "specenv.h"

Return amplitude value at freq, interpolated between env1 and env2 according to given interpolation factor:

factor = 0 -> result = env1 factor = 1 -> result = env2 factor = x -> result = env1 * (1 - x) + env2 * x

logscale switches from linear to logarithmic interpolation

Amplitude seInterpolateAtFreq (seSpecEnv *env1, seSpecEnv *env2, 
			       float factor, Boolean logscale, Frequency freq);

Back to the top of specenv


seReturn seInterpolate (seSpecEnv *env1, seSpecEnv *env2, float factor, Boolean logscal, seSpecEnv *env3);

#include "specenv.h"

Set env3 to spectral envelope interpolated between env1 and env2 according to given interpolation factor. Env3 must have been properly allocated with seNewSpecEnv. The numenv of env3 is kept, maxfreq is set to the maximum of env1 and env2.

factor = 0 -> env3 = env1 factor = 1 -> env3 = env2 factor = x -> env3 = env1 * (1 - x) + env2 * x

logscale switches from linear to logarithmic interpolation

seReturn seInterpolate	      (seSpecEnv *env1, seSpecEnv *env2, 
			       float factor, Boolean logscal, seSpecEnv *env3);

Back to the top of specenv


seReturn seInterpolateTime (seSpecEnv *env1, Time time1, seSpecEnv *env2, Time time2, seSpecEnv *env3, Time time3, Boolean logscale);

#include "specenv.h"

Return crossfade of env1 and env2, given at time1 and time2, at time3. logscale switches from linear to logarithmic interpolation.

seReturn seInterpolateTime    (seSpecEnv *env1, Time time1,
			       seSpecEnv *env2, Time time2,
			       seSpecEnv *env3, Time time3, Boolean logscale);

Back to the top of specenv


seReturn seApplySpecEnv (seSpecEnv *env, PmPartialSet partials);

#include "specenv.h"

Frequency domain filtering for partial data from additive synthesis.

seReturn seApplySpecEnv       (seSpecEnv *env, PmPartialSet partials);

Back to the top of specenv


seReturn seFilterSignalInit (seFilterParameters *p);

#include "specenv.h"

Initialise frequency domain filtering for signals.

seReturn seFilterSignalInit   (seFilterParameters *p);

Back to the top of specenv


seReturn seFilterSignalDeInit (seFilterParameters *p);

#include "specenv.h"

Deinitialise frequency domain filtering for signals.

seReturn seFilterSignalDeInit (seFilterParameters *p);

Back to the top of specenv


seReturn seFilterSignal (seFilterParameters *p, seSpecEnv *env);

#include "specenv.h"

Perform frequency domain filtering for signals.

seReturn seFilterSignal       (seFilterParameters *p, seSpecEnv *env);

Back to the top of specenv


seReturn seWriteEnvInit ( seFile *out, int numio, seSpecEnvIO *iobuf, seIoFlags flags);

#include "specenv.h"

Initialise writing spectral envelopes.

in in
file to read from numio gives the number of seSpecEnvIO blocks at address iobuf iobuf contains numio i/o specifications to be written flags control flags

seReturn seWriteEnvInit  (/*in */ seFile	*out, 
			  /*in */ int		numio, 
			  /*in */ seSpecEnvIO	*iobuf,
			  /*in */ seIoFlags	flags);

Back to the top of specenv


seReturn seWriteEnvDeinit( seFile *in, int iomax, seSpecEnvIO *iobuf);

#include "specenv.h"

Deinitialise writing spectral envelopes.

seReturn seWriteEnvDeinit(/*in */ seFile	*in,
			  /*in */ int		iomax,
			  /*in */ seSpecEnvIO	*iobuf);

Back to the top of specenv


seReturn seWriteEnv ( seFile *out, int numio, seSpecEnvIO *iobuf);

#include "specenv.h"

Write spectral envelopes in ASCII or format.

seReturn seWriteEnv      (/*in */ seFile	*out, 
			  /*in */ int		numio, 
			  /*in */ seSpecEnvIO	*iobuf);

Back to the top of specenv


seReturn seReadEnvInit ( seFile *in, int iomax, seSpecEnvIO *iobuf, int *numiopresent, seIoFlags flags);

#include "specenv.h"

Initialise reading spectral envelopes.

in in
file to read from numio gives the number of seSpecEnvIO blocks at address iobuf flags control flags
out iobuf
contains numio i/o specifications to be written numiopresent pointer to integer receiving the number of iobuf actually read

seReturn seReadEnvInit 	 (/*in */ seFile	*in,
			  /*in */ int		iomax,
			  /*out*/ seSpecEnvIO	*iobuf,
			  /*out*/ int		*numiopresent,
			  /*in */ seIoFlags	flags);

Back to the top of specenv


seReturn seReadEnvDeinit ( seFile *in, int iomax, seSpecEnvIO *iobuf);

#include "specenv.h"

Deinitialise reading spectral envelopes.

seReturn seReadEnvDeinit (/*in */ seFile	*in,
			  /*in */ int		iomax,
			  /*in */ seSpecEnvIO	*iobuf);

Back to the top of specenv


seReturn seReadEnv ( seFile *in, int iomax, seSpecEnvIO *iobuf);

#include "specenv.h"

Read spectral envelope frame types from at most iomax streams. seReadEnv returns when iomax frames are read or when a stream id which has already been read is encountered. Whether a stream was actually read or not is returned in the present flag of iobuf. On eof, seError is returned (without printing a message).

seReturn seReadEnv     	 (/*in */ seFile	*in,
			  /*in */ int		iomax,  
			  /*out*/ seSpecEnvIO	*iobuf);

Back to the top of specenv


seReturn seReadEnvAtTime ( seFile *f, Time time, int iomax, seSpecEnvIO *iobuf);

#include "specenv.h"

Read envelope frame from file if time is greater than the last frame's time. If not, return last frame.

If interpolate flag is set in iobuf, returns env interpolated between last and next frame.

seReturn seReadEnvAtTime (/*in */ seFile	*f,
			  /*in */ Time		time,
			  /*in */ int		iomax,  
			  /*out*/ seSpecEnvIO	*iobuf);

Back to the top of specenv


Generated from source by the Cocoon utilities on Thu Feb 24 17:00:58 2000 .

Report problems to jkotula@stratasys.com