Mercurial > hg > vamp-tempogram
changeset 12:d58409ecd720
* Merging Chris' changes
author | Carl Bussey <c.bussey@se10.qmul.ac.uk> |
---|---|
date | Wed, 13 Aug 2014 10:47:39 +0100 |
parents | 09fb76606b2b (current diff) 17a260410116 (diff) |
children | 7680cc4c0073 |
files | Spectrogram.cpp |
diffstat | 3 files changed, 22 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/FIRFilter.cpp Wed Aug 13 10:45:46 2014 +0100 +++ b/FIRFilter.cpp Wed Aug 13 10:47:39 2014 +0100 @@ -14,16 +14,16 @@ FIRFilter::FIRFilter(const unsigned int lengthInput, const unsigned int numberOfCoefficients) : m_lengthInput(lengthInput), m_numberOfCoefficients(numberOfCoefficients), - fftInput(NULL), - fftCoefficients(NULL), - fftReal1(NULL), - fftImag1(NULL), - fftReal2(NULL), - fftImag2(NULL), - fftFilteredReal(NULL), - fftFilteredImag(NULL), - fftOutputReal(NULL), - fftOutputImag(NULL) + fftInput(0), + fftCoefficients(0), + fftReal1(0), + fftImag1(0), + fftReal2(0), + fftImag2(0), + fftFilteredReal(0), + fftFilteredImag(0), + fftOutputReal(0), + fftOutputImag(0) { initialise(); } @@ -65,8 +65,8 @@ fftCoefficients[i] = i < m_numberOfCoefficients ? coefficients[i] : 0.0; } - FFT::forward(m_lengthFIRFFT, fftInput, NULL, fftReal1, fftImag1); - FFT::forward(m_lengthFIRFFT, fftCoefficients, NULL, fftReal2, fftImag2); + FFT::forward(m_lengthFIRFFT, fftInput, 0, fftReal1, fftImag1); + FFT::forward(m_lengthFIRFFT, fftCoefficients, 0, fftReal2, fftImag2); //Multiply FFT coefficients. Multiplication in freq domain is convolution in time domain. for (int i = 0; i < m_lengthFIRFFT; i++){ @@ -95,5 +95,5 @@ delete []fftFilteredImag; delete []fftOutputReal; delete []fftOutputImag; - fftInput = fftCoefficients = fftReal1 = fftImag1 = fftReal2 = fftImag2 = fftFilteredReal = fftFilteredImag = fftOutputReal = fftOutputImag = NULL; -} \ No newline at end of file + fftInput = fftCoefficients = fftReal1 = fftImag1 = fftReal2 = fftImag2 = fftFilteredReal = fftFilteredImag = fftOutputReal = fftOutputImag = 0; +}
--- a/Makefile Wed Aug 13 10:45:46 2014 +0100 +++ b/Makefile Wed Aug 13 10:47:39 2014 +0100 @@ -30,6 +30,7 @@ # Edit this to the location of the Vamp plugin SDK, relative to your # project directory # +#VAMP_SDK_DIR := ../../vamp-plugin-sdk VAMP_SDK_DIR := /usr/local/include @@ -65,7 +66,7 @@ ## Uncomment these for Linux using the standard tools: -# CXXFLAGS := -I$(VAMP_SDK_DIR) -Wall -fPIC +# CXXFLAGS := -I$(VAMP_SDK_DIR) -Wall -fPIC -g # PLUGIN_EXT := .so # LDFLAGS := -shared -Wl,-soname=$(PLUGIN_LIBRARY_NAME)$(PLUGIN_EXT) $(VAMP_SDK_DIR)/libvamp-sdk.a -Wl,--version-script=vamp-plugin.map
--- a/Spectrogram.cpp Wed Aug 13 10:45:46 2014 +0100 +++ b/Spectrogram.cpp Wed Aug 13 10:47:39 2014 +0100 @@ -16,9 +16,9 @@ m_fftLength(fftLength), m_hopSize(hopSize), m_numberOfOutputBins(ceil(fftLength/2) + 1), - fftInput(NULL), - fftOutputReal(NULL), - fftOutputImag(NULL) + fftInput(0), + fftOutputReal(0), + fftOutputImag(0) { initialise(); } @@ -41,7 +41,7 @@ delete []fftOutputReal; delete []fftOutputImag; - fftInput = fftOutputReal = fftOutputImag = NULL; + fftInput = fftOutputReal = fftOutputImag = 0; } //process method @@ -66,7 +66,7 @@ fftInput[n] = 0.0; } - FFT::forward(m_fftLength, fftInput, NULL, fftOutputReal, fftOutputImag); + FFT::forward(m_fftLength, fftInput, 0, fftOutputReal, fftOutputImag); //@todo: sample at logarithmic spacing? Leave for host? for(int k = 0; k < m_numberOfOutputBins; k++){ @@ -78,4 +78,4 @@ } return spectrogramOutput; -} \ No newline at end of file +}