gst.m

来自「工程计算MATLAB code to calculate the reortho」· M 代码 · 共 23 行

M
23
字号
function [X] = gst(N, p, I)%%MATLAB code to calculate the reorthogonalized sine tapers%%input:   N = the length of the time series data to be tapered%%         p = the number of tapers requested%%         I = the gap structure; a vector of length N %%            I(t) = 1 if there is data at time t, t=1, ..., N%%            I(t) = 0 if there is a gap at time t%%output:  X = N-by-p vector of the reorthogonalized sine tapers      %%example: N=64; p=5; I=ones(N, 1); %%         x=gst(N, p, I); B=(1:N)';V=spdiags(B,0,N,N)*(1+sparse(N,N));B=(1:p)';Q=V*[spdiags(B,0,p,p);sparse(N-p, p)];Q=Q*pi/(N+1);Q=sqrt(2/(N+1))*sin(Q); P=spdiags(I,0,N,N); X=P*Q;X=X*(X'*X)^(-.5);

⌨️ 快捷键说明

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