⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filter.m

📁 用于语音识别语音增强方面的matlab工具包
💻 M
字号:
function [y,zf] = filter(b,a,X,varargin)% FILTER One-dimensional digital filter.%    Y = FILTER(B,A,X) filters the data in vector X with the%    filter described by vectors A and B to create the filtered%    data Y.%%    Y = FILTER(B,A,X,'noncausal') performs noncausal filtering,%    i.e. the time information is shifted to match the group delay%    of the filter.%%    Y = FILTER(B,A,X,'causal') performs causal filtering (default),%%    Y = FILTER(B,A,X,'backwards') performs filtering on the time reversed%    signal, i.e. it flips the signal backwards before filtering and flips%    the filtered signal to obtain original time orientation% $Id: filter.m 112 2006-03-22 15:14:07Z bassus $causal = 1;backw = 0;while length(varargin)    if (strcmp(varargin{1},'noncausal') ...            || strcmp(varargin{1},'nc'))        causal=0;        varargin=varargin(2:end);    elseif (strcmp(varargin{1},'causal'))        causal=1;        varargin=varargin(2:end);    elseif strcmp(varargin{1},'backwards')        % reverse time        backw = 1;        X.s = flipud(X.s(:));        varargin=varargin(2:end);    endend[y_,zf] = filter(b,a,X.s,varargin{1:end});% set time vectortobj = X.time;if causal  t = tobj;else  grpdel_ = grpdelay(b,a);  grpdel  = grpdel_(abs(grpdel_)~=Inf);  t = tobj-mean(grpdel)/tobj.fs;endy = signal(y_,t);% set region of validityy.valid = X.valid;y.valid(1) = X.valid(1)+limpz(b,a);% turn back timeif backw    y.s = flipud(y.s(:))';end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -