summaryrefslogtreecommitdiff
path: root/macros/idst1.sci
diff options
context:
space:
mode:
authorRashpat932024-08-09 11:47:44 +0530
committerGitHub2024-08-09 11:47:44 +0530
commitaf6fe82f90dcb2314a3d37a9a1e297fb0fc447f3 (patch)
tree80effebb59b2042de6635493f4831ba215f19eee /macros/idst1.sci
parentb10cff2c07747b039e3c3ee83a34d437e958356b (diff)
parent2e21edde1c1a251a60739b15e1c699172401f044 (diff)
downloadFOSSEE-Signal-Processing-Toolbox-master.tar.gz
FOSSEE-Signal-Processing-Toolbox-master.tar.bz2
FOSSEE-Signal-Processing-Toolbox-master.zip
Merge pull request #17 from avinashlalotra/masterHEADmaster
Abinash's Work
Diffstat (limited to 'macros/idst1.sci')
-rw-r--r--macros/idst1.sci51
1 files changed, 25 insertions, 26 deletions
diff --git a/macros/idst1.sci b/macros/idst1.sci
index 98fc874..f7fdc6d 100644
--- a/macros/idst1.sci
+++ b/macros/idst1.sci
@@ -1,27 +1,26 @@
-function y = idst1(x,varargin)
-//This function computes the inverse type I discrete sine transform.
-//Calling Sequence
-//Y = idst(X)
-//Y = idst(X, N)
-//Parameters
-//X: Matrix or integer
-//N: If N is given, then X is padded or trimmed to length N before computing the transform.
-//Description
-//This function computes the inverse type I discrete sine transform of Y. If N is given, then Y is padded or trimmed to length N before computing the transform. If Y is a matrix, compute the transform along the columns of the the matrix.
-//Examples
-//idst([1,3,6])
-//ans =
-// 3.97487 -2.50000 0.97487
-funcprot(0);
-rhs=argn(2);
-if(rhs<1 | rhs>2) then
- error("Wrong number of input arguments.");
-end
-select(rhs)
-case 1 then
- y=callOctave("idst",x);
-case 2 then
- y=callOctave("idst",x,varargin(1));
-end
-
+/*Description
+ This function computes the inverse type I discrete sine transform of X If N is given,
+ then X is padded or trimmed to length N before computing the transform.
+ If X is a matrix, compute the transform along the columns of the the matrix.
+Calling Sequence
+ Y = idst1(X)
+ Y = idst1(X, N)
+Parameters
+ X: Matrix or integer
+ N: If N is given, then X is padded or trimmed to length N before computing the transform.
+Examples
+ idst1([1,3,6])
+ ans =
+ 3.97487 -2.50000 0.97487 */
+function x = idst1 (y, n)
+ nargin=argn(2)
+ if (nargin < 1 || nargin > 2)
+ error("invalid input arguments")
+ end
+ if nargin == 1,
+ n = size(y,1);
+ if n==1, n = size(y,2); end
+ end
+ x = dst1(y, n) * 2/(n+1);
endfunction
+