|
楼主 |
发表于 2012-2-5 13:00
|
显示全部楼层
%%%%%%%%算法1=fft+downsample函数%%%%%%%
%实现下采样downsample过程,识别效果好于resample函数,差于decimate函数.
% temp1=fft(thist_noiseout,m);
% temp1([m/2/4+1:7*m/2/4+1],:)=0;;%注意temp1的第一个元素为直流分量.将中间高频分量滤掉.
% thist_noiseout=ifft(temp1);
% thist=downsample(thist_noiseout,4);%单纯取样,每隔4个数据取一个点.
% clear temp1 thist_noiseout
%%%%%%%%%%%%%%算法1结束%%%%%%%%%%%%%%%%
%%%%% 算法2=Butter+downsample函数 %%%%%
%采用Butterworth滤波器滤波,再下采样.
%[ord,wn]=buttord(0.2,0.25,3,60);%%阻带最大衰减60应如何设置.
%[b,a]=butter(ord,wn);
%for j=1:n,
% thist(:,j)=filtfilt(b,a,thist_noiseout(:,j));
%end
%thist=downsample(thist,4);%单纯取样,每隔4个数据取一个点.
%clear ord wn B A
%clear thist_noiseout
%%%%%%%%%%%%%%算法2结束%%%%%%%%%%%%%%%%
%%%%%%%%% 算法3=decimate函数 %%%%%%%%%%
%分析效果好于resample,可能因为resample中interp过程丢失了元数据信息.
%thist=zeros(m/4,n);
%for j=1:n,
% thist(:,j)=decimate(thist_noiseout(:,j),4);
%采样8阶Chebyshev滤波和filtfilt函数.
%end
%clear thist_noiseout
%%%%%%%%%%%%%%算法3结束%%%%%%%%%%%%%%%%
通过对比,以上三个函数滤波效果原来基本相同.cheby1滤波器通带波纹对信号通带影响原来可以忽略. |
|