课程设计基于MATLAB的语音信号的时、频域分析设计.doc

上传人:文库蛋蛋多 文档编号:4194629 上传时间:2023-04-09 格式:DOC 页数:20 大小:313.50KB
返回 下载 相关 举报
课程设计基于MATLAB的语音信号的时、频域分析设计.doc_第1页
第1页 / 共20页
课程设计基于MATLAB的语音信号的时、频域分析设计.doc_第2页
第2页 / 共20页
课程设计基于MATLAB的语音信号的时、频域分析设计.doc_第3页
第3页 / 共20页
课程设计基于MATLAB的语音信号的时、频域分析设计.doc_第4页
第4页 / 共20页
课程设计基于MATLAB的语音信号的时、频域分析设计.doc_第5页
第5页 / 共20页
点击查看更多>>
资源描述

《课程设计基于MATLAB的语音信号的时、频域分析设计.doc》由会员分享,可在线阅读,更多相关《课程设计基于MATLAB的语音信号的时、频域分析设计.doc(20页珍藏版)》请在三一办公上搜索。

1、摘 要用MATLAB对于语音信号进行分析和处理,采集语音信号后,在MATLAB软件平台进行频谱分析;并对所采集的语音信号加入干扰噪声,对加入噪声的信号进行频谱分析,设计合适的滤波器滤除噪声,恢复原信号。本次设计介绍了基于MATLAB的对语音信号的采集,处理及滤波器的设计,并使之实现的过程。关键词:MATLAB;语音信号;滤波器;加噪;除噪目 录摘要11 设计原理11.1 理论原理11.1.1采样频率11.1.2采样位数11.1.3采样定理11.1.4时域信号的FFT分析21.1.5数字信号的滤波器原理和方法21.1.6 各种不同类型滤波器的性能比较31.1.7离散傅立叶变换32 信号采集及读取

2、43 构造受干扰信号并对其进行FFT频谱分析.64 数字滤波器设计84.1 用窗函数法设计IIR带通滤波器84.2 用窗函数法设计FIR低通滤波器105信号处理125.1 IIR带通滤波125.2 FIR低通滤波146心得体会167 参考文献:161设计原理1.1 理论原理1.1.1采样频率也称为采样速度或者采样率,定义了每秒从连续信号中提取并组成离散信号的采样个数,它用赫兹(Hz)来表示。采样频率只能用于周期性采样的采样器,对于非周期性采样的采样器没有规则限制。通俗的讲采样频率是指计算机每秒钟采集多少个声音样本,是描述声音文件的音质、音调,衡量声卡、声音文件的质量标准。采样频率越高,即采样的

3、间隔时间越短,则在单位时间内计算机得到的声音样本数据就越多,对声音波形的表示也越精确。1.1.2采样位数即采样值或取样值,用来衡量声音波动变化的参数,是指声卡在采集和播放声音文件时所使用数字声音信号的二进制位数。1.1.3采样定理在进行模拟/数字信号的转换过程中,当采样频率fs.max大于信号中最高频率fmax的2倍时(fs.max=2fmax),采样之后的数字信号完整地保留了原始信号中的信息,一般实际应用中保证采样频率为信号最高频率的510倍;采样定理又称奈奎斯特定理。1.1.4时域信号的FFT分析信号的频谱分析就是计算信号的傅立叶变换。连续信号与系统的傅立叶分析显然不便于用计算机进行计算,

4、使其应用受到限制。而FFT是一种时域和频域均离散化的变换,适合数值运算,成为用计算机分析离散信号和系统的有力工具。对连续信号和系统,可以通过时域采样,应用DFT进行近似谱分析。1.1.5数字信号的滤波器原理和方法IIR数字滤波器系统函数:H(z)=(1.1)其中H(z)称为N阶IIR数字滤波器系统函数。IIR滤波器设计方法有间接和直接法,间接法是借助于模拟滤波器的设计方法进行的。其步骤是:先设计过度模拟滤波器得到系统函数Ha(s),然后将Ha(s)按某种方法转换成数字滤波器的系统函数H(z)。利用有限脉冲响应(FIR)设计滤波器。有限脉冲响应滤波器在保证幅度特性满足技术要求的同时,很容易做到有

5、严格的线性相位特性。用N表示FIR滤波器单位脉冲响应h(n)的长度,其系统函数H(z)为(1.2)H(z)是z-1的N-1次多项式,它在z平面上有N-1个零点,在原点z=0处有一个N-1重极点。因此,H(z)永远稳定。稳定和线性相位是FIR滤波器最突出的优点。1.1.6 各种不同类型滤波器的性能比较巴特沃斯滤波器具有单调下降的幅频特性;切比雪夫滤波器的幅频特性在通带或阻带有波纹特性,可以提高选择性;贝塞尔滤波器通带内有较好的线性相位特性;椭圆滤波器的选择性相对前三种是最好的,但通带和阻带内均呈现等波纹幅频特性,线性特性的非线性稍重。IIR数字滤波器最大的优点是给定一组指标时,它的阶数要比相同组

6、的FIR滤波器低得多。IIR数字滤波器的设计方法是利用模拟滤波器成熟的理论及设计图进行的,因而保留了一些典型模拟滤波器优良的幅度特性。但设计中只考虑了幅度特性,没考虑相位特性,所设计的滤波器一般是某种确定的非线性相位特性。为了得到线性相位特性,对IIR滤波器必须另外增加相位校正网络。FIR滤波器在保证幅度特性满足技术要求的同时,很容易做到有严格的线性相位特性。稳定和线性相位是FIR滤波器最突出的优点。1.1.7离散傅立叶变换 1.3其中,N为DFT变换的区间长度。2 信号采集及读取用录音工具录一段自己的声音,转化为wav格式的文件,然后保存到MATLAB的文件夹下的work文件夹中。在MATL

7、AB软件平台下,利用wavread函数对语音信号进行采样,记住采样频率和采样点数。Wavread函数调用格式:y=wavread(file),读取file所规定的wav文件,返回采样值放在向量y中。y,fs,nbits=wavread(1.wav);把语音信号进行载MATLAB仿真软件平台中,采样值放在向量y中,fs表示采样频率(hz),nbits表示采样位数。sound(y,fs,nbits);回放语音信号N=length(y);求出语音信号的长度Y=fft(y,N);傅立叶变换调用函数y为被变换的时域系列向量,N是DFT变换区间长度,当N大于y的长度时,fft函数自动在y后面补零,函数返回

8、y的N点DFT变换结果向量Y。当N小于y的长度时,fft函数计算y的前面N个元素构成的N点DFT,忽略y后面的元素。首先画出语音信号的时域波形,然后对语音信号进行频谱分析。在MATLAB中利用fft对新号进行快速傅立叶变换,得到信号的频谱特性。subplot(2,1,1);plot(y);title(原始信号波形);subplot(2,1,2);plot(abs(Y);title(原始信号频谱);程序如下:y,fs,nbits=wavread(1.wav);sound(y,fs,nbits);N=length(y);Y=fft(y,N);subplot(2,1,1);plot(y);title

9、(原始信号波形);xlabel(时间);ylabel(幅度);subplot(2,1,2);plot(abs(Y);title(原始信号频谱);xlabel(时间);ylabel(幅度);程序结果如下图:3构造受干扰信号并对其进行FFT频谱分析程序如下:y,fs,nbits=wavread (1.wav);N = length (y) ; %求出语音信号的长度noise=0.2*randn(N,1); %随机函数产生噪声Si=y+noise; %语音信号加入噪声 sound(Si);subplot(2,1,1);plot(Si);title(加噪语音信号的时域波形);xlabel(时间);yl

10、abel(幅度);S=fft(Si); %傅里叶变换subplot(2,1,2);plot(abs(S); title(加噪语音信号的频域波形); xlabel(时间);ylabel(幅度);程序结果如下图:4 数字滤波器设计4.1 用窗函数法设计IIR带通滤波器程序如下:wp=0.2*pi; ws=0.3*pi; %性能指标wdelta=ws-wp; %过渡带宽度M=ceil(3.32*pi/wdelta); %滤波器长度,朝正无穷方向舍入N=2*M+1; %窗口长度wc=(ws+wp)/2; %截止频率win=hamming(N); %因为衰减不小于50dB,所以选择海明窗,这里得到海明窗

11、的时域响应b=fir1(N-1,wc/pi,win);n=0:1:N;hi t=impz(b,1,n);%得到脉冲响应hf w=freqz(b,1,512); %得到频率响应subplot(3,1,1); stem(n,hi);xlabel(n); ylabel(幅度); title(脉冲响应);subplot(3,1,2); plot(w/pi,20*log10(abs(hf);xlabel(频率(Hz); ylabel(幅度(dB);title(频率响应);subplot(3,1,3); plot(w/pi,180/pi*unwrap(angle(hf);xlabel(频率(Hz); yl

12、abel(相位(degrees);title(频率响应);程序结果如下图:4.2 用窗函数法设计FIR低通滤波器程序如下:Ft=8000;Fp=1000;Fs=1200;wp=2*Fp/Ft;ws=2*Fs/Ft;rp=1;rs=50;p=1-10.(-rp/20);s=10.(-rs/20);fpts=wp,ws;mag=1,0;dev=p,s;n21,wn21,beta,ftype=kaiserord(fpts,mag,dev);b21=fir1(n21,wn21,kaiser(n21+1,beta);h,w=freqz(b21,1);plot(w/pi,abs(h);title(FIR低

13、通滤波器);grid;其程序结果如下图:5信号处理用设计好的数字滤波器对含噪声的语音信号进行滤波,在MATLAB中FIR滤波器利用函数fftfilt对信号进行滤波,IIR滤波器利用函数filter对信号进行滤波,在一个窗口同时画出滤波前后的波形及频谱如下图。5.1 IIR带通滤波程序如下:y,fs,nbits=wavread(1.wav);N=length(y);Noise=0.2*randn(N,1);Si=y+Noise; %语音信号加入噪声 nn=0:1:50;y=filter(b,1,Si);subplot(2,1,1); stem(Si);xlabel(n); ylabel(幅度);

14、title(滤波前信号频谱); axis(0 50 -2 2);subplot(2,1,2); stem(out);xlabel(n); ylabel(幅度);title(滤波后信号频谱); axis(0 50 -1 1);sound(y);程序结果如下图:5.2 FIR低通滤波程序如下:y,fs,nbits=wavread(1.wav);N = length (y) ; noise=0.2*randn(N,1); Si=y+noise; S=fft(Si);z21=fftfilt(b21,Si);sound(z21);m21=fft(z21);subplot(2,2,1);plot(abs(

15、S),g);title(滤波前信号的频谱);xlabel(时间);ylabel(幅度);grid;subplot(2,2,2);plot(abs(m21),r);title(滤波后信号频谱);xlabel(时间);ylabel(幅度);grid;subplot(2,2,3);plot(S);title(滤波前信号波形);xlabel(时间);ylabel(幅度);grid;subplot(2,2,4);plot(z21);title(滤波后信号波形);xlabel(时间);ylabel(幅度);grid;程序结果如下图:6心得体会通过这次课程设计,我学到了很多东西。进一步加深了对MATLAB的

16、了解。在设计的过程中我遇到了不少的问题,比如刚开始要处理的是WAV格式的语音信号,可是我发现不是所有的WAV文件都可以用WAVREAD函数读取,通过软件转化了才可以使用。在编写程序的时候遇到了很多错误,最后经过查找一些资料和自己的理解都一一纠正了。总的来说,通过这次的课程设计我对语音信号有的更多的认识,对数字信号处理的知识有了更多的理解,锻炼了我的理论与实际相结合的能力,并且熟练的应用MATLAB也加深了我对课程的理解。这次设计使我更深刻的了解MATLAB的使用方法,同时我相信,进一步加强对MATLAB的学习对我今后的学习将会起到很大的帮助。7 参考文献:1 高西全,丁玉美编著。数字信号处理西

17、安,西安电子科技大学出版社,20082 郑君里等主编,信号与系统,北京,高等教育出版社。20003 陈怀琛等编著,MATLAB及在电子信息课中的应用,北京,电子工业出版社,2002Employment tribunals sort out disagreements between employers and employees.You may need to make a claim to an employment tribunal if: you dont agree with the disciplinary action your employer has taken against

18、 you your employer dismisses you and you think that you have been dismissed unfairly.For more information about dismissal and unfair dismissal, seeDismissal.You can make a claim to an employment tribunal, even if you haventappealedagainst the disciplinary action your employer has taken against you.

19、However, if you win your case, the tribunal may reduce any compensation awarded to you as a result of your failure to appeal.Remember that in most cases you must make an application to an employment tribunal within three months of the date when the event you are complaining about happened. If your a

20、pplication is received after this time limit, the tribunal will not usually accept it.If you are worried about how the time limits apply to you, take advice from one of the organisations listed underFurther help.Employment tribunals are less formal than some other courts, but it is still a legal pro

21、cess and you will need to give evidence under an oath or affirmation.Most people find making a claim to an employment tribunal challenging. If you are thinking about making a claim to an employment tribunal, you should get help straight away from one of the organisations listed underFurther help.If

22、you are being represented by a solicitor at the tribunal, they may ask you to sign an agreement where you pay their fee out of your compensation if you win the case. This is known as adamages-based agreement. In England and Wales, your solicitor cant charge you more than 35% of your compensation if

23、you win the case.If you are thinking about signing up for a damages-based agreement, you should make sure youre clear about the terms of the agreement. It might be best to get advice from an experienced adviser, for example, at a Citizens Advice Bureau. To find your nearest CAB, including those that

24、 give advice by e-mail, click onnearest CAB.For more information about making a claim to an employment tribunal, seeEmployment tribunals.The (lack of) air up there Watch mCayman Islands-based Webb, the head of Fifas anti-racism taskforce, is in London for the Football Associations 150th anniversary

25、celebrations and will attend Citys Premier League match at Chelsea on Sunday.I am going to be at the match tomorrow and I have asked to meet Yaya Toure, he told BBC Sport.For me its about how he felt and I would like to speak to him first to find out what his experience was.Uefa hasopened disciplina

26、ry proceedings against CSKAfor the racist behaviour of their fans duringCitys 2-1 win.Michel Platini, president of European footballs governing body, has also ordered an immediate investigation into the referees actions.CSKA said they were surprised and disappointed by Toures complaint. In a stateme

27、nt the Russian side added: We found no racist insults from fans of CSKA.Age has reached the end of the beginning of a word. May be guilty in his seems to passing a lot of different life became the appearance of the same day; May be back in the past, to oneself the paranoid weird belief disillusionme

28、nt, these days, my mind has been very messy, in my mind constantly. Always feel oneself should go to do something, or write something. Twenty years of life trajectory deeply shallow, suddenly feel something, do it.一字开头的年龄已经到了尾声。或许是愧疚于自己似乎把转瞬即逝的很多个不同的日子过成了同一天的样子;或许是追溯过去,对自己那些近乎偏执的怪异信念的醒悟,这些天以来,思绪一直很凌

29、乱,在脑海中不断纠缠。总觉得自己自己似乎应该去做点什么,或者写点什么。二十年的人生轨迹深深浅浅,突然就感觉到有些事情,非做不可了。The end of our life, and can meet many things really do?而穷尽我们的一生,又能遇到多少事情是真正地非做不可?During my childhood, think lucky money and new clothes are necessary for New Year, but as the advance of the age, will be more and more found that those

30、things are optional; Junior high school, thought to have a crush on just means that the real growth, but over the past three years later, his writing of alumni in peace, suddenly found that isnt really grow up, it seems is not so important; Then in high school, think dont want to give vent to out yo

31、ur inner voice can be in the high school children of the feelings in a period, but was eventually infarction when graduation party in the throat, later again stood on the pitch he has sweat profusely, looked at his thrown a basketball hoops, suddenly found himself has already cant remember his appea

32、rance.童年时,觉得压岁钱和新衣服是过年必备,但是随着年龄的推进,会越来越发现,那些东西根本就可有可无;初中时,以为要有一场暗恋才意味着真正的成长,但三年过去后,自己心平气和的写同学录的时候,突然就发现是不是真正的成长了,好像并没有那么重要了;然后到了高中,觉得非要吐露出自己的心声才能为高中生涯里的懵懂情愫划上一个句点,但毕业晚会的时候最终还是被梗塞在了咽喉,后来再次站在他曾经挥汗如雨的球场,看着他投过篮球的球框时,突然间发现自己已经想不起他的容颜。Originally, this world, can produce a chemical reaction to an event, in

33、 addition to resolutely, have to do, and time.原来,这个世界上,对某个事件能产生化学反应的,除了非做不可的坚决,还有,时间。A persons time, your ideas are always special to clear. Want, want, line is clear, as if nothing could shake his. Also once seemed to be determined to do something, but more often is he backed out at last. Dislike h

34、is cowardice, finally found that there are a lot of love, there are a lot of miss, like shadow really have been doomed. Those who do, just green years oneself give oneself an arm injection, or is a self-righteous spiritual.一个人的时候,自己的想法总是特别地清晰。想要的,不想要的,界限明确,好像没有什么可以撼动自己。也曾经好像已经下定了决心去做某件事,但更多的时候是最后又打起

35、了退堂鼓。嫌恶过自己的怯懦,最终却发现有很多缘分,有很多错过,好像冥冥之中真的已经注定。那些曾经所谓的非做不可,只是青葱年华里自己给自己注射的一支强心剂,或者说,是自以为是的精神寄托罢了。At the moment, the sky is dark, the air is fresh factor after just rained. Suddenly thought of blue plaid shirt; Those were broken into various shapes of stationery; From the corner at the beginning of deep

36、 friendship; Have declared the end of the encounter that havent start planning. Those years, those days of do, finally, like youth, will end in our life.此刻,天空是阴暗的,空气里有着刚下过雨之后的清新因子。突然想到那件蓝格子衬衫;那些被折成各种各样形状的信纸;那段从街角深巷伊始的友谊;还有那场还没有开始就宣告了终结的邂逅计划那些年那些天的非做不可,终于和青春一样,都将在我们的人生中谢幕。Baumgartner the disappointin

37、g news: Mission aborted. r plays an important role in this mission. Starting at the ground, conditions have to be very calm - winds less than 2 mph, with no precipitation or humidity and limited cloud cover. The balloon, with capsule attached, will move through the lower level of the atmosphere (the

38、 troposphere) where our day-to-day weather lives. It will climb higher than the tip of Mount Everest (5.5 miles/8.85 kilometers), drifting even higher than the cruising altitude of commercial airliners (5.6 miles/9.17 kilometers) and into the stratosphere. As he crosses the boundary layer (called th

39、e tropopause),e can expect a lot of turbulence.The supersonic descent could happen as early as Sunda.The weatheThe balloon will slowly drift to the edge of space at 120,000 feet ( Then, I would assume, he will slowly step out onto something resembling an Olympic diving platform.Below, the Earth beco

40、mes the concrete bottom of a swimming pool that he wants to land on, but not too hard. Still, hell be traveling fast, so despite the distance, it will not be like diving into the deep end of a pool. It will be like he is diving into the shallow end. Skydiver preps for the big jumpWhen he jumps, he i

41、s expected to reach the speed of sound - 690 mph (1,110 kph) - in less than 40 seconds. Like hitting the top of the water, he will begin to slow as he approaches the more dense air closer to Earth. But this will not be enough to stop him completely.If he goes too fast or spins out of control, he has

42、 a stabilization parachute that can be deployed to slow him down. His team hopes its not needed. Instead, he plans to deploy his 270-square-foot (25-square-meter) main chute at an altitude of around 5,000 feet (1,524 meters).In order to deploy this chute successfully, he will have to slow to 172 mph

43、 (277 kph). He will have a reserve parachute that will open automatically if he loses consciousness at mach speeds.Even if everything goes as planned, it wont. Baumgartner still will free fall at a speed that would cause you and me to pass out, and no parachute is guaranteed to work higher than 25,000 feet (7,620 meters).cause there

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 办公文档 > 其他范文


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号