20 July 2010, 13:52 | #41 | |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,764
|
More generally speaking. On an Amiga you can easily use a parallel port sampler.
Quote:
Yes, but I mean cheap world receivers with completely manual tuning and no mute. These are great for this purpose. |
|
20 July 2010, 19:00 | #42 |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,771
|
So if You adding some hardware and software maybe it is better to use something like this https://secure.wikimedia.org/wikiped...latform_Module
|
20 July 2010, 19:56 | #43 | |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,764
|
Quote:
|
|
20 July 2010, 20:55 | #44 | |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,771
|
Quote:
|
|
20 July 2010, 21:35 | #45 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,764
|
Yes, but driver software is probably less easy than a radio static processing program.
Okay, the radio is cheap, but isn't the sampler going to be quite cheap, too? You don't need the best sampler, probably any will do. It's also about ease of use: Are those specialized solutions easy to connect to an Amiga and cheap? |
20 July 2010, 23:14 | #46 |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,771
|
most of them use something like I2C or SPI bus so connection to any computer shall be not a problem (as a dongle or something similar)
btw - AVR uC (or some simple ARM like Cortex M3) can be used as a quite decent sampler for audio (usually 10 bit ADC with some limited DSP capabilities, buffering etc) - for 15$ ARM with embedded Ethernet can be nice solution for small Amigas - even TCP/IP stack can run on ARM which mean 32 bit 40 - 75MIPS CPU that offload all that network stuff from MC68K... i can made hardware but i'm not a programmer... Last edited by pandy71; 20 July 2010 at 23:21. |
22 July 2010, 09:36 | #47 | |||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
It's just c code using floats. Damned slow, perhaps can't even compile on my machine. Quote:
So here it is anyway : Code:
; d1=seed, d0=modulo -> d0=number pseudornd movem.l d1-d3,-(a7) move.l #$59fa769f,d3 mulu.l d3,d2:d1 add.l d2,d1 addi.l #$4a5be017,d1 rol.l #7,d1 move.l #2513894743,d3 mulu.l d3,d2:d1 eor.l d2,d1 addi.l #$a5a5a5a5,d1 ror.l #7,d1 moveq #0,d2 divu.l d0,d2:d1 move.l d2,d0 movem.l (a7)+,d1-d3 rts I don't think so. More precisely, i can't see any game in which the speed of the random generator is of any importance. It's a dwarf as compared to any AI code. Quote:
Good pseudo random is indistinguishable from true random. |
|||
24 July 2010, 11:08 | #48 | ||||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,764
|
Quote:
Quote:
Quote:
Quote:
No, it is most certainly not. Lossless compressed data is exactly the same as it's non compressed counter part, except for the form. Compressed data is not random. It may look random, but it's not. If you'd decompress truely random data, you'd end up with rubbish data. At the surface, yes. The difference is that psuedo random data always has a pattern that can be reproduced. True random data doesn't have this apparently. |
||||
24 July 2010, 14:03 | #49 |
The Spanish Songstress
Join Date: Jul 2009
Location: Finland
Posts: 114
|
Mersenne twister is a good example of this. Excellent PRNG with good statistical properties but utterly useless in cryptography or anything requiring "true" random data (you only need to observe ~600 cycles, depending on implementation, to "hack it").
|
25 July 2010, 01:32 | #50 | |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Quote:
Any chance you could generate some sets of 10 Mb each from typical use cases and upload somewhere? |
|
26 July 2010, 11:09 | #51 | |||||||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
Quote:
http://stat.fsu.edu/pub/diehard/ http://www.csis.hku.hk/cisc/download/idetect/ http://www.webalice.it/cristiano.pi/rabigete/ http://www.jstatsoft.org/v07/i03/ Quote:
Quote:
Quote:
Quote:
Quote:
I've posted my "normal" code earlier in this thread, and it uses timers. As i gave the code, you can do it whenever you want. You don't need me |
|||||||
26 July 2010, 14:53 | #52 | |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Quote:
Typically a PRNG is self-contained and you only seed it/set its internal state once for the lifetime of your application. I'm just not sure of what input to give your algorithms to make them behave as intended. My 3-line algorithm in my first post passes half of the Diehard tests and fails miserably on the other half, and I think this is the case of most if not all homemade PRNGs. They work for most stuff but they're far from truly random, and chances are they will eventually stall or short circuit. Added complexity doesn't always mean better either. Just for comparison here's one of the Xorshift algorithms Lionheart linked to. It has a period of 2^64-1, which is probably more random numbers than have been generated by all Amigas in total since their birth in 1985, and it passes all of the Diehard tests: Code:
PRNG movem.l .state(pc), d0-d1 move.l d0, d2 lsl.l #2, d0 eor.l d2, d0 ; T = A^(A<<2) move.l d1, d2 lsr.l #3, d2 eor.l d1, d2 ; B^(B>>3) eor.l d0, d2 ; B^(B>>3)^T lsr.l #7, d0 eor.l d0, d2 ; B^(B>>3)^T^(T>>7) movem.l d1-d2, .state rts ; return random number in D2 .state ds.l 2 ; initialize once to non zero |
|
27 July 2010, 20:26 | #53 | |||||||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,764
|
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
|
|||||||
27 July 2010, 21:03 | #54 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
|
27 July 2010, 21:14 | #55 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,764
|
Yes, I did. This code probably just contains a bug.
Edit: Turns out I'm the one who made a mistake Basically I forgot to look at how the state is handled. Instead of saving d0 and d1 (which are the values that are read), the code saves d1 and d2 as a state Of course I assumed that d0 and d1 are saved Last edited by Thorham; 27 July 2010 at 22:07. |
28 July 2010, 11:36 | #56 | |||||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
Quote:
But it is true that they're much easier to use in my system framework in which they normally lie. Quote:
Moreover, i don't trust these tests too much. Something that's perfectly statistically balanced can become more predictable because of that, and hence ceases to be random. Quote:
The time it takes is in fact the square root of the maximum possible value, which in turn halves the number of bits. That is, you can do any 64-bit number in less than 4 billions of iterations. Unsafe maths if you ask me. Said otherwise, you can break any 32-bit prime in less than 1 second even on unexpanded A1200. Quote:
And what are "better" methods ? Most tests can be fooled with very simple algorithms. |
|||||
28 July 2010, 15:23 | #57 | |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Quote:
I tested both your algorithms just now and the shorter one fails most of the tests. The timer-based algorithm failed about half of the tests in a first run, but in a second run where I called it at a slower rate it passed the tests really well. It seems the guy who constructed the tests is a professor in statistics and has been studying in this field for over 25 years. I'm willing to take his opinion as law. Anyway, I'm out. This thread has grown way too long already. |
|
29 July 2010, 20:06 | #58 | ||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,764
|
Quote:
I think I'm going to use my latest PRNG. It seems to pass the Diehard tests and is very simple: Code:
add.l d1,d0 rol.l #7,d0 add.l d2,d1 ror.l #7,d1 add.l d0,d2 rol.l #7,d2 Quote:
Edit: The problem with the visual test is that you can only see simpler patterns and very short periods. Also, data that isn't random at all, such as a compressed archive, will show as random while it isn't random at all. The visual test is just an indication of randomness in the end. Last edited by Thorham; 30 July 2010 at 17:55. |
||
30 July 2010, 19:52 | #59 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,764
|
I forgot to include the Diehard test results for my new simple algorithm, while I claimed it seems to pass this test, so here are the results: test10.txt
|
04 August 2010, 09:07 | #60 | |||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
Quote:
Yes, it sure has... And why ? Method doesn't change for bigger numbers. Quote:
EDIT: This is "late" edit. But i want the truth to appear from page one (well, two in our case ). My generator didn't fail any test ; the guy was using uae which has unreliable timers. Ha ! Last edited by meynaf; 07 October 2010 at 16:57. |
|||
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Random question | 251Mario | project.EAB | 1 | 16 May 2013 02:19 |
HELP! A600 number 2 down! :( | Snowy | support.Other | 5 | 04 December 2011 22:12 |
Help needed!!Random octal numbers generator(asm) | sheryn88 | Coders. General | 6 | 01 August 2010 07:19 |
Random crashes | ami_stuff | support.WinUAE | 8 | 06 February 2009 16:51 |
D/Generation | IanMac | support.Games | 2 | 04 November 2002 16:47 |
|
|