/** * Xtreme Media Player a cross-platform media player. * Copyright (C) 2005-2011 Besmir Beqiri * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package xtrememp.visualization.spectrum; /** * Interface for band gain types. Band gain refers to gain applied to each band * (or bin) of the frequency spectrum generated by FFT processing. Typically * lower frequencies generally have more power than high ones. Therefore a * graphical representation of a particular sequence of audio will tend to show * mostly lower fequency bands. The purpose of the BandGain interface is to * allow developers to control the level of gain applied to each band to provide * a most even looking spectrum output. * * BainGain instances must return a table of gain values to apply to all bands * return from FFT processing. Table returned from the create method must be no * more or less than FFT.getOutputSampleSize(); * * @see FlatBandGain * @see FrequencyBandGain * * Based on KJ-DSS project by Kristofer Fudalewski (http://sirk.sytes.net). * * @author Besmir Beqiri */ public interface BandGain { /** * @param fft The FFT instance used for the spectrum analyser. * @param sampleRate The sample rate of the data to process. * * @return A band gain table. */ float[] create(FFT fft, float sampleRate); }