Orthogonality of a 4x4 DCT matrix

17 ビュー (過去 30 日間)
Anonym
Anonym 2020 年 12 月 7 日
コメント済み: Bjorn Gustavsson 2022 年 9 月 26 日
I am working on a MATLAB task which deals with stain removal and Discrete Cosine tranformation.
What am I doing? I have been given a 4x4 matrix. I have then been told that it may well be orthogonal. I have to make it prove that the DCT matrix is actually orthogonal.
This is the given DCT matrix:
0.5000 0.5000 0.5000 0.5000
0.6533 0.2706 -0.2706 -0.6533
0.5000 -0.5000 -0.5000 0.5000
0.2706 -0.6533 0.6533 -0.2706
Here's the code:
function [U, C, G] = UFGDCT(N)
%
% Compute the matrices for DCT (-?-)
%
% U is the unitary "in-between" matrix
% C is the matrix of the DCT
% G is the inverse of F
%
C = zeros(N);
for row = 0:N-1
for col = 0:N-1
C(row+1, col+1) = cos(pi*row*(col+(1/2))/N);
end
end
for cols = 0:N-1
C(1,cols+1) = C(1,cols+1)/sqrt(2);
end
C = C*sqrt(2/N);
U = C;
G = C';
end
How can I do it in the simplest way? I have tried to search about finding orthogonality of a matrix, but didn't get the luch. I could not find anything that could be helpful.

回答 (2 件)

Bjorn Gustavsson
Bjorn Gustavsson 2020 年 12 月 8 日
What does it mean that a matrix is orthogonal?
What is the condition for two vectors to be orthogonal?
Answer these two questions and the easiest method will become obvious to you.
HTH

Farooq
Farooq 2022 年 9 月 24 日
Orthogonality of a matrix means that the matrix multiplied by its inverse is equal to the identity matrix.
matrix * matrix ' = I
In MATLAB you can code this for example for a matrix "x"
if x*x' == eye(size(x))
y = true
else
y = false
end
I hope this helps.
  1 件のコメント
Bjorn Gustavsson
Bjorn Gustavsson 2022 年 9 月 26 日
Well, your code is OK but it doesn't correspond to your phrasing, and your phrasing is a bit "too generous" - every matrix multiplied by its inverse should result in the identity-matrix, surely?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by