Mercurial > hg > audiostuff
comparison spandsp-0.0.6pre17/src/spandsp/awgn.h @ 4:26cd8f1ef0b1
import spandsp-0.0.6pre17
| author | Peter Meerwald <pmeerw@cosy.sbg.ac.at> |
|---|---|
| date | Fri, 25 Jun 2010 15:50:58 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 3:c6c5a16ce2f2 | 4:26cd8f1ef0b1 |
|---|---|
| 1 /* | |
| 2 * SpanDSP - a series of DSP components for telephony | |
| 3 * | |
| 4 * awgn.h - An additive Gaussian white noise generator | |
| 5 * | |
| 6 * Written by Steve Underwood <steveu@coppice.org> | |
| 7 * | |
| 8 * Copyright (C) 2001 Steve Underwood | |
| 9 * | |
| 10 * All rights reserved. | |
| 11 * | |
| 12 * This program is free software; you can redistribute it and/or modify | |
| 13 * it under the terms of the GNU Lesser General Public License version 2.1, | |
| 14 * as published by the Free Software Foundation. | |
| 15 * | |
| 16 * This program is distributed in the hope that it will be useful, | |
| 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 * GNU Lesser General Public License for more details. | |
| 20 * | |
| 21 * You should have received a copy of the GNU Lesser General Public | |
| 22 * License along with this program; if not, write to the Free Software | |
| 23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
| 24 * | |
| 25 * $Id: awgn.h,v 1.18 2009/02/10 13:06:47 steveu Exp $ | |
| 26 */ | |
| 27 | |
| 28 /*! \file */ | |
| 29 | |
| 30 /* This code is based on some demonstration code in a research | |
| 31 paper somewhere. I can't track down where I got the original from, | |
| 32 so that due recognition can be given. The original had no explicit | |
| 33 copyright notice, and I hope nobody objects to its use here. | |
| 34 | |
| 35 Having a reasonable Gaussian noise generator is pretty important for | |
| 36 telephony testing (in fact, pretty much any DSP testing), and this | |
| 37 one seems to have served me OK. Since the generation of Gaussian | |
| 38 noise is only for test purposes, and not a core system component, | |
| 39 I don't intend to worry excessively about copyright issues, unless | |
| 40 someone worries me. | |
| 41 | |
| 42 The non-core nature of this code also explains why it is unlikely | |
| 43 to ever be optimised. */ | |
| 44 | |
| 45 #if !defined(_SPANDSP_AWGN_H_) | |
| 46 #define _SPANDSP_AWGN_H_ | |
| 47 | |
| 48 /*! \page awgn_page Additive white gaussian noise (AWGN) generation | |
| 49 | |
| 50 \section awgn_page_sec_1 What does it do? | |
| 51 Adding noise is not the most useful thing in most DSP applications, but it is | |
| 52 awfully useful for test suites. | |
| 53 | |
| 54 \section awgn_page_sec_2 How does it work? | |
| 55 | |
| 56 This code is based on some demonstration code in a research paper somewhere. I | |
| 57 can't track down where I got the original from, so that due recognition can be | |
| 58 given. The original had no explicit copyright notice, and I hope nobody objects | |
| 59 to its use here. | |
| 60 | |
| 61 Having a reasonable Gaussian noise generator is pretty important for telephony | |
| 62 testing (in fact, pretty much any DSP testing), and this one seems to have | |
| 63 served me OK. Since the generation of Gaussian noise is only for test purposes, | |
| 64 and not a core system component, I don't intend to worry excessively about | |
| 65 copyright issues, unless someone worries me. | |
| 66 | |
| 67 The non-core nature of this code also explains why it is unlikely to ever be | |
| 68 optimised. | |
| 69 */ | |
| 70 | |
| 71 /*! | |
| 72 AWGN generator descriptor. This contains all the state information for an AWGN generator. | |
| 73 */ | |
| 74 typedef struct awgn_state_s awgn_state_t; | |
| 75 | |
| 76 #if defined(__cplusplus) | |
| 77 extern "C" | |
| 78 { | |
| 79 #endif | |
| 80 | |
| 81 SPAN_DECLARE(awgn_state_t *) awgn_init_dbm0(awgn_state_t *s, int idum, float level); | |
| 82 | |
| 83 SPAN_DECLARE(awgn_state_t *) awgn_init_dbov(awgn_state_t *s, int idum, float level); | |
| 84 | |
| 85 SPAN_DECLARE(int) awgn_release(awgn_state_t *s); | |
| 86 | |
| 87 SPAN_DECLARE(int) awgn_free(awgn_state_t *s); | |
| 88 | |
| 89 SPAN_DECLARE(int16_t) awgn(awgn_state_t *s); | |
| 90 | |
| 91 #if defined(__cplusplus) | |
| 92 } | |
| 93 #endif | |
| 94 | |
| 95 #endif | |
| 96 /*- End of file ------------------------------------------------------------*/ |
