SpectMorph

lib/smnoisebandpartition.hh

00001 /*
00002  * Copyright (C) 2009-2010 Stefan Westerfeld
00003  *
00004  * This library is free software; you can redistribute it and/or modify it
00005  * under the terms of the GNU Lesser General Public License as published by the
00006  * Free Software Foundation; either version 3 of the License, or (at your
00007  * option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful, but WITHOUT
00010  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
00012  * for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public License
00015  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016  */
00017 
00018 
00019 #ifndef SPECTMORPH_NOISE_BAND_PARTITION_HH
00020 #define SPECTMORPH_NOISE_BAND_PARTITION_HH
00021 
00022 #include <vector>
00023 
00024 #include "smrandom.hh"
00025 
00026 namespace SpectMorph
00027 {
00028 
00029 class NoiseBandPartition
00030 {
00031   std::vector<int> band_count;
00032   std::vector<int> band_start;
00033   size_t           spectrum_size;
00034 
00035 public:
00036   NoiseBandPartition (size_t n_bands, size_t n_spectrum_bins, double mix_freq);
00037   void noise_envelope_to_spectrum (SpectMorph::Random& random_gen, const std::vector<float>& envelope, float *spectrum, double scale);
00038 
00039   size_t n_bands();
00040   size_t n_spectrum_bins();
00041 };
00042 
00043 }
00044 
00045 #endif
 All Classes Functions Variables Enumerations Enumerator