diff options
author | Abinash Singh | 2024-08-08 16:31:44 +0530 |
---|---|---|
committer | Abinash Singh | 2024-08-08 16:33:51 +0530 |
commit | 1a3caa688450fd49135a1777418c7370e15bb72d (patch) | |
tree | 99447e3e11591651bbb160855fece4e7d82ffc77 /macros/idct2.sci | |
parent | f8ae45ed71b709b3308a472ca00d641d6ba0fda3 (diff) | |
download | FOSSEE-Signal-Processing-Toolbox-1a3caa688450fd49135a1777418c7370e15bb72d.tar.gz FOSSEE-Signal-Processing-Toolbox-1a3caa688450fd49135a1777418c7370e15bb72d.tar.bz2 FOSSEE-Signal-Processing-Toolbox-1a3caa688450fd49135a1777418c7370e15bb72d.zip |
Imlemented by Abinash Singh During FOSSEE Semester Long Fellowship 2024
Diffstat (limited to 'macros/idct2.sci')
-rw-r--r-- | macros/idct2.sci | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/macros/idct2.sci b/macros/idct2.sci index c48980a..890927f 100644 --- a/macros/idct2.sci +++ b/macros/idct2.sci @@ -1,29 +1,31 @@ -function y = idct2(x,varargin) -//This function computes the inverse 2-D discrete cosine transform of input matrix. -//Calling Sequence -//Y = idct2(X) -//Y = idct2(X, M, N) -//Y = idct2(X, [M, N]) -//Parameters -//X: Matrix or integer -//M, N: If specified Matrix X is padded with M rows and N columns. -//Description -// This function computes the inverse 2-D discrete cosine transform of matrix X. If M and N are specified, the input is either padded or truncated to have M rows and N columns. -//Examples -//idct2(3, 4, 6) -//ans = -// 2.811261 0.612372 -0.525856 0.250601 0.612372 -0.086516 -funcprot(0); -rhs=argn(2); -if (rhs<1 | rhs>3) then - error("Wrong number of input arguments."); -end -select(rhs) -case 1 then - y=callOctave("idct2",x) -case 2 then - y=callOctave("idct2",x,varargin(1)) -case 3 then - y=callOctave("idct2",x,varargin(1),varargin(2)) -end +/*Description + This function computes the inverse 2-D discrete cosine transform of matrix X. If M and N are specified, the input is either padded or truncated to have M rows and N columns. +Calling Sequence + Y = idct2(X) + Y = idct2(X, M, N) + Y = idct2(X, [M, N]) +Parameters + X: Matrix or integer + M, N: If specified Matrix X is padded with M rows and N columns. +Examples + idct2(3, 4, 6) + ans = + 2.811261 0.612372 -0.525856 0.250601 0.612372 -0.086516 */ +function y = idct2 (x, m, n) + funcprot(0); + rhs=argn(2); + select (rhs) + case 1 then + [m,n]=size(x); + case 2 then + n=m(2); + m=m(1); + end + if m==1 then + y=idct1(x.',n).'; + elseif n==1 then + y=idct1(x,m); + else + y=idct1(idct1(x,m).',n).'; + end endfunction |