00001 #ifndef INCLUDE_SPECTRALPEAKSELECTOR_H 00002 #define INCLUDE_SPECTRALPEAKSELECTOR_H 00003 /* 00004 * This is the Loris C++ Class Library, implementing analysis, 00005 * manipulation, and synthesis of digitized sounds using the Reassigned 00006 * Bandwidth-Enhanced Additive Sound Model. 00007 * 00008 * Loris is Copyright (c) 1999-2010 by Kelly Fitz and Lippold Haken 00009 * 00010 * This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY, without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with this program; if not, write to the Free Software 00022 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00023 * 00024 * 00025 * SpectralPeakSelector.h 00026 * 00027 * Definition of a class representing a policy for selecting energy 00028 * peaks in a reassigned spectrum to be used in Partial formation. 00029 * 00030 * Kelly Fitz, 28 May 2003 00031 * loris@cerlsoundgroup.org 00032 * 00033 * http://www.cerlsoundgroup.org/Loris/ 00034 * 00035 */ 00036 00037 #include "SpectralPeaks.h" 00038 00039 // begin namespace 00040 namespace Loris { 00041 00042 class ReassignedSpectrum; 00043 00044 // --------------------------------------------------------------------------- 00045 // class SpectralPeakSelector 00046 // 00047 // A class representing the process of selecting 00048 // peaks (ridges) on a reassigned time-frequency surface. 00049 // 00050 class SpectralPeakSelector 00051 { 00052 // --- interface --- 00053 public: 00054 // construction: 00055 SpectralPeakSelector( double srate, double maxTimeCorrection ); 00056 00057 // Collect and return magnitude peaks in the lower half of the spectrum, 00058 // ignoring those having frequencies below the specified minimum (in Hz), and 00059 // those having large time corrections. 00060 // 00061 // If the minimumFrequency is unspecified, 0 Hz is used. 00062 // 00063 // There are two strategies for doing. Probably each one should be a 00064 // separate class, but for now, they are just separate functions. 00065 Peaks selectPeaks( ReassignedSpectrum & spectrum, double minFrequency = 0 ); 00066 00067 00068 // --- implementation --- 00069 private: 00070 00071 // There are two strategies for doing. Probably each one should be a 00072 // separate class, but for now, they are just separate functions. 00073 // 00074 // Currently, the reassignment minima are used. 00075 00076 Peaks selectReassignmentMinima( ReassignedSpectrum & spectrum, double minFrequency ); 00077 Peaks selectMagnitudePeaks( ReassignedSpectrum & spectrum, double minFrequency ); 00078 00079 00080 // --- member data --- 00081 00082 double mSampleRate; 00083 double mMaxTimeOffset; 00084 00085 00086 }; // end of class SpectralPeakSelector 00087 00088 } // end of namespace Loris 00089 00090 #endif /* ndef INCLUDE_SPECTRALPEAKSELECTOR_H */