# HG changeset patch # User Carl Bussey # Date 1407923259 -3600 # Node ID d58409ecd720de26b69467b4eb3f322b83ad039b # Parent 09fb76606b2b150aed51fb00ff14b41f36c54872# Parent 17a260410116a45589e87892a32992726e31c562 * Merging Chris' changes diff -r 09fb76606b2b -r d58409ecd720 FIRFilter.cpp --- 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; +} diff -r 09fb76606b2b -r d58409ecd720 Makefile --- 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 diff -r 09fb76606b2b -r d58409ecd720 Spectrogram.cpp --- 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 +}