public DetectionFunction(AudioDecoder decoder, final int sampleWindowSize,
			final int hopSize, final boolean isHamming) {
		// TODO: ACEITAR HOPSIZE NULO E, NESSE CASO, N USAR SOBREPOSIÇÃO DE
		// BANDAS
		if (decoder == null)
			throw new IllegalArgumentException("Decoder must be != null");

		if (sampleWindowSize <= 0)
			throw new IllegalArgumentException("Sample window size must be > 0");
		if (hopSize <= 0)
			throw new IllegalArgumentException("Hop size must be > 0");

		if (sampleWindowSize < hopSize)
			throw new IllegalArgumentException("Hop size must be <= sampleSize");

		// I set the parameters
		this.decoder = decoder;
		this.hopSize = hopSize;

		// I initiate the arrays of the samples, with the size of the sample
		// window
		this.samples = new float[sampleWindowSize];
		this.nextSamples = new float[sampleWindowSize];
		this.tempSamples = new float[sampleWindowSize];

		// instantiates the Fourier transform
		fft = new FFT(sampleWindowSize, decoder.getSampleRate());

		// if true, we set the window type of the fft, to be Hamming
		// (hamming will basically smooth the samples).
		if (isHamming)
			fft.window(FFT.HAMMING);

		// catches the first two arrays of samples from the audio decoder
		decoder.readSamples(samples);
		decoder.readSamples(nextSamples);
	}