/usr/include/svxlink/AsyncAudioDecimator.h is in libasyncaudio-dev 17.12.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | /**
@file AsyncAudioDecimator.h
@brief Decimates a higher sample rate to a lower one
@author Tobias Blomberg / SM0SVX
@date 2008-04-06
\verbatim
Original code by by Grant R. Griffin modified by Tobias Blomberg / SM0SVX.
Provided by Iowegian's "dspGuru" service (http://www.dspguru.com).
Copyright 2001, Iowegian International Corporation (http://www.iowegian.com)
The Wide Open License (WOL)
Permission to use, copy, modify, distribute and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice and this license appear in all source copies.
THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF
ANY KIND. See http://www.dspguru.com/wol.htm for more information.
\endverbatim
*/
#ifndef ASYNC_AUDIO_DECIMATOR_INCLUDED
#define ASYNC_AUDIO_DECIMATOR_INCLUDED
/****************************************************************************
*
* System Includes
*
****************************************************************************/
/****************************************************************************
*
* Project Includes
*
****************************************************************************/
#include <AsyncAudioProcessor.h>
/****************************************************************************
*
* Local Includes
*
****************************************************************************/
/****************************************************************************
*
* Forward declarations
*
****************************************************************************/
/****************************************************************************
*
* Namespace
*
****************************************************************************/
namespace Async
{
/****************************************************************************
*
* Forward declarations of classes inside of the declared namespace
*
****************************************************************************/
/****************************************************************************
*
* Defines & typedefs
*
****************************************************************************/
/****************************************************************************
*
* Exported Global Variables
*
****************************************************************************/
/****************************************************************************
*
* Class definitions
*
****************************************************************************/
/**
@brief Decimates a higher sample rate into a lower one
@author Tobias Blomberg / SM0SVX
@date 2008-04-06
This audio pipe class will decimate an audio stream down to a lower sampling
rate. Decimation is a process where the sampling rate is reduced by an
integer factor. To reduce the rate a lowpass filter must first be applied.
This filter is built into this component. However, the filter coefficients
(FIR) must be calculated manually.
Use this web page to calculate the coefficients:
http://www.dsptutor.freeuk.com/remez/RemezFIRFilterDesign.html
This implementation is based on the multirate FAQ at dspguru.com:
http://dspguru.com/info/faqs/mrfaq.htm
*/
class AudioDecimator : public AudioProcessor
{
public:
/**
* @brief Constructor
* @param decimation_factor The decimation factor
* @param filter_coeff An array holding the filter coefficients
* @param taps The numer of taps in the filter
*/
AudioDecimator(int decimation_factor, const float *filter_coeff,
int taps);
/**
* @brief Destructor
*/
~AudioDecimator(void);
protected:
/**
* @brief Process incoming samples and put them into the output buffer
* @param dest Destination buffer
* @param src Source buffer
* @param count Number of samples in the source buffer
*
* This function should be reimplemented by the inheriting class to
* do the actual processing of the incoming samples. All samples must
* be processed, otherwise they are lost and the output buffer will
* contain garbage.
*/
virtual void processSamples(float *dest, const float *src, int count);
private:
const int factor_M;
float *p_Z;
int H_size;
const float *p_H;
AudioDecimator(const AudioDecimator&);
AudioDecimator& operator=(const AudioDecimator&);
}; /* class AudioDecimator */
} /* namespace */
#endif /* ASYNC_AUDIO_DECIMATOR_INCLUDED */
/*
* This file has not been truncated
*/
|