#include "aubio_priv.h"
#include "fmat.h"
-fmat_t * new_fmat (uint_t length, uint_t height) {
+fmat_t * new_fmat (uint_t height, uint_t length) {
if ((sint_t)length <= 0 || (sint_t)height <= 0 ) {
return NULL;
}
\param height the height of the matrix to create
*/
-fmat_t * new_fmat(uint_t length, uint_t height);
+fmat_t * new_fmat(uint_t height, uint_t length);
/** fmat_t buffer deletion function
o->au_ios_inbuf = AUBIO_ARRAY(SInt16, AU_IOS_MAX_FRAMES * o->hw_input_channels);
/* the floats coming from and to the device callback */
- o->output_frames = new_fmat(blocksize, sw_output_channels);
- o->input_frames = new_fmat(blocksize, sw_input_channels);
+ o->output_frames = new_fmat(sw_output_channels, blocksize);
+ o->input_frames = new_fmat(sw_input_channels, blocksize);
/* check for some sizes */
if ( o->hw_output_channels != o->output_frames->height ) {
fb->n_filters = n_filters;
/* allocate filter tables, a matrix of length win_s and of height n_filters */
- fb->filters = new_fmat (win_s / 2 + 1, n_filters);
+ fb->filters = new_fmat (n_filters, win_s / 2 + 1);
return fb;
}
/* allocating buffers */
mfcc->in_dct = new_fvec (n_filters);
- mfcc->dct_coeffs = new_fmat (n_coefs, n_filters);
+ mfcc->dct_coeffs = new_fmat (n_filters, n_coefs);
/* compute DCT transform dct_coeffs[i][j] as
cos ( j * (i+.5) * PI / n_filters ) */
s->samplerate = samplerate;
s->blocksize = blocksize;
s->source_output = new_fvec(blocksize);
- s->source_output_multi = new_fmat(blocksize, 4);
+ s->source_output_multi = new_fmat(4, blocksize);
s->source = NULL;
s->playing = 0;
return s;
if ( n_channels == 0 ) n_channels = aubio_source_get_channels(s);
- fmat_t *mat = new_fmat(hop_size, n_channels);
+ fmat_t *mat = new_fmat(n_channels, hop_size);
do {
aubio_source_do_multi (s, mat, &read);
{
uint_t height = 3, length = 9, i, j;
// create fmat_t object
- fmat_t * mat = new_fmat (length, height);
+ fmat_t * mat = new_fmat (height, length);
for ( i = 0; i < mat->height; i++ ) {
for ( j = 0; j < mat->length; j++ ) {
// all elements are already initialized to 0.