📄 deriver2.m
字号:
function[diff]=deriver2(raw,punkt)
%function[diff]=deriver2(raw,punkt)
%Savitzky & Golay 2.ordens derivasjon langs n-retning, 5,7,9...21 punkts
%antar:raw=n*m=(# retensjonstider)*(# b鴏getall)
[n,m]=size(raw);
convolute5=[2 -1 -2 -1 2];
convolute7=[5 0 -3 -4 -3 0 5];
convolute9=[28 7 -8 -17 -20 -17 -8 7 28];
convolute11=[15 6 -1 -6 -9 -10 -9 -6 -1 6 15];
convolute13=[22 11 2 -5 -10 -13 -14 -13 -10 -5 2 11 22];
convolute15=[91 52 19 -8 -29 -48 -53 -56 -53 -48 -29 -8 19 52 91];
convolute17=[40 25 12 1 -8 -15 -20 -23 -24 -23 -20 -15 -8 1 12 25 40];
convolute19=[51 34 19 6 -5 -14 -21 -26 -29 -30 -29 -26 -21 -14 -5 6 19 34 51];
convolute21=[190 133 82 37 -2 -35 -62 -83 -98 -107 -110 -107 -98 -83 -62 -35 -2 37 82 133 190];
if (punkt == 5)
convolute = convolute5;
number=7;
elseif (punkt == 7)
convolute = convolute7;
number=42;
elseif (punkt == 9)
convolute = convolute9;
number=462;
elseif (punkt == 11)
convolute = convolute11;
number=429;
elseif (punkt == 13)
convolute = convolute13;
number=1001;
elseif (punkt == 15)
convolute = convolute15;
number=6188;
elseif (punkt == 17)
convolute = convolute17;
number=3876;
elseif (punkt == 19)
convolute = convolute19;
number=6783;
else
convolute = convolute21;
number=33649;
end;
start=(punkt+1)/2;
slutt=(n+(punkt-1)/2);
for i=1:m
a(:,1)=raw(:,i);
b=conv(convolute,a);
diff(:,i)=b(start:slutt)./number;
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -