- 6
- 0
- 约7.98千字
- 约 11页
- 2018-03-16 发布于河南
- 举报
与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]
您可能关注的文档
最近下载
- 药品网络交易服务三方平台质量管理体系文件--B2C零售端平台(完整版).docx
- GB_T 13912-2020 金属覆盖层 钢铁制件热浸镀锌层 技术要求及试验方法.docx VIP
- GJB9001C设计与开发操作规范.docx VIP
- 2025-2026学年广东省深圳市福田区八年级(上)期末语文试卷.docx VIP
- DL_T 404-2018 3.6~40.5kV交流金属封闭开关设备和控制设备.docx VIP
- 二年级数学《寒假作业》每日一练.pdf VIP
- 3、紅色色母MSDS 物质安全表.pdf VIP
- 《时速160公里动力集中动车组构造与检修》 课件汇总 1 绪论 ---9 空气制动及总风系统.pptx VIP
- 机械制造工艺学全套课件.pptx
- 2026-2030中国可吸收生物钉市场深度调查与未来趋势研究研究报告.docx
原创力文档

文档评论(0)