dst_ii.sci

来自「小波分解源代码」· SCI 代码 · 共 35 行

SCI
35
字号
function s = dst_ii(x)
// dst_ii -- Discrete Sine Transform of Type II
//  Usage
//    s = dst_ii(x)
//  Inputs
//    x     signal of dyadic length
//  Outputs
//    s     discrete cosine transform, type II, of x
//
//  Description
//    The form s = dst_ii(x) computes s defined by
//        s_m = sqrt(2/N) * sum_n k_m x(n) sin( pi * m*(2n-1) / 2N )
//    where 
//        1 <= m,n <= N,  N = length(x) = length(c)
//    and k_m = [ 1           if 1 <= m <= N-1
//              [ 1/sqrt(2)   if m = N
//
//    The dst_ii is inverted by the dst_iii.
//
//  See Also
//    DetailMeyerProj, FineMeyerProj
//
//  Copyright Aldo I Maalouf

	n   = length2(x);
	rx  = matrix([ zeros(1,n) ; x ],1,2*n);
	y   = [rx zeros(1,2*n)];
	w   = - imag(mtlb_fft(y)) ;
	s   = sqrt(2/n)*w(2:n+1);
	s(n)= s(n)/sqrt(2);

endfunction 
     
    

⌨️ 快捷键说明

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