Return-Path: Received: from rly-mh07.mx.aol.com (rly-mh07.mail.aol.com [172.21.166.143]) by air-mh05.mail.aol.com (v121_r5.5) with ESMTP id MAILINMH051-be649a0530179; Sat, 21 Feb 2009 14:16:24 -0500 Received: from post.thorcom.com (post.thorcom.com [193.82.116.20]) by rly-mh07.mx.aol.com (v121_r4.4) with ESMTP id MAILRELAYINMH076-be649a0530179; Sat, 21 Feb 2009 14:16:19 -0500 Received: from majordom by post.thorcom.com with local (Exim 4.14) id 1LaxKX-0001CD-1x for rs_out_1@blacksheep.org; Sat, 21 Feb 2009 19:16:05 +0000 Received: from [193.82.116.32] (helo=relay1.thorcom.net) by post.thorcom.com with esmtp (Exim 4.14) id 1LaxKW-0001C4-KU for rsgb_lf_group@blacksheep.org; Sat, 21 Feb 2009 19:16:04 +0000 Received: from mail-bw0-f164.google.com ([209.85.218.164]) by relay1.thorcom.net with esmtp (Exim 4.63) (envelope-from ) id 1LaxKV-00016c-1N for rsgb_lf_group@blacksheep.org; Sat, 21 Feb 2009 19:16:04 +0000 Received: by bwz8 with SMTP id 8so4290276bwz.4 for ; Sat, 21 Feb 2009 11:15:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=rwJyOFrCqBz/hVfkQPD8Wlyp6eSGxhHkayGg76fPO/c=; b=a56mV4ExnKCPg+DUWeKA/WnWCIQ8KBUYAQctwJQA7ZYFM9TrwxD6XyqNSRh3qCxhJP Ge4CtLSNegd15jqFGwvz+bRoo+Cql/R6oScNEhLgaYwkhPdzy5dvbquQylP0QxDG6FSR 0BddWHSTHdvtVzyHSL7nmyO+pqgDCTd2LfLVE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Aau45R5ifYx5JggGkHk16BtswomlsA0BlVSEd1iqg8gj1g4yHwr+7ptgwl7iBFendF TfmZM3ifMt844AhXgCP4hP7x6fjtXiS1wTZuwtzNe4FOBCX2Kx8UnySZMRR69yo6jt/w B18fL+c+puMY77MfgRPAnXv3QblgadZBlNR9A= MIME-Version: 1.0 Received: by 10.223.108.211 with SMTP id g19mr372453fap.39.1235243756487; Sat, 21 Feb 2009 11:15:56 -0800 (PST) In-Reply-To: <49A03A7C.2050703@telus.net> References: <49A03A7C.2050703@telus.net> Date: Sat, 21 Feb 2009 19:15:56 +0000 Message-ID: From: Andy Talbot To: rsgb_lf_group@blacksheep.org X-Karma: unknown: DomainKey-Status: good (testing) X-Spam-Score: 0.3 (/) X-Spam-Report: autolearn=disabled,MAILTO_TO_SPAM_ADDR=0.276 Subject: Re: LF: Wanted - non-random PN sequence generator - so Off Topic it shouldn't be allowed here! Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on post.thorcom.com X-Spam-Level: * X-Spam-Status: No, hits=1.1 required=5.0 tests=MAILTO_TO_SPAM_ADDR autolearn=no version=2.63 X-SA-Exim-Scanned: Yes Sender: owner-rsgb_lf_group@blacksheep.org Precedence: bulk Reply-To: rsgb_lf_group@blacksheep.org X-Listname: rsgb_lf_group X-SA-Exim-Rcpt-To: rs_out_1@blacksheep.org X-SA-Exim-Scanned: No; SAEximRunCond expanded to false X-AOL-IP: 193.82.116.20 X-AOL-SCOLL-AUTHENTICATION: mail_rly_antispam_dkim-m266.1 ; domain : googlemail.com DKIM : pass X-Mailer: Unknown (No Version) Scott: Its precisely that an LFSR does not give what is needed that made me start thinking along these lines. For one thing, LFSRs are only random if considered over the whole repeat length, viz 2 ^ N - 1 bit for a maximal length sequence. They will have one single run of exactly N ones, and N-1 zeroes, and a predicatable numbers of runs of fewer successive equal bits. It is a well established annoyance with these that short register lengths cannot be used to generate half-decent pseudo randomness What I was idly speculating on was a straightforward way of generating a semi-random sequence with deliberately limited continuous runs of ones or zeroes. By forcing this aspect, the sequence cannot possibly be random. A ideal sequence would probably have very little statistical randomness at all. But it sems to have turned out to be not at all straightforward. Eg 33% duty cycle with no randomisation 001001001001001001001001001001 A true PN sequence at 33% could be like 010000111100100000001100101000 which has an excessively long sequence of ones for WSPR Tx purposes A more optimised pattern might be 001010100001010100100010001010 Apart from one bit, this one is actually a smaller pattern repeated. Which all comes down to the idea that its easiest to just generate (by inspection !) a set of precomputed tables - but that just feels like cheating and I feel dissatisfied with it :-) Andy www.g4jnt.com 2009/2/21 Scott Tilley : > Hi Andy > > Try a 'Linear Feedback Shift Register', Google it... > > Very simple to implement in a MCU and can be scaled to any size you like. I > wrote some code to do this in PIC assembly years ago that was only a few > lines long for a 256bit sequence... > > Best of all you can predict the outcome and choose a sequence that meets > your needs given a unique seed word.... > > Better yet it offers a means of identification over a long term integration > :-) > > 73 Scott > VE7TIL > > > Andy Talbot wrote: >> >> ...but if any mathematicians, number theorists or cryptographers >> should be reading this... >> >> I've just got a WSPR generating routine running on a PIC / AD9852 / >> GPS combination, but I'm looking for a half-decent way of generating a >> pseudo random Tx/Rx sequence with defined duty cycle that does not >> give the long(ish) consecutive runs of 0's or 1's that MUST ALWAYS >> occasionally be seen in a truly random sequence. >> >> In other words, the sequence needs to be bandpass filtered. >> >> Before I cop-out and just use a pre-generated set of lookup tables, >> take a look at http://www.g4jnt.com/WSPR_PN_Sequence.pdf >> for a fuller description of the mind-bender >> >> >> Andy G4JNT >> www.g4jnt.com >> >> >> > >