📄 quasidct.sci
字号:
function c = QuasiDCT(x,dir)
// QuasiDCT -- Nearly Discrete Cosine Transform of Type I.
// Usage
// c = QuasiDCT(x,dir)
// Inputs
// x signal of dyadic length
// dir string direction indicator 'f' forward ; 'i' inverse
// Outputs
// c discrete cosine transform, type I, of x
//
// See Also
// CoarseMeyerCoeff, CoarseMeyerProj
// Copyright Aldo I Maalouf
n = length2(x) - 1;
// Modifications of signal and sampling of transform are
// different for forward and inverse Meyer wavelet transforms.
if ( dir == 'f' ),
x(1) = x(1)/sqrt(2); x(n+1) = x(n+1)/sqrt(2);
rx = matrix( [ x ; zeros(1,n+1) ],1,(2*n+2) );
y = [ rx zeros(1,2*n-2) ];
w = real(mtlb_fft(y)) ;
c = sqrt(2/n)*waverow(w(1:2:n+1));
c(1) = c(1)/sqrt(2);
elseif ( dir == 'i' ),
x(1) = x(1)/sqrt(2);
rx = matrix( [ x ; zeros(1,n+1) ],1,2*(n+1) );
y = rx;
w = real(mtlb_fft(y));
c = sqrt(2/(n+1))*waverow(w(1:n+2));
c(1) = c(1)/sqrt(2);
c(n+2) = c(n+2)/sqrt(2);
end
endfunction
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -