| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
#ifndef __PSTREAM_H_INCLUDED |
| 25 |
#define __PSTREAM_H_INCLUDED |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
enum PVS_WINTYPE { |
| 79 |
PVS_WIN_HAMMING = 0, |
| 80 |
PVS_WIN_HANN, |
| 81 |
PVS_WIN_KAISER, |
| 82 |
PVS_WIN_CUSTOM, |
| 83 |
PVS_WIN_BLACKMAN, |
| 84 |
PVS_WIN_BLACKMAN_EXACT, |
| 85 |
PVS_WIN_NUTTALLC3, |
| 86 |
PVS_WIN_BHARRIS_3, |
| 87 |
PVS_WIN_BHARRIS_MIN, |
| 88 |
PVS_WIN_RECT |
| 89 |
}; |
| 90 |
|
| 91 |
|
| 92 |
enum PVS_ANALFORMAT { |
| 93 |
PVS_AMP_FREQ = 0, |
| 94 |
PVS_AMP_PHASE, |
| 95 |
PVS_COMPLEX, |
| 96 |
PVS_TRACKS |
| 97 |
}; |
| 98 |
|
| 99 |
typedef struct { |
| 100 |
MYFLT re; |
| 101 |
MYFLT im; |
| 102 |
} CMPLX; |
| 103 |
|
| 104 |
typedef struct pvsdat { |
| 105 |
int32 N; |
| 106 |
int sliding; |
| 107 |
int32 NB; |
| 108 |
int32 overlap; |
| 109 |
int32 winsize; |
| 110 |
int wintype; |
| 111 |
int32 format; |
| 112 |
uint32 framecount; |
| 113 |
AUXCH frame; |
| 114 |
|
| 115 |
} PVSDAT; |
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
typedef struct { |
| 121 |
OPDS h; |
| 122 |
PVSDAT *fsig; |
| 123 |
MYFLT *ain; |
| 124 |
MYFLT *fftsize; |
| 125 |
MYFLT *overlap; |
| 126 |
MYFLT *winsize; |
| 127 |
MYFLT *wintype; |
| 128 |
MYFLT *format; |
| 129 |
MYFLT *init; |
| 130 |
|
| 131 |
int32 buflen; |
| 132 |
float fund,arate; |
| 133 |
float RoverTwoPi,TwoPioverR,Fexact; |
| 134 |
MYFLT *nextIn; |
| 135 |
int32 nI,Ii,IOi; |
| 136 |
int32 inptr; |
| 137 |
|
| 138 |
AUXCH input; |
| 139 |
AUXCH overlapbuf; |
| 140 |
AUXCH analbuf; |
| 141 |
AUXCH analwinbuf; |
| 142 |
AUXCH oldInPhase; |
| 143 |
AUXCH trig; |
| 144 |
double *cosine, *sine; |
| 145 |
void *setup; |
| 146 |
} PVSANAL; |
| 147 |
|
| 148 |
typedef struct { |
| 149 |
OPDS h; |
| 150 |
MYFLT *aout; |
| 151 |
PVSDAT *fsig; |
| 152 |
MYFLT *init; |
| 153 |
|
| 154 |
|
| 155 |
int32 overlap,winsize,fftsize,wintype,format; |
| 156 |
|
| 157 |
int32 buflen; |
| 158 |
MYFLT fund,arate; |
| 159 |
MYFLT RoverTwoPi,TwoPioverR,Fexact; |
| 160 |
MYFLT *nextOut; |
| 161 |
int32 nO,Ii,IOi; |
| 162 |
int32 outptr; |
| 163 |
int32 bin_index; |
| 164 |
|
| 165 |
|
| 166 |
AUXCH output; |
| 167 |
AUXCH overlapbuf; |
| 168 |
AUXCH synbuf; |
| 169 |
AUXCH analwinbuf; |
| 170 |
AUXCH synwinbuf; |
| 171 |
AUXCH oldOutPhase; |
| 172 |
|
| 173 |
void *setup; |
| 174 |
} PVSYNTH; |
| 175 |
|
| 176 |
|
| 177 |
|
| 178 |
typedef struct { |
| 179 |
OPDS h; |
| 180 |
MYFLT *aout; |
| 181 |
PVSDAT *fsig; |
| 182 |
MYFLT *n_oscs; |
| 183 |
MYFLT *kfmod; |
| 184 |
MYFLT *ibin; |
| 185 |
MYFLT *ibinoffset; |
| 186 |
MYFLT *init; |
| 187 |
|
| 188 |
int32 outptr; |
| 189 |
uint32 lastframe; |
| 190 |
|
| 191 |
int32 overlap,winsize,fftsize,wintype,format,noscs; |
| 192 |
int32 maxosc; |
| 193 |
float one_over_overlap,pi_over_sr, one_over_sr; |
| 194 |
float fmod; |
| 195 |
AUXCH a; |
| 196 |
AUXCH x; |
| 197 |
AUXCH y; |
| 198 |
AUXCH amps; |
| 199 |
AUXCH lastamps; |
| 200 |
AUXCH freqs; |
| 201 |
AUXCH outbuf; |
| 202 |
} PVADS; |
| 203 |
|
| 204 |
|
| 205 |
typedef struct { |
| 206 |
OPDS h; |
| 207 |
PVSDAT *fout; |
| 208 |
PVSDAT *fsrc; |
| 209 |
PVSDAT *fdest; |
| 210 |
MYFLT *kamp1; |
| 211 |
MYFLT *kamp2; |
| 212 |
|
| 213 |
int32 overlap,winsize,fftsize,wintype,format; |
| 214 |
uint32 lastframe; |
| 215 |
} PVSCROSS; |
| 216 |
|
| 217 |
|
| 218 |
typedef struct { |
| 219 |
OPDS h; |
| 220 |
PVSDAT *fout; |
| 221 |
PVSDAT *fsrc; |
| 222 |
MYFLT *ifn; |
| 223 |
MYFLT *kdepth; |
| 224 |
|
| 225 |
int32 overlap,winsize,fftsize,wintype,format; |
| 226 |
uint32 lastframe; |
| 227 |
int nwarned,pwarned; |
| 228 |
FUNC *maskfunc; |
| 229 |
} PVSMASKA; |
| 230 |
|
| 231 |
|
| 232 |
|
| 233 |
typedef struct { |
| 234 |
OPDS h; |
| 235 |
MYFLT *kflag; |
| 236 |
PVSDAT *fsrc; |
| 237 |
MYFLT *ifna; |
| 238 |
MYFLT *ifnf; |
| 239 |
|
| 240 |
int32 overlap,winsize,fftsize,wintype,format; |
| 241 |
uint32 lastframe; |
| 242 |
FUNC *outfna, *outfnf; |
| 243 |
} PVSFTW; |
| 244 |
|
| 245 |
typedef struct { |
| 246 |
OPDS h; |
| 247 |
|
| 248 |
PVSDAT *fdest; |
| 249 |
MYFLT *ifna; |
| 250 |
MYFLT *ifnf; |
| 251 |
|
| 252 |
int32 overlap,winsize,fftsize,wintype,format; |
| 253 |
uint32 lastframe; |
| 254 |
FUNC *infna, *infnf; |
| 255 |
MYFLT *ftablea,*ftablef; |
| 256 |
} PVSFTR; |
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
typedef struct { |
| 261 |
OPDS h; |
| 262 |
PVSDAT *fout; |
| 263 |
MYFLT *kpos; |
| 264 |
MYFLT *ifilno; |
| 265 |
MYFLT *ichan; |
| 266 |
|
| 267 |
int ptr; |
| 268 |
int32 overlap,winsize,fftsize,wintype,format; |
| 269 |
uint32 chans, nframes,lastframe,chanoffset,blockalign; |
| 270 |
MYFLT arate; |
| 271 |
float *membase; |
| 272 |
} PVSFREAD; |
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
typedef struct { |
| 277 |
OPDS h; |
| 278 |
MYFLT *ioverlap; |
| 279 |
MYFLT *inumbins; |
| 280 |
MYFLT *iwinsize; |
| 281 |
MYFLT *iformat; |
| 282 |
|
| 283 |
PVSDAT *fsrc; |
| 284 |
} PVSINFO; |
| 285 |
|
| 286 |
typedef struct { |
| 287 |
OPDS h; |
| 288 |
PVSDAT *fout; |
| 289 |
PVSDAT *fsrc; |
| 290 |
} FASSIGN; |
| 291 |
|
| 292 |
#endif |
| 293 |
|