Mercurial > hg > vamp-simple-cepstrum
changeset 43:fcb6562b43f7
Docs and fixes from plugin tester reports
author | Chris Cannam |
---|---|
date | Fri, 28 Nov 2014 15:28:07 +0000 |
parents | 745627478cf9 |
children | f021dc97da29 |
files | Makefile.inc Makefile.linux64 SimpleCepstrum.cpp vamp-plugin.list vamp-plugin.map |
diffstat | 5 files changed, 33 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/Makefile.inc Fri Jun 20 10:17:39 2014 +0100 +++ b/Makefile.inc Fri Nov 28 15:28:07 2014 +0000 @@ -20,10 +20,10 @@ $(CXX) -o $@ $^ $(LDFLAGS) clean: - rm $(OBJECTS) + rm -f $(OBJECTS) distclean: clean - rm $(PLUGIN) + rm -f $(PLUGIN) libmain.o: $(HEADERS) $(SOURCES) SimpleCepstrum.o: $(HEADERS) $(SOURCES)
--- a/Makefile.linux64 Fri Jun 20 10:17:39 2014 +0100 +++ b/Makefile.linux64 Fri Nov 28 15:28:07 2014 +0000 @@ -1,8 +1,8 @@ -CFLAGS := -Wall -g -fPIC -I/usr/local/include +CFLAGS := -Wall -g -fPIC CXXFLAGS := $(CFLAGS) -LDFLAGS := -shared -Wl,-Bstatic -L/usr/local/lib -lvamp-sdk -Wl,-Bdynamic +LDFLAGS := -shared -Wl,-Bstatic -lvamp-sdk -Wl,-Bdynamic -Wl,-Bsymbolic -Wl,-z,defs -Wl,--version-script=vamp-plugin.map PLUGIN_EXT := .so
--- a/SimpleCepstrum.cpp Fri Jun 20 10:17:39 2014 +0100 +++ b/SimpleCepstrum.cpp Fri Nov 28 15:28:07 2014 +0000 @@ -144,7 +144,7 @@ d.identifier = "fmin"; d.name = "Minimum frequency"; - d.description = ""; + d.description = "Frequency whose period corresponds to the quefrency of the last cepstrum bin in range"; d.unit = "Hz"; d.minValue = m_inputSampleRate / m_blockSize; d.maxValue = m_inputSampleRate / 2; @@ -154,7 +154,7 @@ d.identifier = "fmax"; d.name = "Maximum frequency"; - d.description = ""; + d.description = "Frequency whose period corresponds to the quefrency of the first cepstrum bin in range"; d.unit = "Hz"; d.minValue = m_inputSampleRate / m_blockSize; d.maxValue = m_inputSampleRate / 2; @@ -164,7 +164,7 @@ d.identifier = "histlen"; d.name = "Mean filter history length"; - d.description = ""; + d.description = "Length of mean filter used for smoothing cepstrum across time bins"; d.unit = ""; d.minValue = 1; d.maxValue = 10; @@ -175,7 +175,7 @@ d.identifier = "vflen"; d.name = "Vertical filter length"; - d.description = ""; + d.description = "Length of mean filter used for smoothing cepstrum across quefrency bins"; d.unit = ""; d.minValue = 1; d.maxValue = 11; @@ -186,7 +186,7 @@ d.identifier = "method"; d.name = "Cepstrum transform method"; - d.unit = ""; + d.unit = "Method to use for calculating cepstrum, starting from the complex short-time Fourier transform of the input audio.\nInverse symmetric - Real part of inverse FFT of log magnitude spectrum, with frequencies above Nyquist reflecting those below it.\nInverse asymmetric - Real part of inverse FFT of log magnitude spectrum, with frequencies above Nyquist set to zero.\nInverse complex - Real part of inverse FFT of complex log spectrum.\nForward magnitude - Magnitude of forward FFT of log magnitude spectrum.\nForward difference - Difference between imaginary and real parts of forward FFT of log magnitude spectrum"; d.minValue = 0; d.maxValue = 4; d.defaultValue = 0; @@ -201,7 +201,7 @@ d.identifier = "clamp"; d.name = "Clamp negative values in cepstrum at zero"; - d.unit = ""; + d.unit = "If set, no negative values will be returned; they will be replaced by zeroes"; d.minValue = 0; d.maxValue = 1; d.defaultValue = 0; @@ -334,13 +334,19 @@ int from = int(m_inputSampleRate / m_fmax); int to = int(m_inputSampleRate / m_fmin); + if (from >= (int)m_blockSize / 2) { + from = m_blockSize / 2 - 1; + } if (to >= (int)m_blockSize / 2) { to = m_blockSize / 2 - 1; } + if (to < from) { + to = from; + } d.binCount = to - from + 1; for (int i = from; i <= to; ++i) { float freq = m_inputSampleRate / i; - char buffer[20]; + char buffer[50]; sprintf(buffer, "%.2f Hz", freq); d.binNames.push_back(buffer); } @@ -362,7 +368,7 @@ d.binNames.clear(); for (int i = 0; i < (int)d.binCount; ++i) { float freq = (m_inputSampleRate / m_blockSize) * i; - char buffer[20]; + char buffer[50]; sprintf(buffer, "%.2f Hz", freq); d.binNames.push_back(buffer); } @@ -393,11 +399,17 @@ m_blockSize = blockSize; m_binFrom = int(m_inputSampleRate / m_fmax); - m_binTo = int(m_inputSampleRate / m_fmin); + m_binTo = int(m_inputSampleRate / m_fmin); + if (m_binFrom >= (int)m_blockSize / 2) { + m_binFrom = m_blockSize / 2 - 1; + } if (m_binTo >= (int)m_blockSize / 2) { m_binTo = m_blockSize / 2 - 1; } + if (m_binTo < m_binFrom) { + m_binTo = m_binFrom; + } m_bins = (m_binTo - m_binFrom) + 1; @@ -617,7 +629,9 @@ ecep[i] = 0; } ecep[0] /= 2; - ecep[m_binFrom-1] /= 2; + if (m_binFrom > 0) { + ecep[m_binFrom-1] /= 2; + } double *env = new double[bs]; double *io = new double[bs];