typedef unsigned int Uint32;
typedef int Int32;
typedef short Int16;
typedef unsigned short Uint16;
#define PI 3.14
#include<fastmath67x.h>
#include<math.h>
int Count;
void sin_Cal()
{
// short *AdcValue,AdcOut;
const float Fsamp = 16000.00;
const int Finp = 500;
int Nsamp;
float Tsamp;
double Ang;
short *SinOut;
// short *DacOut;
SinOut = (short *)0xc0010000;
// DacOut = (short *)0x60000554;
Nsamp = Fsamp / Finp;
Tsamp = 1 / Fsamp;
for(Count = 0; Count < Nsamp; Count++)
{
Ang = 2 * PI * Finp * Tsamp * Count;
*(SinOut + Count) = sin(Ang) * 512 + 512;
}
}
void main()
{
// Uint16 *SocValue;
// Uint16 *AdcValue;
Int16 *DacValue;
// Int16 adcOut1,adcOut2;
// Int32 Count;
Int32 outValue,clear = 0;
Int16 nseEst;
Int16 errSgl;
Int16 addSgl;
Int16 *OrgSgl;
Int16 *NseSgl;
double *kern;
// SocValue = (Uint16 *)0x60000558;
// AdcValue = (Uint16 *)0x60000554;
DacValue = (Int16 *)0x60000554;
// OrgSgl = (Int16 *)0xc0010000;
NseSgl = (Int16 *)0xc0002000;
kern = (double *)0xc0003000;
for(Count = 0; Count < 32; Count++)
{
kern[Count] = 0;
NseSgl[Count] = 0;
OrgSgl[Count] =0;
}
/* hm Input Signal Call */
sin_Cal();
OrgSgl = (Int16 *)0xc0010000;
while(1)
{
/* hm Noise Signal Read from ADC1(Input max 2V ) */
*NseSgl = *(short *) (0x60000554); /* vary the noise signal 25HZ to 3KHZ */
/* *SocValue = 0x00;
for(Count = 0; Count < 10; Count++);
*NseSgl = *AdcValue;
addSgl = *NseSgl;
*OrgSgl = Real_In();
*DacValue = adcOut | 0x1000;
*SocValue = 0x01;
for(Count = 0; Count < 100; Count++);
adcOut = *AdcValue;
*NseSgl = adcOut;*/
/* hm Input Signal added with Noise Signal */
addSgl = (*OrgSgl++) + *NseSgl;
/* hm Reinitialize Input Signal Memory */
if(clear++ > 30) {
OrgSgl = (Int16 *)0xc0010000;
clear = 0;}
outValue = 0;
for(Count = 0; Count < 32; Count++) {
outValue += *(NseSgl + Count) * *(kern + Count);}
// adcOut1 = *AdcValue;
// *OrgSgl = adcOut1;
nseEst = outValue >> 8;
errSgl = addSgl - nseEst;
for(Count = 31; Count >=0; Count--) {
*(kern + Count) = *(kern + Count) + ((2 * 0.00000001 * errSgl) * *(NseSgl + Count));
*(NseSgl + Count + 1) = *(NseSgl + Count);
}
// addSgl = addSgl;// + 2048;//>> 2;
*DacValue = addSgl | 0x1000;
for(Count = 0; Count < 40; Count++);
/* errSgl &= 0x0fff;
// errSgl = errSgl ^ 4096;
//errSgl ^=0x0800;*/
errSgl += 2048;
*DacValue = errSgl | 0x5000;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
hm_lms_Final.rar_NOISE
共32个文件
c:7个
obj:7个
cdx:2个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 136 浏览量
2022-09-14
19:33:30
上传
评论
收藏 57KB RAR 举报
温馨提示
this is the very useful program.the program condain c progarm for adaptive noise cancellaisation in c language
资源详情
资源评论
资源推荐
收起资源包目录
hm_lms_Final.rar (32个子文件)
hm_lms_Final
linker.cmd 970B
Vi_DSKC6747Rev1_BSL.lib 14KB
hm_maintest29_12.c 2KB
sine.h 2KB
hm_test.CS_
SYMBOL.DBF 821B
FILE.CDX 3KB
FILE.FPT 580B
FILE.DBF 276B
SYMBOL.FPT 1KB
SYMBOL.CDX 11KB
Sine Wave.c 1KB
hm_lmsTest.c 1KB
main.c 331B
pr_main.c 2KB
Debug.lkf 387B
hm_SinSam.c 1KB
hm_test.sbl 2KB
linker_cmd.cmd 709B
Debug
hm_test.map 7KB
Sine Wave.obj 6KB
LoopBack.out 18KB
hm_test.obj 9KB
hm_maintest29_12.obj 7KB
pr_main.obj 5KB
main.obj 5KB
hm_main.obj 9KB
hm_test.out 62KB
hm_SinSam.obj 5KB
hm_test.paf2 922B
hm_test.pjt 977B
cc_build_Debug.log 429B
hm_main.c 3KB
共 32 条
- 1
小贝德罗
- 粉丝: 85
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- C183579-123578-c1235789.jpg
- Qt5.14 绘画板 Qt Creator C++项目
- python实现Excel表格合并
- Java实现读取Excel批量发送邮件.zip
- 【java毕业设计】商城后台管理系统源码(springboot+vue+mysql+说明文档).zip
- 【java毕业设计】开发停车位管理系统(调用百度地图API)源码(springboot+vue+mysql+说明文档).zip
- 星耀软件库(升级版).apk.1
- 基于Django后端和Vue前端的多语言购物车项目设计源码
- 基于Python与Vue的浮光在线教育平台源码设计
- 31129647070291Eclipson MXS R.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0