summaryrefslogtreecommitdiff
path: root/macros/gmonopuls.sci
blob: 82bcaa896fb4d47d0542c9e08d4e7062864a84a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (C) 2018 - IIT Bombay - FOSSEE
//
// This file must be used under the terms of the CeCILL.
// This source file is licensed as described in the file COPYING, which
// you should have received as part of this distribution.  The terms
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
// Author:[insert name]
// Organization: FOSSEE, IIT Bombay
// Email: toolbox@scilab.in

function y = gmonopuls(t, fc )
// Calling Sequence
//	[y]=gmonopuls(t)
//	[y]=gmonopuls(t,fc)
// Parameters
//	t: Real or complex valued vector or matrix
//	fc: Real non-negative value or complex value or a vector or matrix with not all real values negative.
// Description
//	This is an Octave function
//	This function returns samples of the Gaussian monopulse of amplitude unity.
// Examples
// 1.	gmonopuls([1 2 3],0.1)
//	ans= 0.85036   0.94070   0.52591
// 2.	gmonopuls([1 2 3],[])
//	ans= 0 0 0



    [nargout,nargin]=argn();

  if (nargin<1 | nargin > 2)
       error("wrong number of input arguments");
   end
   if(isempty(fc))
       fc=1e3;
       end

  if fc < 0
       error("fc must be positive");
        end
  y = 2*sqrt(exp(1)) .* %pi.*t.*fc.*exp(-2 .* (%pi.*t.*fc).^2);

endfunction