⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cdspop.cc

📁 各种工程计算的库函数
💻 CC
📖 第 1 页 / 共 5 页
字号:
/*    DSP operations C-wrapper    Copyright (C) 2002-2005 Jussi Laako    This program is free software; you can redistribute it and/or modify    it under the terms of the GNU General Public License as published by    the Free Software Foundation; either version 2 of the License, or    (at your option) any later version.    This program is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    GNU General Public License for more details.    You should have received a copy of the GNU General Public License    along with this program; if not, write to the Free Software    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA*/#include "dsp/dspop.h"#include "dsp/DSPOp.hh"#include "dsp/IIRCascade.hh"#include "dsp/FFTDecimator.hh"#include "dsp/FIRDecimator.hh"#include "dsp/IIRDecimator.hh"#include "dsp/RecDecimator.hh"#include "dsp/FFTInterpolator.hh"#include "dsp/FIRInterpolator.hh"#include "dsp/IIRInterpolator.hh"#include "dsp/RecInterpolator.hh"#include "dsp/Filter.hh"#include "dsp/FlipBand.hh"#include "dsp/ReBuffer.hh"#ifdef DSP_X86#include "dsp/X86.h"extern bool bHave3DNow;extern bool bHaveSSE;#endifextern "C"{/* clDSPOp */void dsp_init (){    #ifdef DSP_X86    bHave3DNow = (dsp_x86_have_e3dnow()) ? true : false;    bHaveSSE = (dsp_x86_have_sse2()) ? true : false;    #endif}signed long dsp_roundf (float fSrc){    return clDSPOp::Round(fSrc);}signed long dsp_round (double dSrc){    return clDSPOp::Round(dSrc);}void dsp_addf (float *fpDest, float fSrc, long lCount){    clDSPOp::Add(fpDest, fSrc, lCount);}void dsp_add (double *dpDest, double dSrc, long lCount){    clDSPOp::Add(dpDest, dSrc, lCount);}void dsp_caddf (stpSCplx spDest, stSCplx sSrc, long lCount){    clDSPOp::Add(spDest, sSrc, lCount);}void dsp_cadd (stpDCplx spDest, stDCplx sSrc, long lCount){    clDSPOp::Add(spDest, sSrc, lCount);}void dsp_add2f (float *fpDest, const float *fpSrc, long lCount){    clDSPOp::Add(fpDest, fpSrc, lCount);}void dsp_add2 (double *dpDest, const double *dpSrc, long lCount){    clDSPOp::Add(dpDest, dpSrc, lCount);}void dsp_cadd2f (stpSCplx spDest, const stpSCplx spSrc, long lCount){    clDSPOp::Add(spDest, spSrc, lCount);}void dsp_cadd2 (stpDCplx spDest, const stpDCplx spSrc, long lCount){    clDSPOp::Add(spDest, spSrc, lCount);}void dsp_add3f (float *fpDest, const float *fpSrc1, const float *fpSrc2,    long lCount){    clDSPOp::Add(fpDest, fpSrc1, fpSrc2, lCount);}void dsp_add3 (double *dpDest, const double *dpSrc1, const double *dpSrc2,    long lCount){    clDSPOp::Add(dpDest, dpSrc1, dpSrc2, lCount);}void dsp_cadd3f (stpSCplx spDest, const stpSCplx spSrc1, const stpSCplx spSrc2,    long lCount){    clDSPOp::Add(spDest, spSrc1, spSrc2, lCount);}void dsp_cadd3 (stpDCplx spDest, const stpDCplx spSrc1, const stpDCplx spSrc2,    long lCount){    clDSPOp::Add(spDest, spSrc1, spSrc2, lCount);}void dsp_subf (float *fpDest, float fSrc, long lCount){    clDSPOp::Sub(fpDest, fSrc, lCount);}void dsp_sub (double *dpDest, double dSrc, long lCount){    clDSPOp::Sub(dpDest, dSrc, lCount);}void dsp_csubf (stpSCplx spDest, stSCplx sSrc, long lCount){    clDSPOp::Sub(spDest, sSrc, lCount);}void dsp_csub (stpDCplx spDest, stDCplx sSrc, long lCount){    clDSPOp::Sub(spDest, sSrc, lCount);}void dsp_sub2f (float *fpDest, const float *fpSrc, long lCount){    clDSPOp::Sub(fpDest, fpSrc, lCount);}void dsp_sub2 (double *dpDest, const double *dpSrc, long lCount){    clDSPOp::Sub(dpDest, dpSrc, lCount);}void dsp_csub2f (stpSCplx spDest, const stpSCplx spSrc, long lCount){    clDSPOp::Sub(spDest, spSrc, lCount);}void dsp_csub2 (stpDCplx spDest, const stpDCplx spSrc, long lCount){    clDSPOp::Sub(spDest, spSrc, lCount);}void dsp_sub3f (float *fpDest, const float *fpSrc1, const float *fpSrc2,    long lCount){    clDSPOp::Sub(fpDest, fpSrc1, fpSrc2, lCount);}void dsp_sub3 (double *dpDest, const double *dpSrc1, const double *dpSrc2,    long lCount){    clDSPOp::Sub(dpDest, dpSrc1, dpSrc2, lCount);}void dsp_csub3f (stpSCplx spDest, const stpSCplx spSrc1, const stpSCplx spSrc2,    long lCount){    clDSPOp::Sub(spDest, spSrc1, spSrc2, lCount);}void dsp_csub3 (stpDCplx spDest, const stpDCplx spSrc1, const stpDCplx spSrc2,    long lCount){    clDSPOp::Sub(spDest, spSrc1, spSrc2, lCount);}void dsp_mulf (float *fpDest, float fSrc, long lCount){    clDSPOp::Mul(fpDest, fSrc, lCount);}void dsp_mul (double *dpDest, double dSrc, long lCount){    clDSPOp::Mul(dpDest, dSrc, lCount);}void dsp_chmulf (stpSCplx spDest, float fSrc, long lCount){    clDSPOp::Mul(spDest, fSrc, lCount);}void dsp_chmul (stpDCplx spDest, double dSrc, long lCount){    clDSPOp::Mul(spDest, dSrc, lCount);}void dsp_cmulf (stpSCplx spDest, stSCplx sSrc, long lCount){    clDSPOp::Mul(spDest, sSrc, lCount);}void dsp_cmul (stpDCplx spDest, stDCplx sSrc, long lCount){    clDSPOp::Mul(spDest, sSrc, lCount);}void dsp_mulf_nip (float *fpDest, const float *fpSrc1, float fSrc2,    long lCount){    clDSPOp::Mul(fpDest, fpSrc1, fSrc2, lCount);}void dsp_mul_nip (double *dpDest, const double *dpSrc1, double dSrc2,    long lCount){    clDSPOp::Mul(dpDest, dpSrc1, dSrc2, lCount);}void dsp_mul2f (float *fpDest, const float *fpSrc, long lCount){    clDSPOp::Mul(fpDest, fpSrc, lCount);}void dsp_mul2 (double *dpDest, const double *dpSrc, long lCount){    clDSPOp::Mul(dpDest, dpSrc, lCount);}void dsp_chmul2f (stpSCplx spDest, const float *fpSrc, long lCount){    clDSPOp::Mul(spDest, fpSrc, lCount);}void dsp_chmul2 (stpDCplx spDest, const double *dpSrc, long lCount){    clDSPOp::Mul(spDest, dpSrc, lCount);}void dsp_cmul2f (stpSCplx spDest, const stpSCplx spSrc, long lCount){    clDSPOp::Mul(spDest, spSrc, lCount);}void dsp_cmul2 (stpDCplx spDest, const stpDCplx spSrc, long lCount){    clDSPOp::Mul(spDest, spSrc, lCount);}void dsp_mul3f (float *fpDest, const float *fpSrc1, const float *fpSrc2,    long lCount){    clDSPOp::Mul(fpDest, fpSrc1, fpSrc2, lCount);}void dsp_mul3 (double *dpDest, const double *dpSrc1, const double *dpSrc2,    long lCount){    clDSPOp::Mul(dpDest, dpSrc1, dpSrc2, lCount);}void dsp_cmul3f (stpSCplx spDest, const stpSCplx spSrc1, const stpSCplx spSrc2,    long lCount){    clDSPOp::Mul(spDest, spSrc1, spSrc2, lCount);}void dsp_cmul3 (stpDCplx spDest, const stpDCplx spSrc1, const stpDCplx spSrc2,    long lCount){    clDSPOp::Mul(spDest, spSrc1, spSrc2, lCount);}void dsp_ccmulf (stpSCplx spDest, const stpSCplx spSrc, long lCount){    clDSPOp::MulC(spDest, spSrc, lCount);}void dsp_ccmul (stpDCplx spDest, const stpDCplx spSrc, long lCount){    clDSPOp::MulC(spDest, spSrc, lCount);}void dsp_ccmulf_nip (stpSCplx spDest, const stpSCplx spSrc1,    const stpSCplx spSrc2, long lCount){    clDSPOp::MulC(spDest, spSrc1, spSrc2, lCount);}void dsp_ccmul_nip (stpDCplx spDest, const stpDCplx spSrc1,    const stpDCplx spSrc2, long lCount){    clDSPOp::MulC(spDest, spSrc1, spSrc2, lCount);}void dsp_divf (float *fpDest, float fSrc, long lCount){    clDSPOp::Div(fpDest, fSrc, lCount);}void dsp_div (double *dpDest, double dSrc, long lCount){    clDSPOp::Div(dpDest, dSrc, lCount);}void dsp_cdivf (stpSCplx spDest, stSCplx sSrc, long lCount){    clDSPOp::Div(spDest, sSrc, lCount);}void dsp_cdiv (stpDCplx spDest, stDCplx sSrc, long lCount){    clDSPOp::Div(spDest, sSrc, lCount);}void dsp_div2f (float *fpDest, const float *fpSrc, long lCount){    clDSPOp::Div(fpDest, fpSrc, lCount);}void dsp_div2 (double *dpDest, const double *dpSrc, long lCount){    clDSPOp::Div(dpDest, dpSrc, lCount);}void dsp_cdiv2f (stpSCplx spDest, const stpSCplx spSrc, long lCount){    clDSPOp::Div(spDest, spSrc, lCount);}void dsp_cdiv2 (stpDCplx spDest, const stpDCplx spSrc, long lCount){    clDSPOp::Div(spDest, spSrc, lCount);}void dsp_div3f (float *fpDest, const float *fpSrc1, const float *fpSrc2,    long lCount){    clDSPOp::Div(fpDest, fpSrc1, fpSrc2, lCount);}void dsp_div3 (double *dpDest, const double *dpSrc1, const double *dpSrc2,    long lCount){    clDSPOp::Div(dpDest, dpSrc1, dpSrc2, lCount);}void dsp_cdiv3f (stpSCplx spDest, const stpSCplx spSrc1, const stpSCplx spSrc2,    long lCount){    clDSPOp::Div(spDest, spSrc1, spSrc2, lCount);}void dsp_cdiv3 (stpDCplx spDest, const stpDCplx spSrc1, const stpDCplx spSrc2,    long lCount){    clDSPOp::Div(spDest, spSrc1, spSrc2, lCount);}void dsp_div1xf (float *fpVect, long lCount){    clDSPOp::Div1x(fpVect, lCount);}void dsp_div1x (double *dpVect, long lCount){    clDSPOp::Div1x(dpVect, lCount);}void dsp_div1xf_nip (float *fpDest, const float *fpSrc, long lCount){    clDSPOp::Div1x(fpDest, fpSrc, lCount);}void dsp_div1x_nip (double *dpDest, const double *dpSrc, long lCount){    clDSPOp::Div1x(dpDest, dpSrc, lCount);}void dsp_muladdf (float *fpVect, float fMul, float fAdd, long lCount){    clDSPOp::MulAdd(fpVect, fMul, fAdd, lCount);}void dsp_muladd (double *dpVect, double dMul, double dAdd, long lCount){    clDSPOp::MulAdd(dpVect, dMul, dAdd, lCount);}void dsp_muladdf_nip (float *fpDest, const float *fpSrc,     float fMul, float fAdd, long lCount){    clDSPOp::MulAdd(fpDest, fpSrc, fMul, fAdd, lCount);}void dsp_muladd_nip (double *dpDest, const double *dpSrc,    double dMul, double dAdd, long lCount){    clDSPOp::MulAdd(dpDest, dpSrc, dMul, dAdd, lCount);}void dsp_cmuladdf (stpSCplx spDest, const stpSCplx spSrc1,    const stpSCplx spSrc2, long lCount){    clDSPOp::MulAddC(spDest, spSrc1, spSrc2, lCount);}void dsp_cmuladd (stpDCplx spDest, const stpDCplx spSrc1,    const stpDCplx spSrc2, long lCount){    clDSPOp::MulAddC(spDest, spSrc1, spSrc2, lCount);}void dsp_absf (float *fpVect, long lCount){    clDSPOp::Abs(fpVect, lCount);}void dsp_abs (double *dpVect, long lCount){    clDSPOp::Abs(dpVect, lCount);}void dsp_absf_nip (float *fpDest, const float *fpSrc, long lCount){    clDSPOp::Abs(fpDest, fpSrc, lCount);}void dsp_abs_nip (double *dpDest, const double *dpSrc, long lCount){    clDSPOp::Abs(dpDest, dpSrc, lCount);}void dsp_sqrtf (float *fpVect, long lCount){    clDSPOp::Sqrt(fpVect, lCount);}void dsp_sqrt (double *dpVect, long lCount){    clDSPOp::Sqrt(dpVect, lCount);}void dsp_sqrtf_nip (float *fpDest, const float *fpSrc, long lCount){    clDSPOp::Sqrt(fpDest, fpSrc, lCount);}void dsp_sqrt_nip (double *dpDest, const double *dpSrc, long lCount){    clDSPOp::Sqrt(dpDest, dpSrc, lCount);}void dsp_zerof (float *fpVect, long lCount){    clDSPOp::Zero(fpVect, lCount);}void dsp_zero (double *dpVect, long lCount){    clDSPOp::Zero(dpVect, lCount);}void dsp_czerof (stpSCplx spVect, long lCount){    clDSPOp::Zero(spVect, lCount);}void dsp_czero (stpDCplx spVect, long lCount){    clDSPOp::Zero(spVect, lCount);}void dsp_setf (float *fpDest, float fSrc, long lCount){    clDSPOp::Set(fpDest, fSrc, lCount);}void dsp_set (double *dpDest, double dSrc, long lCount){    clDSPOp::Set(dpDest, dSrc, lCount);}void dsp_csetf (stpSCplx spDest, stSCplx sSrc, long lCount){    clDSPOp::Set(spDest, sSrc, lCount);}void dsp_cset (stpDCplx spDest, stDCplx sSrc, long lCount){    clDSPOp::Set(spDest, sSrc, lCount);}void dsp_set2f (float *fpDest, float fSrc, long lStart, long lCount,    long lLength){    clDSPOp::Set(fpDest, fSrc, lStart, lCount, lLength);}void dsp_set2 (double *dpDest, double dSrc, long lStart, long lCount,    long lLength){    clDSPOp::Set(dpDest, dSrc, lStart, lCount, lLength);}void dsp_cset2f (stpSCplx spDest, stSCplx sSrc, long lStart, long lCount,    long lLength){    clDSPOp::Set(spDest, sSrc, lStart, lCount, lLength);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -