Added reset_all() to completely reset spgram object including window buffer
@@ -184,7 +184,7 @@ void SPGRAM(_destroy)(SPGRAM() _q)
free(_q);
}
-// resets the internal state of the spgram object
+// resets the internal state of the spgram object except for the window buffer
void SPGRAM(_reset)(SPGRAM() _q)
{
// clear the window buffer
@@ -205,6 +205,15 @@ void SPGRAM(_reset)(SPGRAM() _q)
_q->psd[i] = 0.0f;
}
+// completely resets the internal state of the spgram object
+void SPGRAM(_reset_all)(SPGRAM() _q)
+{
+ // reset spgram object except for the window buffer
+ SPGRAM(_reset)(_q);
+ // clear the window buffer
+ WINDOW(_reset)(_q->buffer);
+}
+
// prints the spgram object's parameters
void SPGRAM(_print)(SPGRAM() _q)
{
@@ -436,4 +445,3 @@ void SPGRAM(_estimate_psd)(unsigned int _nfft,
// destroy object
SPGRAM(_destroy)(q);
}
-
