aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mtx_rowrfft.c2
-rw-r--r--src/mtx_rowrifft.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/src/mtx_rowrfft.c b/src/mtx_rowrfft.c
index 3475a8b..55e67d7 100644
--- a/src/mtx_rowrfft.c
+++ b/src/mtx_rowrfft.c
@@ -102,7 +102,7 @@ static void mTXrowrfftMatrix (MTXRowrfft *x, t_symbol *s,
//mTXrowrfftList (x, s, argc-2, argv+2);
int rows = atom_getint (argv++);
int columns = atom_getint (argv++);
- int columns_re = (columns>>1);
+ int columns_re = (columns>>1)+1; /* N/2+1 samples needed for real part of realfft */
int size = rows * columns;
int in_size = argc-2;
int size2 = columns_re * rows + 2; /* +2 since the list also contains matrix row+col */
diff --git a/src/mtx_rowrifft.c b/src/mtx_rowrifft.c
index 45678a0..223600c 100644
--- a/src/mtx_rowrifft.c
+++ b/src/mtx_rowrifft.c
@@ -94,7 +94,7 @@ static void mTXrowrifftMatrixCold (MTXRowrifft *x, t_symbol *s,
int rows = atom_getint (argv++);
int columns_re = atom_getint (argv++);
int in_size = argc-2;
- int columns = columns_re<<1;
+ int columns = (columns_re-1)<<1;
int size2 = columns_re * rows;
int size = rows * columns;
int ifft_count;
@@ -103,7 +103,9 @@ static void mTXrowrifftMatrixCold (MTXRowrifft *x, t_symbol *s,
t_float *f_im = x->f_im;
// ifftsize check
- if (!size)
+ if (columns_re < 3)
+ post("mtx_rowrifft: matrix must have at least 3 columns");
+ else if (!size)
post("mtx_rowrifft: invalid dimensions");
else if (in_size < size2)
post("mtx_rowrifft: sparse matrix not yet supported: use \"mtx_check\"");
@@ -136,7 +138,7 @@ static void mTXrowrifftMatrixCold (MTXRowrifft *x, t_symbol *s,
// do nothing else!
}
else
- post("mtx_rowrifft: rowvector size no power of 2!");
+ post("mtx_rowrifft: rowvector 2*(size+1) no power of 2!");
}
static void mTXrowrifftMatrixHot (MTXRowrifft *x, t_symbol *s,