{
float sample_value, data
int i, j
for (i=1i for(j=count-1j>=i,--j){
if(middle_value[j-1]=middle_value[j]{
data=middle_value[j-1]
middle_value[j-1]=middle_value[j]
middle_value[j]=data
}
}
sample_value=middle_value(count-1)/灶喊稿隐孝渗裤2]
return(sample_value)
}
float middle_filter(float middle_value [] , intcount){
纳旅 float sample_value, data
int 枝茄败i, j
猛颤for (i=1 i for(j=count-1 j>=i,--j){
if(middle_value[j-1]=middle_value[j]{
data=middle_value[j-1]
middle_value[j-1]=middle_value[j]
middle_value[j]=data
}
}
sample_value=middle_value(count-1)/2]
return(sample_value)
}
没有定义这个函数,此函数为function hd=ideal_lp(wc,M)
%Ideal Lowpass filter computation
%------------------------------------
%[hd]=ideal_lp(wc,M)
% hd=ideal impulse response between 0 to M-1
% wc=cutoff frequency in radians
% M=length of the ideal filter
%
alpha=(M-1)/2
n=[0:1:(M-1)]
m=n-alpha+eps
hd=sin(wc*m)./弊哪(pi*m)
点击file中的new中M-file,颤卜腔新建上面的函数,保存后就可以运行了
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)