- 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]
您可能关注的文档
最近下载
- 双氧水法制环氧氯丙烷新技术(DECH)研究进展.pdf
- 玉米密植精准调控高产技术-李少昆.pdf VIP
- 《住宅室内设计》课件——任务6 书房的功能及设计.pptx VIP
- 2025年沈阳职业技术学院高职单招职业适应性测试近5年常考版参考题库含答案解析.docx
- GBT13871.1-2022 密封元件为弹性体材料的旋转轴唇形密封圈 第1部分:尺寸和公差.pdf
- 2022年甘肃省兰州市中考体育与健康-模拟试题.pdf
- 急救小知识:如何正确拨打120.pptx
- PMC部门管理制度与作业流程,生产计划与物料控制管理规范.docx
- (2025春新改)人教版七年级英语下册全册教案.pdf
- 2024年镇江市高等专科学校单招职业技能测试题库(全国通用).docx VIP
文档评论(0)