Relations between DSTVI and DSTV

Contents

Definitions

Transform matrix is defined for operating on column-vectors y=T*x, where y, x are column-vectors, T is transform matrix

DSTVI matrix definition

$$
{\mathbf{DSTVI}}\mathrm{{=}}\left\{{\cos\left({\frac{\mathit{\pi}}{{n}\mathrm{{+}}\frac{1}{2}}\left({{k}\mathrm{{+}}{1}}\right)\left({{l}\mathrm{{+}}\frac{1}{2}}\right)}\right)}\right\}
$$

N1=8; N=N1;
k=0:N1-1;  l=0:N1-1;
DST6=sin(pi/(N+1/2)*(k+1)'*(l+1/2))       % display DCTV matrix
DST6 =
  Columns 1 through 7
    0.1837    0.5264    0.7980    0.9618    0.9957    0.8952    0.6737
    0.3612    0.8952    0.9618    0.5264   -0.1837   -0.7980   -0.9957
    0.5264    0.9957    0.3612   -0.6737   -0.9618   -0.1837    0.7980
    0.6737    0.7980   -0.5264   -0.8952    0.3612    0.9618   -0.1837
    0.7980    0.3612   -0.9957    0.1837    0.8952   -0.6737   -0.5264
    0.8952   -0.1837   -0.6737    0.9957   -0.5264   -0.3612    0.9618
    0.9618   -0.6737    0.1837    0.3612   -0.7980    0.9957   -0.8952
    0.9957   -0.9618    0.8952   -0.7980    0.6737   -0.5264    0.3612
  Column 8
    0.3612
   -0.6737
    0.8952
   -0.9957
    0.9618
   -0.7980
    0.5264
   -0.1837

DSTVI in terms of Tschebyshev polynomials

The DSTVI matrix can be expressed in terms of Tschebyshev polynomials [1]

$$
{\mathbf{DSTVI}}\mathrm{{=}}{\mathrm{\left[{{W}_{l}\left({{\mathit{\alpha}}_{k}}\right)}\right]}}_{k\mathrm{,}l}
$$

where

$${\rm \alpha}_{k}=\cos\left({{{\left({k+1}\right){\rm \pi}}\over{N+{{1}\over{2}}}}}\right),k=0\ldots N-1 $$

are roots of polynomial

$${U}_{DSTVI}\mathrm{{=}}{W}_{n}$$

$${\mathbf{D}}_{DSTVI}\mathrm{{=}}{diag}{\mathrm{\left\{{\sin\left({\left({{k}{+}{1}}\right)\frac{\mathrm{\pi}}{{2}\left({{N}{+}\frac{1}{2}}\right)}}\right)}\right\}}}_{k}$$

alpha=sort([roots(TschebyshevW(N))],'descend');
DST6t=zeros(N1);
for l=0:N1-1,
    DST6t(:,l+1)=polyval(TschebyshevW(l),alpha)';
end
Da6=diag(sin(1/2*pi/(N+1/2)*(k+1)));
DST6t=Da6*DST6t                    % display DCTV matrix

% compare DST6 and DST6t matrices (show that both definitions above are equivalent)
max(max(abs(DST6-DST6t)))
DST6t =
  Columns 1 through 7
    0.1837    0.5264    0.7980    0.9618    0.9957    0.8952    0.6737
    0.3612    0.8952    0.9618    0.5264   -0.1837   -0.7980   -0.9957
    0.5264    0.9957    0.3612   -0.6737   -0.9618   -0.1837    0.7980
    0.6737    0.7980   -0.5264   -0.8952    0.3612    0.9618   -0.1837
    0.7980    0.3612   -0.9957    0.1837    0.8952   -0.6737   -0.5264
    0.8952   -0.1837   -0.6737    0.9957   -0.5264   -0.3612    0.9618
    0.9618   -0.6737    0.1837    0.3612   -0.7980    0.9957   -0.8952
    0.9957   -0.9618    0.8952   -0.7980    0.6737   -0.5264    0.3612
  Column 8
    0.3612
   -0.6737
    0.8952
   -0.9957
    0.9618
   -0.7980
    0.5264
   -0.1837
ans =
   2.3470e-13

DSTV matrix definition

$$
{\mathbf{DSTV}}\mathrm{{=}}\mathrm{\left\{{\cos\left({\frac{\mathrm{\pi}}{{n}{+}\frac{1}{2}}\left({{k}{+}{1}}\right)\left({{l}{+}{1}}\right)}\right)}\right\}}
$$

N2=8; N=N2;
k=0:N2-1;  l=0:N2-1;
DST5=sin(pi/(N+1/2)*(k+1)'*(l+1))       % display DCTV matrix
DST5 =
  Columns 1 through 7
    0.3612    0.6737    0.8952    0.9957    0.9618    0.7980    0.5264
    0.6737    0.9957    0.7980    0.1837   -0.5264   -0.9618   -0.8952
    0.8952    0.7980   -0.1837   -0.9618   -0.6737    0.3612    0.9957
    0.9957    0.1837   -0.9618   -0.3612    0.8952    0.5264   -0.7980
    0.9618   -0.5264   -0.6737    0.8952    0.1837   -0.9957    0.3612
    0.7980   -0.9618    0.3612    0.5264   -0.9957    0.6737    0.1837
    0.5264   -0.8952    0.9957   -0.7980    0.3612    0.1837   -0.6737
    0.1837   -0.3612    0.5264   -0.6737    0.7980   -0.8952    0.9618
  Column 8
    0.1837
   -0.3612
    0.5264
   -0.6737
    0.7980
   -0.8952
    0.9618
   -0.9957

DSTV in terms of Tschebyshev polynomials

The DSTV matrix can be expressed in terms of Tschebyshev polynomials [1]

$$
{\mathbf{DSTV}}\mathrm{{=}}{\mathbf{D}}_{DSTV}\mathrm{\cdot}{\mathrm{\left[{{U}_{l}\left({{\mathit{\beta}}_{k}}\right)}\right]}}_{k\mathrm{,}l}
$$

where

$${\rm \beta}_{k}=\cos\left({{{\left({k+1}\right){\rm \pi}}\over{N+{{1}\over{2}}}}}\right),k=0\ldots N-1 $$

are roots of polynomial

$${U}_{DCTVI}\mathrm{{=}}{W}_{n}$$

$${\mathbf{D}}_{DSTV}\mathrm{{=}}{diag}{\mathrm{\left\{{\sin\left({\left({{k}{+}{1}}\right)\frac{\mathrm{\pi}}{\left({{N}{+}\frac{1}{2}}\right)}}\right)}\right\}}}_{k}$$

beta=sort([roots(TschebyshevW(N))],'descend');
DST5t=zeros(N);
for l=0:N2-1,
    DST5t(:,l+1)=polyval(TschebyshevU(l),beta)';
end
Db5=diag(sin(pi/(N+1/2)*(k+1)));
DST5t=Db5*DST5t                    % display DCTV matrix

% compare DST5 and DST5t matrices (show that both definitions above are equivalent)
max(max(abs(DST5-DST5t)))
DST5t =
  Columns 1 through 7
    0.3612    0.6737    0.8952    0.9957    0.9618    0.7980    0.5264
    0.6737    0.9957    0.7980    0.1837   -0.5264   -0.9618   -0.8952
    0.8952    0.7980   -0.1837   -0.9618   -0.6737    0.3612    0.9957
    0.9957    0.1837   -0.9618   -0.3612    0.8952    0.5264   -0.7980
    0.9618   -0.5264   -0.6737    0.8952    0.1837   -0.9957    0.3612
    0.7980   -0.9618    0.3612    0.5264   -0.9957    0.6737    0.1837
    0.5264   -0.8952    0.9957   -0.7980    0.3612    0.1837   -0.6737
    0.1837   -0.3612    0.5264   -0.6737    0.7980   -0.8952    0.9618
  Column 8
    0.1837
   -0.3612
    0.5264
   -0.6737
    0.7980
   -0.8952
    0.9618
   -0.9957
ans =
   1.4100e-13

Finding relations

Because there exist relation

$${W}_{l}\mathrm{{=}}{U}_{l}\mathrm{{+}}{U}_{{l}\mathrm{{-}}{1}}$$

and

$$ \alpha _k = \beta _k, k = 0 \ldots N-1 $$

we can express DSTVI through DSTV

$$\begin{array}{l}
{{\mathbf{DSTV}}{\mathbf{I}}\mathrm{{=}}{\mathbf{D}}_{DSTVI}\mathit{\cdot}{\mathrm{\left[{{W}_{l}\left({{\mathrm{\alpha}}_{k}}\right)}\right]}}_{k\mathrm{,}l}\mathrm{{=}}{\mathbf{D}}_{DSTVI}\mathit{\cdot}{\mathrm{\left[{{V}_{l}\left({{\mathrm{\beta}}_{k}}\right)}\right]}}_{k\mathrm{,}l}\mathit{\cdot}{\mathbf{B}}\mathrm{{=}}{\mathbf{D}}_{DSTVI}\mathit{\cdot}{\mathrm{\left({{\mathbf{D}}_{DSTV}}\right)}}^{\mathrm{{-}}{1}}\mathbf{\cdot}{\mathbf{D}}_{DSTV}\mathit{\cdot}{\mathrm{\left[{{V}_{l}\left({{\mathrm{\beta}}_{k}}\right)}\right]}}_{k\mathrm{,}l}\mathit{\cdot}{\mathbf{B}}\mathrm{{=}}}\\
{\mathrm{{=}}{\mathbf{D}}_{DSTVI}\mathit{\cdot}{\mathrm{\left({{\mathbf{D}}_{DSTV}}\right)}}^{\mathrm{{-}}{1}}\mathrm{\cdot}{\mathbf{DSTV}}\mathrm{\cdot}{\mathbf{B}}}
\end{array}$$

where

$${\mathbf{B}}\mathrm{{=}}\left[{\begin{array}{ccccc}{1}&{1}&{}&{}&{}\\{}&{1}&{\mathrm{\ddots}}&{}&{}\\{}&{}&{\mathrm{\ddots}}&{1}&{}\\{}&{}&{}&{1}&{1}\\{}&{}&{}&{}&{1}\end{array}}\right]$$

B=toeplitz([1 zeros(1,N-1)]',[1  1 zeros(1,N-length([1  1]))]);

Check expression of DSTVI through DSTV

$${\mathbf{DSTVI}}\mathrm{{=}}{\mathbf{D}}_{DSTVI}\mathit{\cdot}{\left({{\mathbf{D}}_{DSTV}}\right)}^{\mathrm{{-}}{1}}\mathrm{\cdot}{\mathbf{DSTV}}\mathrm{\cdot}{\mathbf{B}}$$

DST6a=Da6*inv(Db5)*DST5*B
% compare DST6 and DST6a matrices (show correctness of representation of DSTVI through DSTV)
max(max(abs(DST6-DST6a)))
DST6a =
  Columns 1 through 7
    0.1837    0.5264    0.7980    0.9618    0.9957    0.8952    0.6737
    0.3612    0.8952    0.9618    0.5264   -0.1837   -0.7980   -0.9957
    0.5264    0.9957    0.3612   -0.6737   -0.9618   -0.1837    0.7980
    0.6737    0.7980   -0.5264   -0.8952    0.3612    0.9618   -0.1837
    0.7980    0.3612   -0.9957    0.1837    0.8952   -0.6737   -0.5264
    0.8952   -0.1837   -0.6737    0.9957   -0.5264   -0.3612    0.9618
    0.9618   -0.6737    0.1837    0.3612   -0.7980    0.9957   -0.8952
    0.9957   -0.9618    0.8952   -0.7980    0.6737   -0.5264    0.3612
  Column 8
    0.3612
   -0.6737
    0.8952
   -0.9957
    0.9618
   -0.7980
    0.5264
   -0.1837
ans =
   3.9968e-15

Check expression of DSTV through DSTVI

$${\mathbf{DSTV}}\mathrm{{=}}{\mathbf{D}}_{DSTV}\mathit{\cdot}{\left({{\mathbf{D}}_{DSTVI}}\right)}^{\mathrm{{-}}{1}}\mathrm{\cdot}{\mathbf{DSTVI}}\mathrm{\cdot}{\mathbf{B}}^{\mathrm{{-}}{1}}$$

DST5a=Db5*inv(Da6)*DST6*inv(B);
DST5a=DST5a(:,:)
% compare DST5 and DST5a matrices (show correctness of representation of DSTV through DSTVI)
max(max(abs(DST5-DST5a)))
DST5a =
  Columns 1 through 7
    0.3612    0.6737    0.8952    0.9957    0.9618    0.7980    0.5264
    0.6737    0.9957    0.7980    0.1837   -0.5264   -0.9618   -0.8952
    0.8952    0.7980   -0.1837   -0.9618   -0.6737    0.3612    0.9957
    0.9957    0.1837   -0.9618   -0.3612    0.8952    0.5264   -0.7980
    0.9618   -0.5264   -0.6737    0.8952    0.1837   -0.9957    0.3612
    0.7980   -0.9618    0.3612    0.5264   -0.9957    0.6737    0.1837
    0.5264   -0.8952    0.9957   -0.7980    0.3612    0.1837   -0.6737
    0.1837   -0.3612    0.5264   -0.6737    0.7980   -0.8952    0.9618
  Column 8
    0.1837
   -0.3612
    0.5264
   -0.6737
    0.7980
   -0.8952
    0.9618
   -0.9957
ans =
   1.2212e-15

Check computation of DSTVI transform

x=randn(N1,1);
disp('x''=');disp(x');
y=DST6*x;                      % true result
disp('y''=');disp(y');
y1=Da6*inv(Db5)*DST5*B*x;            % compute DSTVI using DSTV transform
disp('y1''=');disp(y1');
x'=
  Columns 1 through 7
    0.5080    0.2820    0.0335   -1.3337    1.1275    0.3502   -0.2991
  Column 8
    0.0229
y'=
  Columns 1 through 7
    0.2287   -0.4382    0.0918    2.5198    1.1817   -1.9736   -0.4483
  Column 8
    1.7919
y1'=
  Columns 1 through 7
    0.2287   -0.4382    0.0918    2.5198    1.1817   -1.9736   -0.4483
  Column 8
    1.7919

Check computation of DSTV transform

x=randn(N2,1);
disp('x''=');disp(x');
y=DST5*x;                      % true result
disp('y''=');disp(y');
y1=Db5*inv(Da6)*DST6*inv(B)*x;            % compute DSTV using DSTVI transform
disp('y1''=');disp(y1');
% Reference
x'=
  Columns 1 through 7
   -0.2620   -1.7502   -0.2857   -0.8314   -0.9792   -1.1564   -0.5336
  Column 8
   -2.0026
y'=
  Columns 1 through 7
   -4.8708    0.5288   -2.1227    0.2822   -0.7017    2.8241   -0.3251
  Column 8
    2.7285
y1'=
  Columns 1 through 7
   -4.8708    0.5288   -2.1227    0.2822   -0.7017    2.8241   -0.3251
  Column 8
    2.7285