fspe.m
来自「A MATLAB tool for analysis of Transient 」· M 代码 · 共 48 行
M
48 行
function y=fspe(B,A,x,fs,bw)
%FSPE filters the input data with filters in filterbank .
%
% y=fspe(B,A,x)
%
% y=fspe(B,A,x,fs,bw) to smooth squared time signals with
% length fs/bw gauss-window
%
% in: B,A filter coefficients G(z)=B(z)/A(z) in filterbanks
% x signal to be filtered
% fs sampling frequency
% bw bandwidths of the filters (Hz)
%
% out: y matrix containing the filtered signals as columns
% (c) Pekka Kumpulainen 16.6.1993 (PK 4.8.-93)
% PK 2.10.1997 localfrfilt
[M,N]=size(x);
if M<N; x=x.';M=N; end;
y=zeros(M,A(2));xz=[x;zeros(512,1)];tmp=zeros(M+512,1);
for ii=1:A(2);
% tmp(:)=filtfilt(getmat(B,ii),getmat(A,ii),xz);
tmp(:)=localfrfilt(getmat(B,ii),getmat(A,ii),xz);
y(:,ii)=tmp(1:M);
end
if nargin == 5
%smrf1=zeros(size(rf1));
for ii=1:length(bw);
%smrf1(:,ii)=smooth(rf1(:,ii).^2,gaussw(fs/bw(ii)));
y(:,ii)=smooth(y(:,ii).^2,gaussw(fs/bw(ii)));
end
end
%%%%%%%%%%%%%%%%%%%
%%% localfrfilt %%%
%%%%%%%%%%%%%%%%%%%
function y = localfrfilt(b,a,x)
y = filter(b,a,x);
y = filter(b,a,y(end:-1:1));
y = y(end:-1:1);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?