Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

IIRInterpolator.cc

Go to the documentation of this file.
00001 /*
00002 
00003     FIR Interpolation class
00004     Copyright (C) 2002-2003 Jussi Laako
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020 */
00021 
00022 
00023 #include <stdio.h>
00024 #ifdef USE_INTEL_MATH
00025     #include <mathimf.h>
00026 #else
00027     #include <math.h>
00028 #endif
00029 #include <float.h>
00030 
00031 #include "dsp/IIRInterpolator.hh"
00032 
00033 
00034 clIIRInterpolator::clIIRInterpolator ()
00035 {
00036 }
00037 
00038 
00039 clIIRInterpolator::~clIIRInterpolator ()
00040 {
00041     Uninitialize();
00042 }
00043 
00044 
00045 void clIIRInterpolator::Uninitialize ()
00046 {
00047     IntBuf.Free();
00048     clIIRMultiRate::Uninitialize();
00049 }
00050 
00051 
00052 void clIIRInterpolator::Put (const float *fpSrcData, long lSrcCount)
00053 {
00054     long lWorkCount;
00055     float *fpIntBuf;
00056 
00057     lWorkCount = lSrcCount * lFactor;
00058     fpIntBuf = (float *) IntBuf.Size(lWorkCount * sizeof(float));
00059     DSP.Interpolate(fpIntBuf, fpSrcData, lFactor, lSrcCount);
00060     Process(fpIntBuf, lWorkCount);
00061     OutBuf.Put(fpIntBuf, lWorkCount);
00062 }
00063 
00064 
00065 void clIIRInterpolator::Put (const double *dpSrcData, long lSrcCount)
00066 {
00067     long lWorkCount;
00068     double *dpIntBuf;
00069 
00070     lWorkCount = lSrcCount * lFactor;
00071     dpIntBuf = (double *) IntBuf.Size(lWorkCount * sizeof(double));
00072     DSP.Interpolate(dpIntBuf, dpSrcData, lFactor, lSrcCount);
00073     Process(dpIntBuf, lWorkCount);
00074     OutBuf.Put(dpIntBuf, lWorkCount);
00075 }
00076 
00077 
00078 bool clIIRInterpolator::Get (float *fpDestData, long lDestCount)
00079 {
00080     return OutBuf.Get(fpDestData, lDestCount);
00081 }
00082 
00083 
00084 bool clIIRInterpolator::Get (double *dpDestData, long lDestCount)
00085 {
00086     return OutBuf.Get(dpDestData, lDestCount);
00087 }

Generated on Tue Mar 2 19:46:45 2004 for libDSP by doxygen 1.3.6