- 1、本文档共11页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
与dsp有关的算法整理
1卷积:
#include stdio.h
#include volume.h
/* Global declarations */
int inp1_buffer[BUFSIZE];
int inp2_buffer[BUFSIZE]; /* processing data buffers */
int out1_buffer[BUFSIZE];
int out2_buffer[BUFSIZE];
int out3_buffer[BUFSIZE];
int out4_buffer[BUFSIZE*2];
int size = BUFSIZE;
int ain = MINGAIN;
int zhy=0;
int sk=64; /*sk代表所开的bufsize的大小,需修改它.输入文件sine.dat为32点,sine11.dat,
sin22.dat,sin33.dat,sin44.dat为64点的输入波形.*/
/* volume control variable */
unsigned int processingload = 1; /* processing routine //load value */
/* Functions */
extern void load(unsigned int loadValue);
static int processing1(int *output1, int *output2);
static int processing2(int *output2, int *output3);
static int processing3(int *input1,int *output2,int *output4);
static int processing4(int *input2, int *output1);
static void dataIO1(void);
static void dataIO2(void);
/*
* ======== main ========
*/
void main()
{
int *input1 = inp1_buffer[0];
int *input2 = inp2_buffer[0];
int *output1 = out1_buffer[0];
int *output2 = out2_buffer[0];
int *output3 = out3_buffer[0];
int *output4 = out4_buffer[0];
puts(volume example started\n);
/* loop forever */
while(TRUE)
{
/*
* Read input data using a probe-point connected to a host file.
* Write output data to a graph connected through a probe-point.
*/
dataIO1();
dataIO2();
/* apply gain */
processing4(input2,output1);
processing1(output1, output2);
processing2(output2, output3);
processing3(input1,output2,output4) ;
}
}
/*
* ======== processing ========
*
* FUNCTION: apply signal processing transform to input signal.
*
* PARAMETERS: address of input and output buffers.
*
* RETURN VALUE: TRUE.
*/
static int processing4(int *input2,int *output1)
{ int m=sk;
for(;m=0;m--)
{
*output1++ = *input2++ * ain;
}
for(;(size-m)0;m++)
{output1[m]
您可能关注的文档
- 08-第8章SNMP配置.doc
- 机车的两种启动方式试题.doc
- 20司马光第一课时.ppt
- 怎样描述物体的运动过关检测.doc
- 第八章检测题答案.doc
- 某企业java测试题答案.doc
- 单片机应用实例报告.doc
- 手绘道路铺装2.doc
- 2010-2011届高三学生优秀作文选一外语游园会&沙子.doc
- 灯光方案0103.doc
- 2023咸阳职业技术学院招聘笔试真题参考答案详解.docx
- 2023四川化工职业技术学院招聘笔试真题及参考答案详解.docx
- 2023哈尔滨职业技术学院招聘笔试真题及参考答案详解.docx
- 2023商洛职业技术学院招聘笔试真题及答案详解1套.docx
- 2023呼伦贝尔职业技术学院招聘笔试真题参考答案详解.docx
- 2023南阳农业职业学院招聘笔试真题参考答案详解.docx
- 2023天津公安警官职业学院招聘笔试真题带答案详解.docx
- 2023年上海电机学院招聘笔试真题参考答案详解.docx
- 2023年四川艺术职业学院招聘笔试真题参考答案详解.docx
- 2023安徽体育运动职业技术学院招聘笔试真题及答案详解一套.docx
文档评论(0)