Relations between DSTVIII and DSTVII
Contents
- Definitions
- DSTVIII matrix definition
- DSTVIII in terms of Tschebyshev polynomials
- DSTVII matrix definition
- DSTVII in terms of Tschebyshev polynomials
- Finding relations
- Check expression of DSTVIII through DSTVII
- Check expression of DSTVII through DSTVIII
- Check computation of DSTVIII transform
- Check computation of DSTVII transform
Definitions
Transform matrix is defined for operating on column-vectors y=T*x, where y, x are column-vectors, T is transform matrix
DSTVIII matrix definition

N1=9; N=N1;
k=0:N1-1; l=0:N1-1;
DST8=sin(pi/(N-1/2)*(k+1/2)'*(l+1/2)) % display DCTV matrix
DST8 =
Columns 1 through 7
0.0923 0.2737 0.4457 0.6026 0.7390 0.8502 0.9325
0.2737 0.7390 0.9830 0.9325 0.6026 0.0923 -0.4457
0.4457 0.9830 0.7390 -0.0923 -0.8502 -0.9325 -0.2737
0.6026 0.9325 -0.0923 -0.9830 -0.4457 0.7390 0.8502
0.7390 0.6026 -0.8502 -0.4457 0.9325 0.2737 -0.9830
0.8502 0.0923 -0.9325 0.7390 0.2737 -0.9830 0.6026
0.9325 -0.4457 -0.2737 0.8502 -0.9830 0.6026 0.0923
0.9830 -0.8502 0.6026 -0.2737 -0.0923 0.4457 -0.7390
1.0000 -1.0000 1.0000 -1.0000 1.0000 -1.0000 1.0000
Columns 8 through 9
0.9830 1.0000
-0.8502 -1.0000
0.6026 1.0000
-0.2737 -1.0000
-0.0923 1.0000
0.4457 -1.0000
-0.7390 1.0000
0.9325 -1.0000
-1.0000 1.0000
DSTVIII in terms of Tschebyshev polynomials
The DSTVIII matrix can be expressed in terms of Tschebyshev polynomials [1]
![$${\mathbf{DSTVIII}}\mathrm{{=}}{\mathbf{D}}_{DSTVIII}\mathrm{\cdot}{\mathrm{\left[{{W}_{l}\left({{\mathrm{\alpha}}_{k}}\right)}\right]}}_{k\mathrm{,}l}$$](DSTVIII_DSTVII_eq38273.png)
where

are roots of polynomial


alpha=sort([roots(TschebyshevV(N-1)); -1],'descend'); DST8t=zeros(N1); for l=0:N1-1, DST8t(:,l+1)=polyval(TschebyshevW(l),alpha)'; end Da8=diag(sin(1/2*pi/(N-1/2)*(k+1/2))); DST8t=Da8*DST8t % display DCTV matrix % compare DST8 and DST8t matrices (show that both definitions above are equivalent) max(max(abs(DST8-DST8t)))
DST8t =
Columns 1 through 7
0.0923 0.2737 0.4457 0.6026 0.7390 0.8502 0.9325
0.2737 0.7390 0.9830 0.9325 0.6026 0.0923 -0.4457
0.4457 0.9830 0.7390 -0.0923 -0.8502 -0.9325 -0.2737
0.6026 0.9325 -0.0923 -0.9830 -0.4457 0.7390 0.8502
0.7390 0.6026 -0.8502 -0.4457 0.9325 0.2737 -0.9830
0.8502 0.0923 -0.9325 0.7390 0.2737 -0.9830 0.6026
0.9325 -0.4457 -0.2737 0.8502 -0.9830 0.6026 0.0923
0.9830 -0.8502 0.6026 -0.2737 -0.0923 0.4457 -0.7390
1.0000 -1.0000 1.0000 -1.0000 1.0000 -1.0000 1.0000
Columns 8 through 9
0.9830 1.0000
-0.8502 -1.0000
0.6026 1.0000
-0.2737 -1.0000
-0.0923 1.0000
0.4457 -1.0000
-0.7390 1.0000
0.9325 -1.0000
-1.0000 1.0000
ans =
1.6198e-13
DSTVII matrix definition

N2=8; N=N2;
k=0:N2-1; l=0:N2-1;
DST7=sin(pi/(N+1/2)*(k+1/2)'*(l+1)) % display DCTV matrix
DST7 =
Columns 1 through 7
0.1837 0.3612 0.5264 0.6737 0.7980 0.8952 0.9618
0.5264 0.8952 0.9957 0.7980 0.3612 -0.1837 -0.6737
0.7980 0.9618 0.3612 -0.5264 -0.9957 -0.6737 0.1837
0.9618 0.5264 -0.6737 -0.8952 0.1837 0.9957 0.3612
0.9957 -0.1837 -0.9618 0.3612 0.8952 -0.5264 -0.7980
0.8952 -0.7980 -0.1837 0.9618 -0.6737 -0.3612 0.9957
0.6737 -0.9957 0.7980 -0.1837 -0.5264 0.9618 -0.8952
0.3612 -0.6737 0.8952 -0.9957 0.9618 -0.7980 0.5264
Column 8
0.9957
-0.9618
0.8952
-0.7980
0.6737
-0.5264
0.3612
-0.1837
DSTVII in terms of Tschebyshev polynomials
The DSTVII matrix can be expressed in terms of Tschebyshev polynomials [1]
![$${\mathbf{DSTVII}}\mathrm{{=}}{\mathbf{D}}_{DSTVII}\mathrm{\cdot}{\left[{{U}_{l}\left({{\mathit{\beta}}_{k}}\right)}\right]}_{k\mathrm{,}l}$$](DSTVIII_DSTVII_eq15464.png)
where

are roots of polynomial


beta=sort([roots(TschebyshevV(N))],'descend'); DST7t=zeros(N); for l=0:N2-1, DST7t(:,l+1)=polyval(TschebyshevU(l),beta)'; end Db7=diag(sin(pi/(N+1/2)*(k+1/2))); DST7t=Db7*DST7t % display DCTV matrix % compare DST7 and DST7t matrices (show that both definitions above are equivalent) max(max(abs(DST7-DST7t)))
DST7t =
Columns 1 through 7
0.1837 0.3612 0.5264 0.6737 0.7980 0.8952 0.9618
0.5264 0.8952 0.9957 0.7980 0.3612 -0.1837 -0.6737
0.7980 0.9618 0.3612 -0.5264 -0.9957 -0.6737 0.1837
0.9618 0.5264 -0.6737 -0.8952 0.1837 0.9957 0.3612
0.9957 -0.1837 -0.9618 0.3612 0.8952 -0.5264 -0.7980
0.8952 -0.7980 -0.1837 0.9618 -0.6737 -0.3612 0.9957
0.6737 -0.9957 0.7980 -0.1837 -0.5264 0.9618 -0.8952
0.3612 -0.6737 0.8952 -0.9957 0.9618 -0.7980 0.5264
Column 8
0.9957
-0.9618
0.8952
-0.7980
0.6737
-0.5264
0.3612
-0.1837
ans =
1.4100e-13
Finding relations
Because there exist relation

and

we can express DSTVIII through DSTVII
![$$\begin{array}{l}
{{\mathbf{DSTVIII}}\mathrm{{=}}{\left[{{W}_{l}\left({{\mathit{\alpha}}_{k}}\right)}\right]}_{k\mathrm{,}l}\mathrm{{=}}{\left[{\begin{array}{cc}{{U}_{l}\left({{\mathit{\beta}}_{k}}\right)}&{}\\{}&{1}\end{array}}\right]}_{k\mathrm{,}l}\mathit{\cdot}{\mathbf{B}}\mathrm{{=}}\mathrm{\left[{\begin{array}{cc}{{\left({{\mathbf{D}}_{DSTVII}}\right)}^{{-}{1}}\mathit{\cdot}{\mathbf{D}}_{DSTVII}\mathit{\cdot}{\left[{{U}_{l}\left({{\mathrm{\beta}}_{k}}\right)}\right]}_{k,l}}&{}\\{}&{1}\end{array}}\right]}\mathit{\cdot}{\mathbf{B}}\mathrm{{=}}}\\
{\mathrm{{=}}\mathrm{\left[{\begin{array}{cc}{{\left({{\mathbf{D}}_{DSTVII}}\right)}^{{-}{1}}\cdot{\mathbf{DSTVII}}}&{}\\{}&{1}\end{array}}\right]}\mathrm{\cdot}{\mathbf{B}}}
\end{array}$$](DSTVIII_DSTVII_eq84663.png)
where
![$${\mathbf{B}}\mathrm{{=}}\left[{\begin{array}{cccccc}{1}&{1}&{}&{}&{}&{}\\{}&{1}&{1}&{}&{}&{}\\{}&{}&{1}&{\mathrm{\ddots}}&{}&{}\\{}&{}&{}&{\mathrm{\ddots}}&{1}&{}\\{}&{}&{}&{}&{1}&{2}\\{1}&{\mathrm{{-}}{1}}&{1}&{\mathrm{\cdots}}&{\mathrm{{-}}{1}}&{1}\end{array}}\right]$$](DSTVIII_DSTVII_eq69746.png)
B=toeplitz([1 zeros(1,N-1)]',[1 1 zeros(1,N-length([1 1]))]); B=[B [0; B(1:end-1,end)]]; B(8,9)=2; B=[B; (-1).^(0:size(B,2)-1)];
Check expression of DSTVIII through DSTVII
![$${\mathbf{DSTVIII}}\mathrm{{=}}\left[{\begin{array}{cc}{{\left({{\mathbf{D}}_{DSTVII}}\right)}^{\mathrm{{-}}{1}}\mathrm{\cdot}{\mathbf{DSTVII}}}&{}\\{}&{1}\end{array}}\right]\mathrm{\cdot}{\mathbf{B}}$$](DSTVIII_DSTVII_eq24085.png)
DST8a=Da8*blkdiag(inv(Db7)*DST7,1)*B
% compare DST8 and DST8a matrices (show correctness of representation of DSTVIII through DSTVII)
max(max(abs(DST8-DST8a)))
DST8a =
Columns 1 through 7
0.0923 0.2737 0.4457 0.6026 0.7390 0.8502 0.9325
0.2737 0.7390 0.9830 0.9325 0.6026 0.0923 -0.4457
0.4457 0.9830 0.7390 -0.0923 -0.8502 -0.9325 -0.2737
0.6026 0.9325 -0.0923 -0.9830 -0.4457 0.7390 0.8502
0.7390 0.6026 -0.8502 -0.4457 0.9325 0.2737 -0.9830
0.8502 0.0923 -0.9325 0.7390 0.2737 -0.9830 0.6026
0.9325 -0.4457 -0.2737 0.8502 -0.9830 0.6026 0.0923
0.9830 -0.8502 0.6026 -0.2737 -0.0923 0.4457 -0.7390
1.0000 -1.0000 1.0000 -1.0000 1.0000 -1.0000 1.0000
Columns 8 through 9
0.9830 1.0000
-0.8502 -1.0000
0.6026 1.0000
-0.2737 -1.0000
-0.0923 1.0000
0.4457 -1.0000
-0.7390 1.0000
0.9325 -1.0000
-1.0000 1.0000
ans =
4.8850e-15
Check expression of DSTVII through DSTVIII
![$$\left[{\begin{array}{cc}{\mathbf{DSTVII}}&{}\\{}&{1}\end{array}}\right]\mathrm{{=}}\left[{\begin{array}{cc}{{\mathbf{D}}_{DSTVII}}&{}\\{}&{1}\end{array}}\right]\mathrm{\cdot}{\mathbf{D}}_{DSTVIII}{}^{\mathrm{{-}}{1}}\mathrm{\cdot}{\mathbf{DSTVIII}}\mathrm{\cdot}{\mathbf{B}}^{\mathrm{{-}}{1}}$$](DSTVIII_DSTVII_eq26527.png)
DST7a=blkdiag(Db7,1)*inv(Da8)*DST8*inv(B);
DST7a=DST7a(1:end-1,1:end-1)
% compare DST7 and DST7a matrices (show correctness of representation of DSTVII through DSTVIII)
max(max(abs(DST7-DST7a)))
DST7a =
Columns 1 through 7
0.1837 0.3612 0.5264 0.6737 0.7980 0.8952 0.9618
0.5264 0.8952 0.9957 0.7980 0.3612 -0.1837 -0.6737
0.7980 0.9618 0.3612 -0.5264 -0.9957 -0.6737 0.1837
0.9618 0.5264 -0.6737 -0.8952 0.1837 0.9957 0.3612
0.9957 -0.1837 -0.9618 0.3612 0.8952 -0.5264 -0.7980
0.8952 -0.7980 -0.1837 0.9618 -0.6737 -0.3612 0.9957
0.6737 -0.9957 0.7980 -0.1837 -0.5264 0.9618 -0.8952
0.3612 -0.6737 0.8952 -0.9957 0.9618 -0.7980 0.5264
Column 8
0.9957
-0.9618
0.8952
-0.7980
0.6737
-0.5264
0.3612
-0.1837
ans =
1.7208e-15
Check computation of DSTVIII transform
x=randn(N1,1); disp('x''=');disp(x'); y=DST8*x; % true result disp('y''=');disp(y'); y1=Da8*blkdiag(inv(Db7)*DST7,1)*B*x; % compute DSTVIII using DSTVII transform disp('y1''=');disp(y1');
x'=
Columns 1 through 7
0.9642 0.5201 -0.0200 -0.0348 -0.7982 1.0187 -0.1332
Columns 8 through 9
-0.7145 1.3514
y'=
Columns 1 through 7
1.0025 -0.4754 1.6154 0.9415 2.1413 -2.1092 3.9088
Columns 8 through 9
-0.8884 0.5748
y1'=
Columns 1 through 7
1.0025 -0.4754 1.6154 0.9415 2.1413 -2.1092 3.9088
Columns 8 through 9
-0.8884 0.5748
Check computation of DSTVII transform
x=randn(N2,1); disp('x''=');disp(x'); y=DST7*x; % true result disp('y''=');disp(y'); y1=blkdiag(Db7,1)*inv(Da8)*DST8*inv(B)*[x;0]; % compute DSTVII using DSTVIII transform disp('y1''=');disp(y1'); % Reference
x'=
Columns 1 through 7
-0.2248 -0.5890 -0.2938 -0.8479 -1.1201 2.5260 1.6555
Column 8
0.3075
y'=
Columns 1 through 7
2.2859 -3.8946 -0.4126 3.0927 -3.5857 0.8359 2.0049
Column 8
-1.3812
y1'=
Columns 1 through 7
2.2859 -3.8946 -0.4126 3.0927 -3.5857 0.8359 2.0049
Columns 8 through 9
-1.3812 -0.0000