資料介紹
C語言實現數字信號處理算法
附錄A1 BC下復數類型的實現
1、利用BC提供的復數支持
//BC中使用復數類型使用示例(ComplexUse.Cpp文件)
#include
#include
int main(void)
{
double x = 3.1, y = 4.2;
complex z = complex(x,y);
cout << "z = "<< z << "\n";
cout << " and imaginary real part = " << imag(z) << "\n";
cout << "z has complex conjugate = " << conj(z) << " \n";
return 0;
}
2、定義復數類,填寫相應成員函數
//C中的復數類型調用時可能不是非常好用,可自己定義復數類(ComplexUse.Cpp文件)
class Complex{
public:
Complex(){}
Complex( float re, float im );
float r(){return real;};
float i(){return imag;};
float mod(){return sqrt(real*real+imag*imag);};
Complex operator+( Complex &other );
Complex operator-( Complex &other );
Complex operator*( Complex &other );
Complex operator/( Complex &other );
private:
float real, imag;
};// Operator overloaded using a member function
Complex::Complex(float re,float im){real=re;
imag=im;
};
Complex Complex::operator+( Complex &other ){
return Complex( real + other.real, imag + other.imag );
};
Complex Complex::operator-( Complex &other ){
return Complex( real - other.real, imag - other.imag );
};
Complex Complex::operator*( Complex &other ){
float x,y;
x=real*other.real-imag*other.imag;
y=real*other.imag+imag*other.real;
return Complex( x,y );
};
Complex Complex::operator/( Complex &other ){
float x,y,l;
l=other.real*other.real+other.imag*other.imag;
x=real*other.real+imag*other.imag;
y=other.real*imag-real*other.imag;
x=x/l;
y=y/l;
return Complex(x,y);
};
附錄A1 BC下復數類型的實現
1、利用BC提供的復數支持
//BC中使用復數類型使用示例(ComplexUse.Cpp文件)
#include
#include
int main(void)
{
double x = 3.1, y = 4.2;
complex z = complex(x,y);
cout << "z = "<< z << "\n";
cout << " and imaginary real part = " << imag(z) << "\n";
cout << "z has complex conjugate = " << conj(z) << " \n";
return 0;
}
2、定義復數類,填寫相應成員函數
//C中的復數類型調用時可能不是非常好用,可自己定義復數類(ComplexUse.Cpp文件)
class Complex{
public:
Complex(){}
Complex( float re, float im );
float r(){return real;};
float i(){return imag;};
float mod(){return sqrt(real*real+imag*imag);};
Complex operator+( Complex &other );
Complex operator-( Complex &other );
Complex operator*( Complex &other );
Complex operator/( Complex &other );
private:
float real, imag;
};// Operator overloaded using a member function
Complex::Complex(float re,float im){real=re;
imag=im;
};
Complex Complex::operator+( Complex &other ){
return Complex( real + other.real, imag + other.imag );
};
Complex Complex::operator-( Complex &other ){
return Complex( real - other.real, imag - other.imag );
};
Complex Complex::operator*( Complex &other ){
float x,y;
x=real*other.real-imag*other.imag;
y=real*other.imag+imag*other.real;
return Complex( x,y );
};
Complex Complex::operator/( Complex &other ){
float x,y,l;
l=other.real*other.real+other.imag*other.imag;
x=real*other.real+imag*other.imag;
y=other.real*imag-real*other.imag;
x=x/l;
y=y/l;
return Complex(x,y);
};
下載該資料的人也在下載
下載該資料的人還在閱讀
更多 >
- 數字信號處理算法電子版資源下載 0次下載
- 數字信號處理——理論、算法與實現 42次下載
- 如何使用FPGA實現數字信號處理算法的研究 17次下載
- 數字信號處理算法C語言實現PDF電子書免費下載 79次下載
- 數字信號處理算法C語言實現PDF版電子書免費下載 0次下載
- 4個重要算法C語言實現源代碼 12次下載
- 數字信號處理C語言程序集 20次下載
- PID控制算法的C語言實現(完整版) 0次下載
- 基于FPGA的數字信號處理算法研究與高效實現 42次下載
- 數字信號處理C語言程序集 13次下載
- 數字信號處理C語言程序集 0次下載
- 數字信號處理算法程序 4次下載
- 數字信號處理單片機及其應用 1次下載
- 數字信號處理-理論算法與實現 0次下載
- 數字信號處理C語言程序集
- 數字信號處理器的特點、作用及種類 2588次閱讀
- GPU在雷達信號處理算法中的優勢 1170次閱讀
- 西門子博途S7-1200使用SCL語言實現雙重循環 6683次閱讀
- 利用數字信號處理器上的片上FIR和IIR硬件加速器 1491次閱讀
- C語言實現《別碰白塊》小游戲!全部代碼+思路注釋 1377次閱讀
- 怎么用C語言實現多態 2077次閱讀
- 使用C語言實現萬年歷星期速算法的源代碼免費下載 3210次閱讀
- 解答數字信號處理學什么 5092次閱讀
- C語言實現簡單的基數排序 1803次閱讀
- 數字信號處理選型和介紹 7599次閱讀
- c語言實現fifo算法及代碼 1.7w次閱讀
- c語言實現des加密算法詳細過程 3.5w次閱讀
- 數字信號處理技術的優點分析 1.2w次閱讀
- DSP是什么?詳解DSP又稱數字信號處理器 4.8w次閱讀
- 實數FFT算法的設計及其C語言實現 1w次閱讀
下載排行
本周
- 1DC電源插座圖紙
- 0.67 MB | 2次下載 | 免費
- 2AN158 GD32VW553 Wi-Fi開發指南
- 1.51MB | 2次下載 | 免費
- 3AN148 GD32VW553射頻硬件開發指南
- 2.07MB | 1次下載 | 免費
- 4AN111-LTC3219用戶指南
- 84.32KB | 次下載 | 免費
- 5AN153-用于電源系統管理的Linduino
- 1.38MB | 次下載 | 免費
- 6AN-283: Σ-Δ型ADC和DAC[中文版]
- 677.86KB | 次下載 | 免費
- 7SM2018E 支持可控硅調光線性恒流控制芯片
- 402.24 KB | 次下載 | 免費
- 8AN-1308: 電流檢測放大器共模階躍響應
- 545.42KB | 次下載 | 免費
本月
- 1ADI高性能電源管理解決方案
- 2.43 MB | 450次下載 | 免費
- 2免費開源CC3D飛控資料(電路圖&PCB源文件、BOM、
- 5.67 MB | 138次下載 | 1 積分
- 3基于STM32單片機智能手環心率計步器體溫顯示設計
- 0.10 MB | 130次下載 | 免費
- 4使用單片機實現七人表決器的程序和仿真資料免費下載
- 2.96 MB | 44次下載 | 免費
- 53314A函數發生器維修手冊
- 16.30 MB | 31次下載 | 免費
- 6美的電磁爐維修手冊大全
- 1.56 MB | 24次下載 | 5 積分
- 7如何正確測試電源的紋波
- 0.36 MB | 17次下載 | 免費
- 8感應筆電路圖
- 0.06 MB | 10次下載 | 免費
總榜
- 1matlab軟件下載入口
- 未知 | 935121次下載 | 10 積分
- 2開源硬件-PMP21529.1-4 開關降壓/升壓雙向直流/直流轉換器 PCB layout 設計
- 1.48MB | 420062次下載 | 10 積分
- 3Altium DXP2002下載入口
- 未知 | 233088次下載 | 10 積分
- 4電路仿真軟件multisim 10.0免費下載
- 340992 | 191367次下載 | 10 積分
- 5十天學會AVR單片機與C語言視頻教程 下載
- 158M | 183335次下載 | 10 積分
- 6labview8.5下載
- 未知 | 81581次下載 | 10 積分
- 7Keil工具MDK-Arm免費下載
- 0.02 MB | 73810次下載 | 10 積分
- 8LabVIEW 8.6下載
- 未知 | 65988次下載 | 10 積分
評論