Changeset 66fb3ea for src/cvec.h


Ignore:
Timestamp:
Dec 4, 2009, 1:33:06 AM (10 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
0b9a02a
Parents:
c7860af
Message:

modified cvec to be mono

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/cvec.h

    rc7860af r66fb3ea  
    3939typedef struct {
    4040  uint_t length;   /**< length of buffer = (requested length)/2 + 1 */
    41   uint_t channels; /**< number of channels */
    42   smpl_t **norm;   /**< norm array of size [length] * [channels] */
    43   smpl_t **phas;   /**< phase array of size [length] * [channels] */
     41  smpl_t *norm;   /**< norm array of size [length] */
     42  smpl_t *phas;   /**< phase array of size [length] */
    4443} cvec_t;
    4544
     
    4746
    4847  This function creates a cvec_t structure holding two arrays of size
    49   [length/2+1] * channels, corresponding to the norm and phase values of the
     48  [length/2+1], corresponding to the norm and phase values of the
    5049  spectral frame. The length stored in the structure is the actual size of both
    5150  arrays, not the length of the complex and symetrical vector, specified as
     
    5352
    5453  \param length the length of the buffer to create
    55   \param channels the number of channels in the buffer
    5654
    5755*/
    58 cvec_t * new_cvec(uint_t length, uint_t channels);
     56cvec_t * new_cvec(uint_t length);
    5957/** cvec_t buffer deletion function
    6058
     
    6664
    6765  Note that this function is not used in the aubio library, since the same
    68   result can be obtained by assigning vec->norm[channel][position]. Its purpose
     66  result can be obtained by assigning vec->norm[position]. Its purpose
    6967  is to access these values from wrappers, as created by swig.
    7068
    7169  \param s vector to write to
    72   \param data norm value to write in s->norm[channel][position]
    73   \param channel channel to write to
     70  \param data norm value to write in s->norm[position]
    7471  \param position sample position to write to
    7572
    7673*/
    77 void cvec_write_norm(cvec_t *s, smpl_t data, uint_t channel, uint_t position);
     74void cvec_write_norm(cvec_t *s, smpl_t data, uint_t position);
    7875/** write phase value in a complex buffer
    7976
    8077  Note that this function is not used in the aubio library, since the same
    81   result can be obtained by assigning vec->phas[channel][position]. Its purpose
     78  result can be obtained by assigning vec->phas[position]. Its purpose
    8279  is to access these values from wrappers, as created by swig.
    8380
    8481  \param s vector to write to
    85   \param data phase value to write in s->phas[channel][position]
    86   \param channel channel to write to
     82  \param data phase value to write in s->phas[position]
    8783  \param position sample position to write to
    8884
    8985*/
    90 void cvec_write_phas(cvec_t *s, smpl_t data, uint_t channel, uint_t position);
     86void cvec_write_phas(cvec_t *s, smpl_t data, uint_t position);
    9187/** read norm value from a complex buffer
    9288
    9389  Note that this function is not used in the aubio library, since the same
    94   result can be obtained with vec->norm[channel][position]. Its purpose is to
     90  result can be obtained with vec->norm[position]. Its purpose is to
    9591  access these values from wrappers, as created by swig.
    9692
    9793  \param s vector to read from
    98   \param channel channel to read from
    9994  \param position sample position to read from
    10095
    10196*/
    102 smpl_t cvec_read_norm(cvec_t *s, uint_t channel, uint_t position);
     97smpl_t cvec_read_norm(cvec_t *s, uint_t position);
    10398/** read phase value from a complex buffer
    10499
    105100  Note that this function is not used in the aubio library, since the same
    106   result can be obtained with vec->phas[channel][position]. Its purpose is to
     101  result can be obtained with vec->phas[position]. Its purpose is to
    107102  access these values from wrappers, as created by swig.
    108103
    109104  \param s vector to read from
    110   \param channel channel to read from
    111105  \param position sample position to read from
    112106
    113107*/
    114 smpl_t cvec_read_phas(cvec_t *s, uint_t channel, uint_t position);
    115 /** write norm channel in a complex buffer
    116 
    117   Note that this function is not used in the aubio library, since the same
    118   result can be obtained by assigning vec->norm[channel]. Its purpose is to
    119   access these values from wrappers, as created by swig.
    120 
    121   \param s vector to write to
    122   \param data norm vector of [length] samples to write in s->norm[channel]
    123   \param channel channel to write to
    124 
    125 */
    126 void cvec_put_norm_channel(cvec_t *s, smpl_t * data, uint_t channel);
    127 /** write phase channel in a complex buffer
    128 
    129   Note that this function is not used in the aubio library, since the same
    130   result can be obtained by assigning vec->phas[channel]. Its purpose is to
    131   access these values from wrappers, as created by swig.
    132 
    133   \param s vector to write to
    134   \param data phase vector of [length] samples to write in s->phas[channel]
    135   \param channel channel to write to
    136 
    137 */
    138 void cvec_put_phas_channel(cvec_t *s, smpl_t * data, uint_t channel);
    139 /** read norm channel from a complex buffer
    140 
    141   Note that this function is not used in the aubio library, since the same
    142   result can be obtained with vec->norm[channel]. Its purpose is to access
    143   these values from wrappers, as created by swig.
    144 
    145   \param s vector to read from
    146   \param channel channel to read from
    147 
    148 */
    149 smpl_t * cvec_get_norm_channel(cvec_t *s, uint_t channel);
    150 /** write phase channel in a complex buffer
    151 
    152   Note that this function is not used in the aubio library, since the same
    153   result can be obtained with vec->phas[channel]. Its purpose is to access
    154   these values from wrappers, as created by swig.
    155 
    156   \param s vector to read from
    157   \param channel channel to read from
    158 
    159 */
    160 smpl_t * cvec_get_phas_channel(cvec_t *s, uint_t channel);
     108smpl_t cvec_read_phas(cvec_t *s, uint_t position);
    161109/** read norm data from a complex buffer
    162110
     
    168116
    169117*/
    170 smpl_t ** cvec_get_norm(cvec_t *s);
     118smpl_t * cvec_get_norm(cvec_t *s);
    171119/** read phase data from a complex buffer
    172120
     
    178126
    179127*/
    180 smpl_t ** cvec_get_phas(cvec_t *s);
     128smpl_t * cvec_get_phas(cvec_t *s);
    181129
    182130/** print out cvec data
Note: See TracChangeset for help on using the changeset viewer.