📄 splinenormalize.m
字号:
function [n,a]=splinenormalize(c)
% COMPONENTS/SPLINENORMALIZE Normalize a Components structure by spline envelope.
% Usage:
% [n,a]=splinenormalize(c);
%
% Input:
% c - Components object to be normalized
% Output:
% n - Components object holding normalized data
% a - Components object holding the corresponding splined envelope
%
% Used by-
% FA
% Kenneth C. Arnold <kca5@cornell.edu>, 2004-07-30
% Allocate new structures (we will overwrite them later)
n = c;
a = c;
%----- Process each component
for i=1:get(c,'nc')
npts = max(size(c.d(i).c));
%----- Extract the extrema and their coordinates
[mx, tx]=emax(abs(c.d(i).c));
%----- Fix the end to prevent wide swaying in spline
%----- by assigning the te(1) and te(n)
%----- the same values as the first and last tx and mx.
nExtrema=length(mx);
if nExtrema > 1
tx=[1;tx;npts];
%----- Fix the ends at the same as the next point
mx=[mx(1);mx;mx(end)];
a.d(i).c = spline(tx,mx,(1:npts)');
%----- Normalize the data by splined envelope
n.d(i).c = c.d(i).c ./ a.d(i).c;
else
%----- Leave data unchanged
a.d(i).c=ones(npts,1);
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -