首页 > 编程知识 正文

数字信号处理第4版pdf,数字信号处理的实现方法

时间:2023-05-03 06:32:05 阅读:124893 作者:4912

中国科学技术大学电子工程与信息科学系多媒体通信实验室(版权所有2000 )。

基于附录A C语言的数字信号处理算法实现

附录A1 BC中多种类型的实现

您可以在http 3360//3/DSP/c/complex use.CPP上找到此部分。

1、使用BC提供的多种支持

//BC中使用多类型的示例(Complex Use.Cpp文件) ) ) ) ) ) ) ) )。

#包含

#包含

输入主(语音) )。

{

双精度x=3.1,y=4.2;

complexz=complex(x,y );

cout 'z=' z 'n ';

cout ' andimaginaryrealpart=' imag (z ) 'n ';

cout ' zhascomplexconjugate=' conj (z ) 'n ';

返回0;

}

2、定义多个类,填写相应的成员函数

//C中的多类型调用可能不起作用,但可以自己定义多类型(Complex Use.Cpp文件) )。

class Complex{

公共:

Complex () }

完成(浮动re、浮动im );

float r () {return real; (;

float i () {return imag; (;

浮动模式()返回sqrt ) real*realimag*imag ); (;

完成操作器(完成操作器;

完成操作器- ()完成操作器;

complexoperator*(complexother;

完成操作器/(完成操作器;

隐私:

浮动实际、imag;

(; //operatoroverloadedusingamemberfunction

complex :3360 complex (浮动re,浮动im ) {

如果在阅读的过程中发现遗漏或错误,请尽快联系编辑。 网络@ cxh @

中国科学技术大学电子工程与信息科学系多媒体通信实验室(版权所有2000 )。

real=re;

imag=im;

(;

complex complex :3360操作器(complex other )。

返回完成(realother.real,imag other.imag );

(;

complex complex :3360操作器- (complex other )。

返回完成(real-other.real,imag - other.imag );

(;

complex complex :3360 operator * { complex other }

浮动x,y;

x=real * other.real-imag * other.imag;

y=real * other.imag imag * other.real;

返回完成(x,y );

(;

complex complex :3360操作器/(complex other )。

浮动x、y、l;

l=other.real * other.realother.imag * other.imag;

x=real * other.real imag * other.imag;

y=other.real * imag-real * other.imag;

x=x/l;

y=y/l;

返回完成(x

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。