added
git-svn-id: http://moon:8086/svn/matlab/trunk@100 801c6759-fa7c-4059-a304-17956f83a07c
This commit is contained in:
Executable
+30
@@ -0,0 +1,30 @@
|
||||
## Copyright (C) 2018 Jens Ahrensfeld
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify it
|
||||
## under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 3 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
## -*- texinfo -*-
|
||||
## @deftypefn {Function File} {@var{retval} =} f2l (@var{input1}, @var{input2})
|
||||
##
|
||||
## @seealso{}
|
||||
## @end deftypefn
|
||||
|
||||
## Author: Jens Ahrensfeld <ahrensfeld@w2ess001vm>
|
||||
## Created: 2018-10-15
|
||||
|
||||
function l = f2l (f_MHz)
|
||||
|
||||
c = 3.0e8
|
||||
l = 1.0e-4*c/f_MHz;
|
||||
|
||||
endfunction
|
||||
Executable
+30
@@ -0,0 +1,30 @@
|
||||
## Copyright (C) 2018 Jens Ahrensfeld
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify it
|
||||
## under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 3 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
## -*- texinfo -*-
|
||||
## @deftypefn {Function File} {@var{retval} =} lfsr (@var{input1}, @var{input2})
|
||||
##
|
||||
## @seealso{}
|
||||
## @end deftypefn
|
||||
|
||||
## Author: Jens Ahrensfeld <ahrensfeld@w2ess001vm>
|
||||
## Created: 2018-12-05
|
||||
|
||||
function next = lfsr (size, poly, curr)
|
||||
|
||||
|
||||
next = 2*xor(curr, poly);
|
||||
|
||||
endfunction
|
||||
Executable
+64
@@ -0,0 +1,64 @@
|
||||
function y = manchester(x, type)
|
||||
N = length(x);
|
||||
|
||||
mtype = 'ieee802.3';
|
||||
if (nargin > 1)
|
||||
mtype = type
|
||||
end
|
||||
|
||||
t = -1;
|
||||
v = -1;
|
||||
|
||||
if (strcmp(mtype, 'I') || strcmp(mtype, 'ieee802.3'))
|
||||
v = 0;
|
||||
t = 1;
|
||||
end
|
||||
|
||||
if (strcmp(mtype, 'II') || strcmp(mtype, 'Thomas'))
|
||||
v = 0;
|
||||
t = 2;
|
||||
end
|
||||
|
||||
if (strcmp(mtype, 'BP-M'))
|
||||
v = 1;
|
||||
t = 1;
|
||||
end
|
||||
|
||||
if (strcmp(mtype, 'BP-S'))
|
||||
v = 0;
|
||||
t = 1;
|
||||
end
|
||||
|
||||
if (t == 1)
|
||||
s = 1;
|
||||
y = [];
|
||||
for n=1:N,
|
||||
if x(n) == v
|
||||
s = not(s);
|
||||
y = [y s];
|
||||
y = [y s];
|
||||
else
|
||||
s = not(s);
|
||||
y = [y s];
|
||||
s = not(s);
|
||||
y = [y s];
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (t == 2)
|
||||
s = 1;
|
||||
y = [];
|
||||
for n=1:N,
|
||||
if x(n) == v
|
||||
y = [y not(s)];
|
||||
y = [y s];
|
||||
else
|
||||
y = [y s];
|
||||
y = [y not(s)];
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user