~ubuntu-branches/ubuntu/karmic/asterisk/karmic

« back to all changes in this revision

Viewing changes to codecs/lpc10/pitsyn.c

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2002-04-27 21:19:32 UTC
  • Revision ID: james.westby@ubuntu.com-20020427211932-kqaertc4bg7ss5mc
Tags: upstream-0.1.11
ImportĀ upstreamĀ versionĀ 0.1.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 
 
3
$Log: pitsyn.c,v $
 
4
Revision 1.2  2000/01/05 08:20:39  markster
 
5
Some OSS fixes and a few lpc changes to make it actually work
 
6
 
 
7
 * Revision 1.2  1996/08/20  20:40:12  jaf
 
8
 * Removed all static local variables that were SAVE'd in the Fortran
 
9
 * code, and put them in struct lpc10_decoder_state that is passed as an
 
10
 * argument.
 
11
 *
 
12
 * Removed init function, since all initialization is now done in
 
13
 * init_lpc10_decoder_state().
 
14
 *
 
15
 * Revision 1.1  1996/08/19  22:31:12  jaf
 
16
 * Initial revision
 
17
 *
 
18
 
 
19
*/
 
20
 
 
21
#ifdef P_R_O_T_O_T_Y_P_E_S
 
22
extern int pitsyn_(integer *order, integer *voice, integer *pitch, real *rms, real *rc, integer *lframe, integer *ivuv, integer *ipiti, real *rmsi, real *rci, integer *nout, real *ratio, struct lpc10_decoder_state *st);
 
23
#endif
 
24
 
 
25
/*  -- translated by f2c (version 19951025).
 
26
   You must link the resulting object file with the libraries:
 
27
        -lf2c -lm   (in that order)
 
28
*/
 
29
 
 
30
#include "f2c.h"
 
31
 
 
32
/* ***************************************************************** */
 
33
 
 
34
/*      PITSYN Version 53 */
 
35
 
 
36
/* $Log: pitsyn.c,v $
 
37
/* Revision 1.2  2000/01/05 08:20:39  markster
 
38
/* Some OSS fixes and a few lpc changes to make it actually work
 
39
/*
 
40
 * Revision 1.2  1996/08/20  20:40:12  jaf
 
41
 * Removed all static local variables that were SAVE'd in the Fortran
 
42
 * code, and put them in struct lpc10_decoder_state that is passed as an
 
43
 * argument.
 
44
 *
 
45
 * Removed init function, since all initialization is now done in
 
46
 * init_lpc10_decoder_state().
 
47
 *
 
48
 * Revision 1.1  1996/08/19  22:31:12  jaf
 
49
 * Initial revision
 
50
 * */
 
51
/* Revision 1.2  1996/03/25  18:49:07  jaf */
 
52
/* Added commments about which indices of array arguments are read or */
 
53
/* written. */
 
54
 
 
55
/* Rearranged local variable declarations to indicate which need to be */
 
56
/* saved from one invocation to the next.  Added entry INITPITSYN to */
 
57
/* reinitialize local state variables, if desired. */
 
58
 
 
59
/* Added lots of comments about proving that the maximum number of pitch */
 
60
/* periods (NOUT) that can be returned is 16.  The call to STOP that */
 
61
/* could happen if NOUT got too large was removed as a result. */
 
62
 
 
63
/* Also proved that the total number of samples returned from N calls, */
 
64
/* each with identical values of LFRAME, will always be in the range */
 
65
/* N*LFRAME-MAXPIT+1 to N*LFRAME. */
 
66
 
 
67
/* Revision 1.1  1996/02/07 14:48:18  jaf */
 
68
/* Initial revision */
 
69
 
 
70
 
 
71
/* ***************************************************************** */
 
72
 
 
73
/*   Synthesize a single pitch epoch */
 
74
 
 
75
/* Input: */
 
76
/*  ORDER  - Synthesis order (number of RC's) */
 
77
/*  VOICE  - Half frame voicing decisions */
 
78
/*           Indices 1 through 2 read. */
 
79
/*  LFRAME - Length of speech buffer */
 
80
/* Input/Output: */
 
81
/*  PITCH  - Pitch */
 
82
/*           This value should be in the range MINPIT (20) to MAXPIT */
 
83
/*           (156), inclusive. */
 
84
/*           PITCH can be modified under some conditions. */
 
85
/*  RMS    - Energy  (can be modified) */
 
86
/*           RMS is changed to 1 if the value passed in is less than 1. */
 
87
/*  RC     - Reflection coefficients */
 
88
/*           Indices 1 through ORDER can be temporarily overwritten with */
 
89
/*           RCO, and then replaced with original values, under some */
 
90
/*           conditions. */
 
91
/* Output: */
 
92
/*  IVUV   - Pitch epoch voicing decisions */
 
93
/*           Indices (I) of IVUV, IPITI, and RMSI are written, */
 
94
/*           and indices (J,I) of RCI are written, */
 
95
/*           where I ranges from 1 to NOUT, and J ranges from 1 to ORDER. */
 
96
/*  IPITI  - Pitch epoch length */
 
97
/*  RMSI   - Pitch epoch energy */
 
98
/*  RCI    - Pitch epoch RC's */
 
99
/*  NOUT   - Number of pitch periods in this frame */
 
100
/*           This is at least 0, at least 1 if MAXPIT .LT. LFRAME (this */
 
101
/*           is currently true on every call), and can never be more than */
 
102
/*           (LFRAME+MAXPIT-1)/PITCH, which is currently 16 with */
 
103
/*           LFRAME=180, MAXPIT=156, and PITCH .GE. 20, as SYNTHS */
 
104
/*           guarantees when it calls this subroutine. */
 
105
/*  RATIO  - Previous to present energy ratio */
 
106
/*           Always assigned a value. */
 
107
 
 
108
/* Subroutine */ int pitsyn_(integer *order, integer *voice, 
 
109
        integer *pitch, real *rms, real *rc, integer *lframe, integer *ivuv, 
 
110
        integer *ipiti, real *rmsi, real *rci, integer *nout, real *ratio,
 
111
                               struct lpc10_decoder_state *st)
 
112
{
 
113
    /* Initialized data */
 
114
 
 
115
    real *rmso;
 
116
    logical *first;
 
117
 
 
118
    /* System generated locals */
 
119
    integer rci_dim1, rci_offset, i__1, i__2;
 
120
    real r__1;
 
121
 
 
122
    /* Builtin functions */
 
123
    double log(doublereal), exp(doublereal);
 
124
 
 
125
    /* Local variables */
 
126
    real alrn, alro, yarc[10], prop;
 
127
    integer i__, j, vflag, jused, lsamp;
 
128
    integer *jsamp;
 
129
    real slope;
 
130
    integer *ipito;
 
131
    real uvpit;
 
132
    integer ip, nl, ivoice;
 
133
    integer *ivoico;
 
134
    integer istart;
 
135
    real *rco;
 
136
    real xxy;
 
137
 
 
138
/*       Arguments */
 
139
/* $Log: pitsyn.c,v $
 
140
/* Revision 1.2  2000/01/05 08:20:39  markster
 
141
/* Some OSS fixes and a few lpc changes to make it actually work
 
142
/*
 
143
 * Revision 1.2  1996/08/20  20:40:12  jaf
 
144
 * Removed all static local variables that were SAVE'd in the Fortran
 
145
 * code, and put them in struct lpc10_decoder_state that is passed as an
 
146
 * argument.
 
147
 *
 
148
 * Removed init function, since all initialization is now done in
 
149
 * init_lpc10_decoder_state().
 
150
 *
 
151
 * Revision 1.1  1996/08/19  22:31:12  jaf
 
152
 * Initial revision
 
153
 * */
 
154
/* Revision 1.3  1996/03/29  22:03:47  jaf */
 
155
/* Removed definitions for any constants that were no longer used. */
 
156
 
 
157
/* Revision 1.2  1996/03/26  19:34:33  jaf */
 
158
/* Added comments indicating which constants are not needed in an */
 
159
/* application that uses the LPC-10 coder. */
 
160
 
 
161
/* Revision 1.1  1996/02/07  14:43:51  jaf */
 
162
/* Initial revision */
 
163
 
 
164
/*   LPC Configuration parameters: */
 
165
/* Frame size, Prediction order, Pitch period */
 
166
/*       Local variables that need not be saved */
 
167
/*       LSAMP is initialized in the IF (FIRST) THEN clause, but it is */
 
168
/*       not used the first time through, and it is given a value before 
 
169
*/
 
170
/*       use whenever FIRST is .FALSE., so it appears unnecessary to */
 
171
/*       assign it a value when FIRST is .TRUE. */
 
172
/*       Local state */
 
173
/* FIRST  - .TRUE. only on first call to PITSYN. */
 
174
/* IVOICO - Previous VOICE(2) value. */
 
175
/* IPITO  - Previous PITCH value. */
 
176
/* RMSO   - Previous RMS value. */
 
177
/* RCO    - Previous RC values. */
 
178
 
 
179
/* JSAMP  - If this routine is called N times with identical values of */
 
180
/*          LFRAME, then the total length of all pitch periods returned */
 
181
/*          is always N*LFRAME-JSAMP, and JSAMP is always in the range 0 
 
182
*/
 
183
/*          to MAXPIT-1 (see below for why this is so).  Thus JSAMP is */
 
184
/*          the number of samples "left over" from the previous call to */
 
185
/*          PITSYN, that haven't been "used" in a pitch period returned */
 
186
/*          from this subroutine.  Every time this subroutine is called, 
 
187
*/
 
188
/*          it returns pitch periods with a total length of at most */
 
189
/*          LFRAME+JSAMP. */
 
190
 
 
191
/* IVOICO, IPITO, RCO, and JSAMP need not be assigned an initial value */
 
192
/* with a DATA statement, because they are always initialized on the */
 
193
/* first call to PITSYN. */
 
194
 
 
195
/* FIRST and RMSO should be initialized with DATA statements, because */
 
196
/* even on the first call, they are used before being initialized. */
 
197
    /* Parameter adjustments */
 
198
    if (rc) {
 
199
        --rc;
 
200
        }
 
201
    if (rci) {
 
202
        rci_dim1 = *order;
 
203
        rci_offset = rci_dim1 + 1;
 
204
        rci -= rci_offset;
 
205
        }
 
206
    if (voice) {
 
207
        --voice;
 
208
        }
 
209
    if (ivuv) {
 
210
        --ivuv;
 
211
        }
 
212
    if (ipiti) {
 
213
        --ipiti;
 
214
        }
 
215
    if (rmsi) {
 
216
        --rmsi;
 
217
        }
 
218
 
 
219
    /* Function Body */
 
220
    ivoico = &(st->ivoico);
 
221
    ipito = &(st->ipito);
 
222
    rmso = &(st->rmso);
 
223
    rco = &(st->rco[0]);
 
224
    jsamp = &(st->jsamp);
 
225
    first = &(st->first_pitsyn);
 
226
 
 
227
    if (*rms < 1.f) {
 
228
        *rms = 1.f;
 
229
    }
 
230
    if (*rmso < 1.f) {
 
231
        *rmso = 1.f;
 
232
    }
 
233
    uvpit = 0.f;
 
234
    *ratio = *rms / (*rmso + 8.f);
 
235
    if (*first) {
 
236
        lsamp = 0;
 
237
        ivoice = voice[2];
 
238
        if (ivoice == 0) {
 
239
            *pitch = *lframe / 4;
 
240
        }
 
241
        *nout = *lframe / *pitch;
 
242
        *jsamp = *lframe - *nout * *pitch;
 
243
 
 
244
/*          SYNTHS only calls this subroutine with PITCH in the range 
 
245
20 */
 
246
/*          to 156.  LFRAME = MAXFRM = 180, so NOUT is somewhere in th
 
247
e */
 
248
/*          range 1 to 9. */
 
249
 
 
250
/*          JSAMP is "LFRAME mod PITCH", so it is in the range 0 to */
 
251
/*          (PITCH-1), or 0 to MAXPIT-1=155, after the first call. */
 
252
 
 
253
        i__1 = *nout;
 
254
        for (i__ = 1; i__ <= i__1; ++i__) {
 
255
            i__2 = *order;
 
256
            for (j = 1; j <= i__2; ++j) {
 
257
                rci[j + i__ * rci_dim1] = rc[j];
 
258
            }
 
259
            ivuv[i__] = ivoice;
 
260
            ipiti[i__] = *pitch;
 
261
            rmsi[i__] = *rms;
 
262
        }
 
263
        *first = FALSE_;
 
264
    } else {
 
265
        vflag = 0;
 
266
        lsamp = *lframe + *jsamp;
 
267
        slope = (*pitch - *ipito) / (real) lsamp;
 
268
        *nout = 0;
 
269
        jused = 0;
 
270
        istart = 1;
 
271
        if (voice[1] == *ivoico && voice[2] == voice[1]) {
 
272
            if (voice[2] == 0) {
 
273
/* SSUV - -   0  ,  0  ,  0 */
 
274
                *pitch = *lframe / 4;
 
275
                *ipito = *pitch;
 
276
                if (*ratio > 8.f) {
 
277
                    *rmso = *rms;
 
278
                }
 
279
            }
 
280
/* SSVC - -   1  ,  1  ,  1 */
 
281
            slope = (*pitch - *ipito) / (real) lsamp;
 
282
            ivoice = voice[2];
 
283
        } else {
 
284
            if (*ivoico != 1) {
 
285
                if (*ivoico == voice[1]) {
 
286
/* UV2VC2 - -  0  ,  0  ,  1 */
 
287
                    nl = lsamp - *lframe / 4;
 
288
                } else {
 
289
/* UV2VC1 - -  0  ,  1  ,  1 */
 
290
                    nl = lsamp - *lframe * 3 / 4;
 
291
                }
 
292
                ipiti[1] = nl / 2;
 
293
                ipiti[2] = nl - ipiti[1];
 
294
                ivuv[1] = 0;
 
295
                ivuv[2] = 0;
 
296
                rmsi[1] = *rmso;
 
297
                rmsi[2] = *rmso;
 
298
                i__1 = *order;
 
299
                for (i__ = 1; i__ <= i__1; ++i__) {
 
300
                    rci[i__ + rci_dim1] = rco[i__ - 1];
 
301
                    rci[i__ + (rci_dim1 << 1)] = rco[i__ - 1];
 
302
                    rco[i__ - 1] = rc[i__];
 
303
                }
 
304
                slope = 0.f;
 
305
                *nout = 2;
 
306
                *ipito = *pitch;
 
307
                jused = nl;
 
308
                istart = nl + 1;
 
309
                ivoice = 1;
 
310
            } else {
 
311
                if (*ivoico != voice[1]) {
 
312
/* VC2UV1 - -   1  ,  0  ,  0 */
 
313
                    lsamp = *lframe / 4 + *jsamp;
 
314
                } else {
 
315
/* VC2UV2 - -   1  ,  1  ,  0 */
 
316
                    lsamp = *lframe * 3 / 4 + *jsamp;
 
317
                }
 
318
                i__1 = *order;
 
319
                for (i__ = 1; i__ <= i__1; ++i__) {
 
320
                    yarc[i__ - 1] = rc[i__];
 
321
                    rc[i__] = rco[i__ - 1];
 
322
                }
 
323
                ivoice = 1;
 
324
                slope = 0.f;
 
325
                vflag = 1;
 
326
            }
 
327
        }
 
328
/* Here is the value of most variables that are used below, depending 
 
329
on */
 
330
/* the values of IVOICO, VOICE(1), and VOICE(2).  VOICE(1) and VOICE(2
 
331
) */
 
332
/* are input arguments, and IVOICO is the value of VOICE(2) on the */
 
333
/* previous call (see notes for the IF (NOUT .NE. 0) statement near th
 
334
e */
 
335
/* end).  Each of these three values is either 0 or 1.  These three */
 
336
/* values below are given as 3-bit long strings, in the order IVOICO, 
 
337
*/
 
338
/* VOICE(1), and VOICE(2).  It appears that the code above assumes tha
 
339
t */
 
340
/* the bit sequences 010 and 101 never occur, but I wonder whether a 
 
341
*/
 
342
/* large enough number of bit errors in the channel could cause such a
 
343
 */
 
344
/* thing to happen, and if so, could that cause NOUT to ever go over 1
 
345
1? */
 
346
 
 
347
/* Note that all of the 180 values in the table are really LFRAME, but
 
348
 */
 
349
/* 180 has fewer characters, and it makes the table a little more */
 
350
/* concrete.  If LFRAME is ever changed, keep this in mind.  Similarly
 
351
, */
 
352
/* 135's are 3*LFRAME/4, and 45's are LFRAME/4.  If LFRAME is not a */
 
353
/* multiple of 4, then the 135 for NL-JSAMP is actually LFRAME-LFRAME/
 
354
4, */
 
355
/* and the 45 for NL-JSAMP is actually LFRAME-3*LFRAME/4. */
 
356
 
 
357
/* Note that LSAMP-JSAMP is given as the variable.  This was just for 
 
358
*/
 
359
/* brevity, to avoid adding "+JSAMP" to all of the column entries. */
 
360
/* Similarly for NL-JSAMP. */
 
361
 
 
362
/* Variable    | 000  001    011,010  111       110       100,101 */
 
363
/* ------------+-------------------------------------------------- */
 
364
/* ISTART      | 1    NL+1   NL+1     1         1         1 */
 
365
/* LSAMP-JSAMP | 180  180    180      180       135       45 */
 
366
/* IPITO       | 45   PITCH  PITCH    oldPITCH  oldPITCH  oldPITCH */
 
367
/* SLOPE       | 0    0      0        seebelow  0         0 */
 
368
/* JUSED       | 0    NL     NL       0         0         0 */
 
369
/* PITCH       | 45   PITCH  PITCH    PITCH     PITCH     PITCH */
 
370
/* NL-JSAMP    | --   135    45       --        --        -- */
 
371
/* VFLAG       | 0    0      0        0         1         1 */
 
372
/* NOUT        | 0    2      2        0         0         0 */
 
373
/* IVOICE      | 0    1      1        1         1         1 */
 
374
 
 
375
/* while_loop  | once once   once     once      twice     twice */
 
376
 
 
377
/* ISTART      | --   --     --       --        JUSED+1   JUSED+1 */
 
378
/* LSAMP-JSAMP | --   --     --       --        180       180 */
 
379
/* IPITO       | --   --     --       --        oldPITCH  oldPITCH */
 
380
/* SLOPE       | --   --     --       --        0         0 */
 
381
/* JUSED       | --   --     --       --        ??        ?? */
 
382
/* PITCH       | --   --     --       --        PITCH     PITCH */
 
383
/* NL-JSAMP    | --   --     --       --        --        -- */
 
384
/* VFLAG       | --   --     --       --        0         0 */
 
385
/* NOUT        | --   --     --       --        ??        ?? */
 
386
/* IVOICE      | --   --     --       --        0         0 */
 
387
 
 
388
 
 
389
/* UVPIT is always 0.0 on the first pass through the DO WHILE (.TRUE.)
 
390
 */
 
391
/* loop below. */
 
392
 
 
393
/* The only possible non-0 value of SLOPE (in column 111) is */
 
394
/* (PITCH-IPITO)/FLOAT(LSAMP) */
 
395
 
 
396
/* Column 101 is identical to 100.  Any good properties we can prove 
 
397
*/
 
398
/* for 100 will also hold for 101.  Similarly for 010 and 011. */
 
399
 
 
400
/* SYNTHS calls this subroutine with PITCH restricted to the range 20 
 
401
to */
 
402
/* 156.  IPITO is similarly restricted to this range, after the first 
 
403
*/
 
404
/* call.  IP below is also restricted to this range, given the */
 
405
/* definitions of IPITO, SLOPE, UVPIT, and that I is in the range ISTA
 
406
RT */
 
407
/* to LSAMP. */
 
408
 
 
409
        while(TRUE_) {
 
410
 
 
411
/*             JUSED is the total length of all pitch periods curr
 
412
ently */
 
413
/*             in the output arrays, in samples. */
 
414
 
 
415
/*             An invariant of the DO I = ISTART,LSAMP loop below,
 
416
 under */
 
417
/*             the condition that IP is always in the range 1 thro
 
418
ugh */
 
419
/*             MAXPIT, is: */
 
420
 
 
421
/*             (I - MAXPIT) .LE. JUSED .LE. (I-1) */
 
422
 
 
423
/*             Note that the final value of I is LSAMP+1, so that 
 
424
after */
 
425
/*             the DO loop is complete, we know: */
 
426
 
 
427
/*             (LSAMP - MAXPIT + 1) .LE. JUSED .LE. LSAMP */
 
428
 
 
429
            i__1 = lsamp;
 
430
            for (i__ = istart; i__ <= i__1; ++i__) {
 
431
                r__1 = *ipito + slope * i__;
 
432
                ip = r__1 + .5f;
 
433
                if (uvpit != 0.f) {
 
434
                    ip = uvpit;
 
435
                }
 
436
                if (ip <= i__ - jused) {
 
437
                    ++(*nout);
 
438
 
 
439
/*                   The following check is no longer nece
 
440
ssary, now that */
 
441
/*                   we can prove that NOUT will never go 
 
442
over 16. */
 
443
 
 
444
/*                  IF (NOUT .GT. 16) STOP 'PITSYN: too many epochs' 
 
445
*/
 
446
 
 
447
                    ipiti[*nout] = ip;
 
448
                    *pitch = ip;
 
449
                    ivuv[*nout] = ivoice;
 
450
                    jused += ip;
 
451
                    prop = (jused - ip / 2) / (real) lsamp;
 
452
                    i__2 = *order;
 
453
                    for (j = 1; j <= i__2; ++j) {
 
454
                        alro = log((rco[j - 1] + 1) / (1 - rco[j - 1]));
 
455
                        alrn = log((rc[j] + 1) / (1 - rc[j]));
 
456
                        xxy = alro + prop * (alrn - alro);
 
457
                        xxy = exp(xxy);
 
458
                        rci[j + *nout * rci_dim1] = (xxy - 1) / (xxy + 1);
 
459
                    }
 
460
                    rmsi[*nout] = log(*rmso) + prop * (log(*rms) - log(*rmso));
 
461
                    rmsi[*nout] = exp(rmsi[*nout]);
 
462
                }
 
463
            }
 
464
            if (vflag != 1) {
 
465
                goto L100;
 
466
            }
 
467
 
 
468
/*             I want to prove what range UVPIT must lie in after 
 
469
the */
 
470
/*             assignments to it below.  To do this, I must determ
 
471
ine */
 
472
/*             what range (LSAMP-ISTART) must lie in, after the */
 
473
/*             assignments to ISTART and LSAMP below. */
 
474
 
 
475
/*             Let oldLSAMP be the value of LSAMP at this point in
 
476
 the */
 
477
/*             execution.  This is 135+JSAMP in state 110, or 45+J
 
478
SAMP in */
 
479
/*             states 100 or 101. */
 
480
 
 
481
/*             Given the loop invariant on JUSED above, we know th
 
482
at: */
 
483
 
 
484
/*             (oldLSAMP - MAXPIT + 1) .LE. JUSED .LE. oldLSAMP */
 
485
 
 
486
/*             ISTART is one more than this. */
 
487
 
 
488
/*             Let newLSAMP be the value assigned to LSAMP below. 
 
489
 This */
 
490
/*             is 180+JSAMP.  Thus (newLSAMP-oldLSAMP) is either 4
 
491
5 or */
 
492
/*             135, depending on the state. */
 
493
 
 
494
/*             Thus, the range of newLSAMP-ISTART is: */
 
495
 
 
496
/*             (newLSAMP-(oldLSAMP+1)) .LE. newLSAMP-ISTART */
 
497
/*             .LE. (newLSAMP-(oldLSAMP - MAXPIT + 2)) */
 
498
 
 
499
/*             or: */
 
500
 
 
501
/*             46 .LE. newLSAMP-ISTART .LE. 133+MAXPIT .EQ. 289 */
 
502
 
 
503
/*             Therefore, UVPIT is in the range 23 to 144 after th
 
504
e first */
 
505
/*             assignment to UVPIT below, and after the conditiona
 
506
l */
 
507
/*             assignment, it is in the range 23 to 90. */
 
508
 
 
509
/*             The important thing is that it is in the range 20 t
 
510
o 156, */
 
511
/*             so that in the loop above, IP is always in this ran
 
512
ge. */
 
513
 
 
514
            vflag = 0;
 
515
            istart = jused + 1;
 
516
            lsamp = *lframe + *jsamp;
 
517
            slope = 0.f;
 
518
            ivoice = 0;
 
519
            uvpit = (real) ((lsamp - istart) / 2);
 
520
            if (uvpit > 90.f) {
 
521
                uvpit /= 2;
 
522
            }
 
523
            *rmso = *rms;
 
524
            i__1 = *order;
 
525
            for (i__ = 1; i__ <= i__1; ++i__) {
 
526
                rc[i__] = yarc[i__ - 1];
 
527
                rco[i__ - 1] = yarc[i__ - 1];
 
528
            }
 
529
        }
 
530
L100:
 
531
        *jsamp = lsamp - jused;
 
532
    }
 
533
/*       Given that the maximum pitch period MAXPIT .LT. LFRAME (this is 
 
534
*/
 
535
/*       currently true on every call, since SYNTHS always sets */
 
536
/*       LFRAME=180), NOUT will always be .GE. 1 at this point. */
 
537
    if (*nout != 0) {
 
538
        *ivoico = voice[2];
 
539
        *ipito = *pitch;
 
540
        *rmso = *rms;
 
541
        i__1 = *order;
 
542
        for (i__ = 1; i__ <= i__1; ++i__) {
 
543
            rco[i__ - 1] = rc[i__];
 
544
        }
 
545
    }
 
546
    return 0;
 
547
} /* pitsyn_ */