已阅读5页,还剩10页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1.System Design SchemaThis system is called speech spectrum analyzer based on the development tools called TM320C6416. The software is tested on code composer studio 6416(CCS6416). The system can realize the function that It can analyse the spectrum of the speech signals inputted by fast fourier transform(FFT) algorithm, and then print the frequency by ergodic algorithm, which can help find the number of the maxmum magnitude location. In addition, the system also can paly the voice which was recoded before. The C6X is used to designate a member of Texas Instruments (TI) TMS320C6000 family of digital signal processors. The architecture of the C6x digital signal processor is very well suited for numerically intensive calculations. The FFT with the radix-2 algorithm is a efficient algorithm that is used for converting a time-domain signal into an equivalent frequency-domine signal , based on the discrete frouier transform(DFT), The FFT reduces considerably the computational requirements of the DFT. The DFT of a discrete-time signal x(nT) isThe FFT algorithm takes advantage of the periodicity and symmetry of the twiddle constants to reduce the computational requirements of the FFT. From the periodicity of W,and from the symmetry of WAn eight-point FFT is illustrated through the following exercise. We will see that flow graphs for higher-order FFT (larger N) can readily be obtained.figure1. Eight-point FFT flow graph using DITFor the reason that the speech signals recognition is quite hard ,so 512-point FFT has been adopted. After FFT algorithm finished, 512 magnitudes will be acquired. Then the maximum value will be found by the ergodic algorithm, and we can get the accurate frequency by the equation of , and then print it in CCS. Besides, I have set many flags to identify whether the frequency belongs to high frequency, or low frequency by the way of the LED turning on.2.Goal and Test Level of the system AchievedThe system can record the voice in surroundings, and then play what it records, besides, the system can also analyse the frequency of the recording voice by FFT algorithm. And t the analysed speech signal spectrum by C language can be a consistent with what is analysed by the built-in algorithm of CCS6416. I have compared the result produced by C language and the result of the CCS6416s built-in GUI FFT algorithm, and I can get the perfect accordance with just 0.002% deviation. So the system can reach to the purpose accurately. 3.Block Diagram and Flow Chart of System ImplementationThis system consists of three parts, one is speech signal acquisition module, and another is signal processing module, which is finished by STM320C6416 and FFT algorithm, and the last is speech sognal output module.Block Diagram is showed in figure2: figure2 block biagram of speech signal spectrum analysis systemFlow chat of system is shown in figure3:figure3 flow chart of speech signal spectrum analysis systemAfter burnprocess has been finished, the system is waiting. In the case of testing the switch has been pressed, the record function starts, and the record will finish in the condition that switch three has been uplifted or the buffer is been fulfilled with that can be observed if the LED three is off. And then if switch zero has been pressed, the system will begin to play what has record before, and playing is finished in the condition of switch zero is uplifted, the the FFT begin after LED one turning on. The frequency will be printed in the CCS6416, and while LED one turns off ,it means the FFT is over, and the whole function has been finished.4.the Key Point and Difficulties of System ImplementationThe key point of this system is the implement of FFT algorithm. FFT algorithm has to analyze the spectrum of speech signal accurately, which is hard for C language to implement. The difficulties of the system implementation lies on the FFT algorithms operatoring speed and accuracy. I adopted 512-point FFT analysis, and then I find the maximum magnitude by ergodic algorithm, which has to compare all 512 points with each other to find the maxmum magnitude. There is no doubt that it is time-consuming. So the system can not fulfilled the real-time capability of computing magnitude. 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.h#include dsk6416_aic23.h/codec supportUint32 fs=DSK6416_AIC23_FREQ_8KHZ;/set sampling rateUint16 inputsource=DSK6416_AIC23_INPUT_MIC; / select input unsigned 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 memoryvoid 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(DSK6416_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 count=0; 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*(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(maxwt) max=wt;m=t; /for(l=SAMPLENUMBER*(s-1);l=1046&tt513) DSK6416_LED_on(2); else if(tt0) DSK6416_LED_on(1); else DSK6416_LED_on(3); DSK6416_LED_on(1); DSK6416_LED_on(2); if(tt25) printf(%dn,tt); DSK6416_LED_off(1); DSK6416_LED_off(2); DSK6416_LED_off(3); /for(s=1;s=N-1) / while (playing = 1) playing=0; DSK6416_LED_on(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 code invert sequence */for ( i=0;iSAMPLENUMBER;i+ )x0=x1=x2=x3=x4=x5=x6=x7=x8=0;x0=i&0x01; x1=(i/2)&0x01; x2=(i/4)&0x01; x3=(i/8)&0x01;x4=(i/16)&0x01; x5=(i/32)&0x01; x6=(i/64)&0x01;x7=(i/128)&0x01;x8=(i/256)&0x01;/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=dataRi;for ( i=0;iSAMPLENUMBER;i+ )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; i-;p=p*j;for ( k=j;kSAMPLENUMBER;k=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_tabp+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) */for ( i=0;iSAMPLENUMBER;i+ ) wi=sqrt(dataRi*dataRi+dataIi*dataIi); /* END FFT */Firstly, I set the sampling fruquency as 8 Khz, and the total buffer number is 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. Recording 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 been 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 begins. 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 will 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 location of breakpoint, I open the view of FFT analyze of CCS6416 built-in, and compared the result printed by the FFT algorithm realized by C language and the result of the view
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 基层医院路径简化模式探索
- 2024外研版八年级英语上册期中复习:不定式和动名词作宾语(期中复习讲义)含答案
- 艾滋病暴露前预防(PrEP)与护理指南
- 重庆市南开中学2025-2026学年高三上学期12月考试语文试卷
- 历史人教版(七年级)初一上册历史期末模拟测试题及答案
- 北师大版小学语文三年级上册形近字组词区分练习卷
- 律师所聘用合同
- 西藏自治区小学六年级下学期数学毕业模拟考试-全真模拟四
- 2025年5-6月烘焙连锁加盟及品牌规模扩张工作总结
- 火锅鱼庄转让合同
- 2025年陕西交控集团社会招聘考试笔试参考题库附答案解析
- 2025年郑州水务集团有限公司招聘80人备考公基题库带答案解析
- 2025~2026学年广西名校高考模拟高三上学期第一次摸底考试数学试卷
- 2025重症5c考试真题及答案
- 电商代运营合同协议2025年条款
- 贵州二建公路考试试题(答案+解析)
- 2025年及未来5年中国电动舷外机行业市场调研及未来发展趋势预测报告
- 流行性感冒的预防课件
- 2025四川宜宾市公用事业服务集团有限公司及其子公司第一批员工招聘26人笔试考试参考题库及答案解析
- 员工5S培训课件
- 消防站消防设备安装与调试方案
评论
0/150
提交评论