📄 upfirdn.m
字号:
%UPFIRDN Upsample, apply a specified FIR filter, and downsample a signal.
% UPFIRDN(X,H,P,Q) is a cascade of three systems applied to input signal X:
% (1) Upsampling by P (zero insertion).
% (2) FIR filtering with the filter specified by the impulse response
% given in H.
% (3) Downsampling by Q (throwing away samples).
% UPFIRDN uses an efficient polyphase implementation.
%
% Usually X and H are vectors, and the output is a (signal) vector.
% UPFIRDN permits matrix arguments under the following rules:
% If X is a matrix and H is a vector, each column of X is filtered through H.
% If X is a vector and H is a matrix, each column of H is used to filter X.
% If X and H are both matrices with the same number of columns, then the i-th
% column of H is used to filter the i-th column of X.
%
% Specifically, these rules are carried out as follows. Note that the length
% of the output is Ly = ceil( ((Lx-1)*P + Lh)/Q ) where Lx = length(X) and
% Lh = length(H).
%
% Input Signal X Input Filter H Output Signal Y Notes
% -----------------------------------------------------------------
% 1) length Lx vector length Lh vector length Ly vector Usual case.
% 2) Lx-by-Nx matrix length Lh vector Ly-by-Nx matrix Each column of X
% is filtered by H.
% 3) length Lx vector Lh-by-Nh matrix Ly-by-Nh matrix Each column of H is
% used to filter X.
% 4) Lx-by-N matrix Lh-by-N matrix Ly-by-N matrix i-th column of H is
% used to filter i-th
% column of X.
%
% UPFIRDN(X,H,P) uses Q=1 as the default.
% UPFIRDN(X,H) uses P=1 and Q=1 as defaults.
%
% For an easy-to-use alternative to UPFIRDN, which does not require you to
% supply a filter or compensate for the signal delay introduced by filtering,
% use RESAMPLE.
%
% See also RESAMPLE, INTERP, DECIMATE, FIR1, INTFILT.
% Author(s): James McClellan, 1-29-95
% Copyright (c) 1988-98 by The MathWorks, Inc.
% $Revision: 1.6 $ $Date: 1997/12/02 18:36:41 $
% C MEX-file.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -