c5_filterrex1.m
资源名称:speech.rar [点击查看]
上传用户:ay_070428
上传日期:2014-12-04
资源大小:11427k
文件大小:1k
源码类别:
语音合成与识别
开发平台:
Matlab
- n=40;
- order=4; %filter order
- [b,a]=butter(order,0.1);%prototype
- %
- %The following segment is the block processing implementation
- %
- int1=[1,zeros(1,n-1)];%input vector
- out1=filter(b,a,int1);%output vector
- %
- %the following segment is the sample-by-sample implementation
- %
- sreg=zeros(1,order+1);
- for k=1:n
- if k==1
- in=1;
- else
- in=0;
- end
- out=b(1)*in+sreg(1,1);%determine output
- sreg=in*b-out*a+sreg;%update register
- sreg=[sreg(1,2:(order+1)),0];%shift
- out2(k)=out;%create output vector
- end
- %
- subplot(2,1,1)
- index=0:n-1;
- stem(index,out1)
- xlabel('Sample Index')
- ylabel('Block Processing')
- subplot(2,1,2)
- index=0:n-1;
- stem(index,out2)
- xlabel('Sample Index')
- ylabel('Serial Processing')
- %End of script file