ImageVerifierCode 换一换
格式:DOCX , 页数:11 ,大小:320.92KB ,
资源ID:18448163      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/18448163.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(嵌入式系统设计报告英文含代码Word文档格式.docx)为本站会员(b****4)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

嵌入式系统设计报告英文含代码Word文档格式.docx

1、5.Core Code and Explanation of SystemThe code of the system is listed as follows: /record.c record/play input using external memory#include #include math.hdsk6416_aic23.h /codec supportUint32 fs=DSK6416_AIC23_FREQ_8KHZ; /set sampling rateUint16 inputsource=DSK6416_AIC23_INPUT_MIC; / select input uns

2、igned long i,count,s;short bufferN;short buffer1SAMPLENUMBER;long m;float max;void InitForFFT();int INPUTSAMPLENUMBER,DATASAMPLENUMBER;float fWaveRSAMPLENUMBER,fWaveISAMPLENUMBER,wSAMPLENUMBER;float sin_tabSAMPLENUMBER,cos_tabSAMPLENUMBER;#pragma DATA_SECTION(buffer,.EXT_RAM) /buffer -external memor

3、yvoid main() int q,t,n,m,l,tt=0; short playing = 0; DSK6416_DIP_init(); DSK6416_LED_init(); comm_poll(); /init DSK, codec, McBSP InitForFFT(); count=0; while(1) /infinite loop if(DSK6416_DIP_get(3) = 0) /if SW#3 is pressed DSK6416_LED_on(3); /turn on LED#3 buffercount+ = input_left_sample(); if(DSK6

4、416_DIP_get(3) =1|(count=N-1) /if SW#3 is pressed DSK6416_LED_off(3); if(DSK6416_DIP_get(0)=0) /if SW#0 pressed playing = 1; while (playing = 1) DSK6416_LED_on(0); /turn on LED#0 output_left_sample(buffercount+); if(count=N-1) DSK6416_LED_off(0); for(s=50;sN/SAMPLENUMBER;s+) n=0; for(l=SAMPLENUMBER*

5、(s-1);ls*512;l+) n=l-SAMPLENUMBER*(s-1); buffer1n=bufferl; for(q=0;qSAMPLENUMBER;q+) fWaveRq=buffer1q; fWaveIq=0.0f; FFT(fWaveR,fWaveI); max=w0; m=0; for(t=0;tSAMPLENUMBER/2;t+) if(max=1046&tt513) DSK6416_LED_on(2);0) DSK6416_LED_on(1); else DSK6416_LED_on(3); DSK6416_LED_on(1); if(tt25) printf(%dn,

6、tt); DSK6416_LED_off(1); DSK6416_LED_off(2); DSK6416_LED_off(3); /for(s=1; /if(count / while (playing = 1) playing=0; /if(DSK6416_DIP_get(0)=0) /while(1)/main void FFT(float dataRSAMPLENUMBER,float dataISAMPLENUMBER) int x0,x1,x2,x3,x4,x5,x6,x7,x8,xx; int i,j,k,b,p,L; float TR,TI,temp; /* following

7、code invert sequence */ for ( i=0;ii+ ) x0=x1=x2=x3=x4=x5=x6=x7=x8=0; x0=i&0x01; x1=(i/2)& x2=(i/4)& x3=(i/8)&x4=(i/16)& x5=(i/32)& x6=(i/64)&x7=(i/128)&x8=(i/256)& /x=x0*1024+x1*512+x2*256+x3*128+x4*64+x5*32+x6*16+x7*8+x8*4+x9*2+x10; xx=x0*256+x1*128+x2*64+x3*32+x4*16+x5*8+x6*4+x7*2+x8; dataIxx=dat

8、aRi; dataRi=dataIi; dataIi=0; /* following code FFT */ for ( L=1;L0 ) b=b*2; i-; /* b= 2(L-1) */ for ( j=0;j0 ) /* p=pow(2,7-L)*j; */ p=p*2; p=p*j; for ( k=j;kk=k+2*b ) /* for (3) */ TR=dataRk; TI=dataIk; temp=dataRk+b; dataRk=dataRk+dataRk+b*cos_tabp+dataIk+b*sin_tabp; dataIk=dataIk-dataRk+b*sin_ta

9、bp+dataIk+b*cos_tabp; dataRk+b=TR-dataRk+b*cos_tabp-dataIk+b*sin_tabp; dataIk+b=TI+temp*sin_tabp-dataIk+b*cos_tabp; /* END for (3) */ /* END for (2) */ /* END for (1) */ wi=sqrt(dataRi*dataRi+dataIi*dataIi); /* END FFT */Firstly, I set the sampling fruquency as 8 Khz, and the total buffer number is

10、512000 which means that it can record the voice as long as 64 seconds. The core of the code includes three parts. One is the recording part, and the second is playing part, and the third is the FFT analysis part. While the DSP chip detect the switch three was pressed, then recording starts. Recordin

11、g is accomplished by the fuction called input_sample., which can complete the AD sampling and store the sampled value into buffer. LED three will turn off while the buffer has been filled or the switch three is uplifted. Then if you press switch zero, then playing starts, which can paly what has bee

12、n recorded. And the playing part is accomplished by the function called output_sample, which can read the discrete value in the buffer and turn in to analogy speech signal. After the palying is over, LED zero will turn off, and LED one will turn on indicating that FFT with the radix-2 analysis begin

13、s. FFT algorithm computing is accomplished by looking up to table, and the table is made up by the sine function and cosine fuction, we will get the real and imaginary parts of magnitudes. And then by the way of ergodic algorithm to find the accurate number of location of the maxmum magnitude. We wi

14、ll get the frequency by equation of, After the FFT finished, LED one will turn off, and the speech signal spectrum analyzer has fulfilled all function.6.Debugging Recording of System and Testing IllustrationEach time, FFT analyze 512 points. So I divide the whole buffer into lots of little buffer containing 512 points. The debugging processing mainly depends on the location of breakpoints. I set the breakpoint in the location of FFT analyze of each little buffer called buffer1, and when the code execute the lo

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1