From c0c0582462720ed597b00e116506570577614e89 Mon Sep 17 00:00:00 2001 From: shamikam Date: Tue, 7 Nov 2017 15:59:48 +0530 Subject: initial commit --- macros/fracshift.sci | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 macros/fracshift.sci (limited to 'macros/fracshift.sci') diff --git a/macros/fracshift.sci b/macros/fracshift.sci new file mode 100644 index 0000000..fc02579 --- /dev/null +++ b/macros/fracshift.sci @@ -0,0 +1,42 @@ +function [y, h] = fracshift( x, d, h ) +//This function shifts the series x supplied as input argument by a number of samples d. +//Calling Sequence +//y = fracshift(x, d) +//y = fracshift(x, d, h) +//[y, h] = fracshift(...) +//Parameters +//x: +//d: +//h: +//Description +//This is an Octave function. +//This function shifts the series x supplied as input argument by a number of samples d. +//The third parameter is the interpolator, which is designed with a Kaiser-windowed sinecard by default, if not supplied. +//Examples +//fracshift([1,2,3],5) +//ans = +// 1. 2. 3. + +funcprot(0); +lhs = argn(1) +rhs = argn(2) +if(rhs<2 | rhs>3) +error("Wrong number of input arguments.") +end + + select(rhs) + case 2 then + if(lhs==1) + y = callOctave("fracshift",x,d) + elseif(lhs==2) + [y,h] = callOctave("fracshift",x,d) + end + case 3 then + if(lhs==1) + [y] = callOctave("fracshift",x,d,h) + elseif(lhs==2) + [y,h] = callOctave("fracshift",x,d,h) + end + end +endfunction + -- cgit