Mercurial > forge
changeset 9662:7e364201a793 octave-forge
prbs_generator, prbs_iterator, prbs_sequence: added copyright notice
author | carandraug |
---|---|
date | Tue, 13 Mar 2012 03:43:28 +0000 |
parents | 15c4c28383ef |
children | 44714082301e |
files | main/comm/inst/prbs_generator.m main/comm/inst/prbs_iterator.m main/comm/inst/prbs_sequence.m |
diffstat | 3 files changed, 48 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/main/comm/inst/prbs_generator.m Tue Mar 13 03:05:35 2012 +0000 +++ b/main/comm/inst/prbs_generator.m Tue Mar 13 03:43:28 2012 +0000 @@ -1,6 +1,18 @@ -## -## (C) 2006 Muthiah Annamalai <muthuspost@gmail.com> +## Copyright (C) 2006 Muthiah Annamalai <muthuspost@gmail.com> +## +## 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/>. + ## Implement book keeping for a Pseudo-Random Binary Sequence ( PRBS ) ## also called as a Linear Feedback Shift Register. ## @@ -39,12 +51,11 @@ ## ## See Also: This function is to be used along with functions ## prbs_iterator, and prbs_sequence. -## + function prbs=prbs_generator(polynomial,connections,initstate) prbs.reglen=max(polynomial); prbs.polynomial=polynomial; prbs.sregs=initstate; prbs.connections=connections; prbs.conlen=length(connections); - return end
--- a/main/comm/inst/prbs_iterator.m Tue Mar 13 03:05:35 2012 +0000 +++ b/main/comm/inst/prbs_iterator.m Tue Mar 13 03:43:28 2012 +0000 @@ -1,6 +1,18 @@ -## -## (C) 2006 Muthiah Annamalai <muthuspost@gmail.com> -## +## Copyright (C) 2006 Muthiah Annamalai <muthuspost@gmail.com> +## +## 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/>. + ## This function generates the output bits from the PRBS ## state, for the number of iterations specified. ## @@ -34,7 +46,7 @@ ## ## See Also: This function is to be used along with functions ## prbs_iterator, prbs_generator and prbs_sequence. -## + function [outputseq,prbs]=prbs_iterator(prbs,iterations) if ( nargin < 2 ) iterations=2^(prbs.reglen)-1; @@ -68,7 +80,6 @@ end end - return; end ##
--- a/main/comm/inst/prbs_sequence.m Tue Mar 13 03:05:35 2012 +0000 +++ b/main/comm/inst/prbs_sequence.m Tue Mar 13 03:43:28 2012 +0000 @@ -1,6 +1,18 @@ -## -## (C) 2006 Muthiah Annamalai <muthuspost@gmail.com> -## +## Copyright (C) 2006 Muthiah Annamalai <muthuspost@gmail.com> +## +## 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/>. + ## Implement book keeping for a Pseudo-Random Binary Sequence ( PRBS ) ## also called as a Linear Feedback Shift Register. ## @@ -25,10 +37,10 @@ ## prbs=prbs_generator([1 3 4],{[1 3 4]},[1 0 1 1]); ## x = prbs_sequence(prbs) #gives 15 ## - +## ## See Also: This function is to be used along with functions ## prbs_generator. -## + function [itrs,seq]=prbs_sequence(prbs) if nargin < 1 error("usage: prbs_sequence(prbs struct ); \ @@ -69,6 +81,4 @@ break; end end - - return; end