OpenCores
URL https://opencores.org/ocsvn/mdct/mdct/trunk

Subversion Repositories mdct

[/] [mdct/] [trunk/] [MATLAB/] [dctf.m] - Blame information for rev 27

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 mikel262
x = [
2
   139,144,149,153,155,155,155,155;
3
   144,151,153,156,159,156,156,156;
4
   150,155,160,163,158,156,156,156;
5
   159,161,162,160,160,159,159,159;
6
   159,160,161,162,162,155,155,155;
7
   161,161,161,161,160,157,157,157;
8
   162,162,161,163,162,157,157,157;
9
   162,162,161,161,163,158,158,158;
10
 
11
   %255,144,149,153,155,155,155,155;
12
   %255,151,153,156,159,156,156,156;
13
   %255,155,160,163,158,156,156,156;
14
   %255,161,162,160,160,159,159,159;
15
   %254,160,161,162,162,155,155,155;
16
   %254,161,161,161,160,157,157,157;
17
   %254,162,161,163,162,157,157,157;
18
   %254,162,161,161,163,158,158,158;
19
 
20
];
21
 
22
% level shift input colors. This will range DC coeff to boundary 9 bits
23
xn = x-128;
24
 
25
%Cm = [
26
%   C4,  C4,  C4,  C4,  C4,  C4,  C4,  C4;
27
%   C1,  C3,  C5,  C7, -C7, -C5, -C3, -C1;
28
%   C2,  C6, -C6, -C2, -C2, -C6,  C6,  C2;
29
%   C3, -C7, -C1, -C5, -C5,  C1,  C7, -C3;
30
%   C4, -C4, -C4,  C4,  C4, -C4, -C4,  C4;
31
%   C5, -C1,  C7,  C3, -C3, -C7,  C1, -C5;
32
%   C6, -C2,  C2, -C6, -C6,  C2, -C2,  C6;
33
%   C7, -C5,  C3, -C1,  C1, -C3,  C5, -C7;
34
%   ];
35
 
36
%Cz = [
37
%   A,  A,  A,  A,  0,  0,  0,  0;
38
%   B,  C, -C, -B,  0,  0,  0,  0;
39
%   A, -A, -A,  A,  0,  0,  0,  0;
40
%   C, -B,  B, -C,  0,  0,  0,  0;
41
%   0,  0,  0,  0,  D,  E,  F,  G;
42
%   0,  0,  0,  0,  E, -G, -D, -F;
43
%   0,  0,  0,  0,  F, -D,  G,  E;
44
%   0,  0,  0,  0,  G, -F,  E, -D;
45
%   ];
46
 
47
Ye = [
48
   0;
49
   0;
50
   0;
51
   0;
52
];
53
 
54
Yo = Ye;
55
 
56
Y = [
57
   zeros(1,8);
58
   zeros(1,8);
59
   zeros(1,8);
60
   zeros(1,8);
61
   zeros(1,8);
62
   zeros(1,8);
63
   zeros(1,8);
64
   zeros(1,8);
65
];
66
 
67
Y = dct_func(xn);
68
Z = dct_func(Y);
69
 
70
 
71
Z
72
%1/2*Cm*x;
73
Y;
74
 
75
 
76
Q = [ 16,11,10,16,24,40,51,61;
77
   12,12,14,19,26,58,60,55;
78
   14,13,16,24,40,57,69,56;
79
   14,17,22,29,51,87,80,62;
80
   18,22,37,56,68,109,103,77;
81
   24,35,55,64,81,104,113,92;
82
   49,64,78,87,103,121,120,101;
83
   72,92,95,98,112,100,103,99
84
];
85
 
86
N=8;
87
% quantization
88
for i = 0:N-1
89
   for j = 0:N-1
90
      Zq(i+1,j+1) = round( Z(i+1, j+1)/Q(i+1,j+1));
91
   end
92
end
93
 
94
Zq;
95
 
96
 
97
 
98
 
99
 
100
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.