| If you look at the pvanal_export.c program the format is reasonably
well explained..... well not really....the following is from pvoc.h
==John ff
PS: Welcome!
========================================================================
#define PVMAGIC 517730 /* look at it upside-down, esp on a 7-seg display */
#define PVDFLTBYTS 4
typedef struct pvstruct
{
long magic; /* magic number to identify */
long headBsize; /* byte offset from start to data */
long dataBsize; /* number of bytes of data */
long dataFormat; /* (int) format specifier */
float samplingRate; /* of original sample */
long channels; /* (int) mono/stereo etc */
long frameSize; /* size of FFT frames (2^n) */
long frameIncr; /* # new samples each frame */
long frameBsize; /* bytes in each file frame */
long frameFormat; /* (int) how words are org'd in frms */
float minFreq; /* freq in Hz of lowest bin (exists) */
float maxFreq; /* freq in Hz of highest (or next) */
long freqFormat; /* (int) flag for log/lin frq */
char info[PVDFLTBYTS]; /* extendable byte area */
} PVSTRUCT;
#define PV_UNK_LEN -1L /* flag if dataBsize unknown in hdr */
/* values for dataFormat field */
#define PVSHORT 2 /* 16 bit linear data */
#define PVLONG 4 /* 32 bit linear data */
#define PVFLOAT (4+32) /* 32 bit float data */
#define PVDOUBLE (8+32) /* 64 bit float data */
/* values for frameFormat field */
#define PVMAG 1 /* magnitude only */
#define PVPHASE 2 /* phase only (!) */
#define PVPOLAR 3 /* mag, phase pairs */
#define PVREAL 4 /* real only */
#define PVIMAG 5 /* imaginary only */
#define PVRECT 6 /* real, imag pairs */
#define PVPVOC 7 /* weirdo mag, phi-dot format for phase vocoder */
#define PVCQ 32 /* ORed with previous to indicate one frame per 8ve */
/* values for freqFormat field */
#define PVLIN 1 /* linearly spaced frequency bins */
#define PVEXP 2 /* exponentially spaced frequency bins */
/* Some handy typedefs (one anyway) */
typedef struct {
float mag, pha;
} cpxpolar; |