Mercurial > hg > aimc
annotate trunk/swig/example.py @ 268:e14c70d1b171
- Initial add of support code and modules. Not everything is working yet.
author | tomwalters |
---|---|
date | Fri, 12 Feb 2010 12:31:23 +0000 |
parents | |
children | c26222c51fb7 |
rev | line source |
---|---|
tomwalters@268 | 1 #!/usr/bin/env python |
tomwalters@268 | 2 # Copyright 2010, Thomas Walters |
tomwalters@268 | 3 # |
tomwalters@268 | 4 # AIM-C: A C++ implementation of the Auditory Image Model |
tomwalters@268 | 5 # http:#www.acousticscale.org/AIMC |
tomwalters@268 | 6 # |
tomwalters@268 | 7 # This program is free software: you can redistribute it and/or modify |
tomwalters@268 | 8 # it under the terms of the GNU General Public License as published by |
tomwalters@268 | 9 # the Free Software Foundation, either version 3 of the License, or |
tomwalters@268 | 10 # (at your option) any later version. |
tomwalters@268 | 11 # |
tomwalters@268 | 12 # This program is distributed in the hope that it will be useful, |
tomwalters@268 | 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
tomwalters@268 | 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
tomwalters@268 | 15 # GNU General Public License for more details. |
tomwalters@268 | 16 # |
tomwalters@268 | 17 # You should have received a copy of the GNU General Public License |
tomwalters@268 | 18 # along with this program. If not, see <http:#www.gnu.org/licenses/>. |
tomwalters@268 | 19 |
tomwalters@268 | 20 import aimc |
tomwalters@268 | 21 import matplotlib |
tomwalters@268 | 22 |
tomwalters@268 | 23 parameters = aimc.Parameters() |
tomwalters@268 | 24 parameters.LoadOnly('defaults.cfg') |
tomwalters@268 | 25 |
tomwalters@268 | 26 buffer_length = 1000 |
tomwalters@268 | 27 sample_rate = 44100 |
tomwalters@268 | 28 |
tomwalters@268 | 29 input_signal = aimc.SignalBank() |
tomwalters@268 | 30 input_signal.Initialize(1, buffer_length, sample_rate) |
tomwalters@268 | 31 |
tomwalters@268 | 32 filterbank = aimc.ModuleBMMPZFC(parameters) |
tomwalters@268 | 33 filterbank.Initialize(input_signal) |
tomwalters@268 | 34 |
tomwalters@268 | 35 filterbank_output = filterbank.getOutputBank() |
tomwalters@268 | 36 |
tomwalters@268 | 37 #for s in range(0, buffer_length): |