#1699

Поделиться
HTML-код
  • Опубликовано: 25 авг 2024
  • Episode 1699
    24 bit linear feedback shift register, doesn't repeat a number 1 in 8 million
    Be a Patron: / imsaiguy

Комментарии • 73

  • @ivolol
    @ivolol 8 месяцев назад +13

    Pseudo means the sequence can be accurately reproduced, as long as you can copy what the starting starting state of the generator was (and have access to its method/algorithm). A general 'true-random' source's sequence can never be reliably reproduced.

    • @joeteejoetee
      @joeteejoetee 8 месяцев назад

      True, forever!

    • @la7yka
      @la7yka 4 месяца назад

      Just seeding the random generator from a floating A/D -input. Then you have 1024 combinations of the pseudo random sequence. At least, it's a little more random.

  • @johnjohn-ed9qt
    @johnjohn-ed9qt 8 месяцев назад +1

    A few notes. The polynomials used to get the coefficients for a maximal length sequence are prime (mod2), and are the same as for CRC computation. The DC offset of the output is not quite zero, as the sequence will have either an extra one or an extra zero due to the odd length, but a max length sequence will be mighty close. Polynomials that give less than max length may have meaningful offset. For information about the spectrum, see the manual for the HP3722A noise generator and HP journal from september 1967. Ap note 98-2 (1969) details the H01 delay option for cross correlation testing of impulse response in analog networks. Also see the HP1930A bit stream generator (featured april 1971 HP journal)

  • @Gin-toki
    @Gin-toki 8 месяцев назад +1

    For analog white noise generator for synths, I use a NPN with a floating Collector pin and grounded base to generate the white noise and then some amplifier of sorts to amplify and band limit the signal afterwards. It's way simpler and cheaper and provides real white noise :)

    • @hristonenov6532
      @hristonenov6532 8 месяцев назад

      I think he once made a video for synths and white noise. There he used a zener diode on the base of a common emitter amplifier. ruclips.net/video/h61_3Sw2uYk/видео.htmlsi=_PK7yXiRu4PPphrI

  • @spicemasterii6775
    @spicemasterii6775 8 месяцев назад +3

    If your clock is 1MHz then, it will repeat every 16 seconds.

    • @IMSAIGuy
      @IMSAIGuy  8 месяцев назад +2

      wow, that's pretty good

  • @videolabguy
    @videolabguy 8 месяцев назад +3

    You presentation is excellent! FYI: A 24 bit sequencer has 16,777,16 unique states before repeating. (I know you rounded off for simplicity.)
    I used one of these with 32 bits for scrambling the input of a Manchester encoder driving a laser diode in a fiber optic video transmission system. This prevented getting very long runs of zeros or ones and losing clock sync in the receiver. We referred to the circuit as a PRBS, or pseudo random bit sequencer. 1mW of light went 32KM in single mode fiber. Early 1990s. Good times.

  • @AnalogDude_
    @AnalogDude_ 8 месяцев назад +5

    Cool, i used the CD4021, a CD4070 and transistor on a LFSR for noise, i made the pcb like a year ago and still didn't solder it.
    It's used in the Roland TR-909, the worlds most famous drum computer and some other synths.
    Texas Instruments refuses to bring the CD4006 on the market again, i use taps 8, 15, 24 and 31.
    I also translate it in C/C++, burned it in a Microchip Fubarino and made a video about it.

    • @melkiorwiseman5234
      @melkiorwiseman5234 8 месяцев назад

      I programmed a 32-bit LFSR into an 8-pin PIC with one bit as output to produce white noise.

    • @AnalogDude_
      @AnalogDude_ 8 месяцев назад

      @@melkiorwiseman5234 i made a video about it, LFSR in C/C++.

  • @chongli297
    @chongli297 8 месяцев назад +3

    Adding the low pass filter to get white noise is really cool! Would love to see an FFT of that noise output!

    • @stamasd8500
      @stamasd8500 8 месяцев назад

      yeah FFT is what I was thinking of too while watching

    • @kensmith5694
      @kensmith5694 8 месяцев назад +1

      If you take an FFT you get basically random.
      If you do averaging on a Power Spectral Density, you get a flat line up to the corner frequency.

  • @herbertsusmann986
    @herbertsusmann986 8 месяцев назад +7

    Maybe you could show the spectral display of this gizmo some other time?

    • @Peter_S_
      @Peter_S_ 8 месяцев назад +1

      Yes, while varying the clock speed as well.

  • @milantrcka121
    @milantrcka121 8 месяцев назад +1

    This technique can also measure error rate of a communication channel. LFSR sequence or PRBS (pseudorandom bit sequence) generated by the LSFR/PRBS shift register is transmitted through a communication channel and received. Using the reconstructed clock, the same register on the receiving side is synchronized with the received data. The receiving side register output is compared to the received data in an X-or gate and errors thus detected. This technique was used way back in the late 70's on in the world of measuring error rate of digital data recording on magnetic tape.

  • @melkiorwiseman5234
    @melkiorwiseman5234 8 месяцев назад

    I programmed an LFSR into an 8-pin PIC chip and used one output pin to produce white noise from bit 0. You can "tune" the noise somewhat by programming a short pause after each shift-xor-xor-bitinsert sequence. The longer the pause, the lower in tone the noise appears to be. Generally, a NOP or two are enough. The first part of the program inserts some known starting values into a couple of the bytes used for the LFSR just to be certain that all of the bits won't be zero.
    One of the interesting aspects of an LFSR is that it can never produce a value of zero across all bits, and if it ever started out with zero in all bits, it would never produce anything but zero. It's possible to get a zero out of an LFSR, but only by taking less than the full number of bits (eg. by taking only the lowest 8 bits out of a 32-bit LFSR).

    • @kensmith5694
      @kensmith5694 8 месяцев назад

      Another way out is: If the LFSR can be made as one with an XOR or a different one with an XNOR you can add a simple toggling flip-flop that changes it between the two from time to time.

  • @robinbrowne5419
    @robinbrowne5419 8 месяцев назад +2

    A really fun and interesting project. Whenever I hear white noise it reminds me of the movie The Wrath of Khan, where Khan says "Let them eat static" in his most evil vilain Ricardo Montelban voice :-)

  • @adrianramos2229
    @adrianramos2229 8 месяцев назад +2

    these devices are used to generate the pseudo random codes in DSSS communications like GPS. There are some feedback configurations that generate periodical codes called Gold codes that have some interesting properties when doing correlations and allow communication below noise floor

    • @wolpumba4099
      @wolpumba4099 8 месяцев назад

      Given the full or partial bit sequence can I deduce the feedback configuration of the shift register?

    • @Peter_S_
      @Peter_S_ 8 месяцев назад

      @@wolpumba4099 Indeed, so long as you have the full architecture of the generator as well. Strong pseudo-random number generators are an intense area of study with many papers available. They use the term PRNG (pseudo random number generator) if you want to find them.

    • @adrianramos2229
      @adrianramos2229 8 месяцев назад

      @@wolpumba4099 I don't think so, that's the reason they are interesting for military communication. GPS satellites (GNSS in general) emit also more information, but is mixed with some other code (P code) which is not known to civilians. Even if you could get the LFRS configuration from the sequence, you don't have access to the sequence itself in the signal but you need it to acces the information in it.

  • @joeteejoetee
    @joeteejoetee 8 месяцев назад

    "What is all this LFSR stuff?" Heh, nice call-back to Bob!

  • @iansomers6485
    @iansomers6485 8 месяцев назад

    If you look in Horowitz you will find an elegant combination of maximal length LFSR and FIR filter to generate a pink noise spectrum. Caution: I have used a generator built to this design and the resistor values appear to be critical.

  • @andymouse
    @andymouse 8 месяцев назад +1

    I thought it was 'chip of the day' until right at the end when you said 'circuit of the day' dreadfully confusing for me...cheers ! :)

  • @hanksmith3628
    @hanksmith3628 8 месяцев назад

    For a follow up to this video you should show the old HP signal analyzers.

  • @ivanpopovic9503
    @ivanpopovic9503 8 месяцев назад +2

    Very interesting! I remember learning about this in highscool and having my mind blown.😂
    Later i met all kinds of pseudo and true random generators. Being analog, digital, software based... Zener diodes were used back in the day as white noise generators. Also in some aplication the randomness of a radioactive decay is used. For fun i made one true random gen using 32bit counter, interrupted by a geiger counter and a radium dial from an old clock. Fun little project.

    • @stamasd8500
      @stamasd8500 8 месяцев назад

      Or a Zener diode placed near a radioactive source. :)

    • @ivanpopovic9503
      @ivanpopovic9503 8 месяцев назад

      @@stamasd8500
      Maybe it makes sense. There are semiconductor radiation detectors but in structure they are more similar to PiN diodes than zener. On a second thought ionisation event and avalanche forming in solid state matter is quite different from gaseus phase, so maybe it would not work. To have a measurable macsroscopic event (lets say, change in zener voltage) you would have to have insane high doses of radiation. But you gave me the idea, to make a noise generator on photodiode dark current basis. :) I belive IMSAI Guy would have to say something about this, as photoelectronics are his specialty, if I'm not wrong.

    • @barrybogart5436
      @barrybogart5436 8 месяцев назад

      That's the way.

  • @RideGasGas
    @RideGasGas 8 месяцев назад +1

    The good old FireBERD :)

    • @MrSmithChart
      @MrSmithChart 8 месяцев назад +3

      The Firebird 6000A and associated T-berd product lines. Spent a lot of time at TTC (the equipment manufacturer) in the late 90's in MD learning how to effectively use the Fireberd in support of T-1 acceptance testing.
      It was sad to see them littering the floors of many comm shops as they became relics in a relatively short amount of time.
      Long live time division multiplexing and T-1's!!! 1.544 Mbps!

  • @olelek
    @olelek 8 месяцев назад

    Nice! It will be interesting to look on the FFT of that output after low pass filter.

  • @barrybogart5436
    @barrybogart5436 8 месяцев назад

    I'd still call it pink noise since it is PSEUDO random. Computers are deterministic and can never generate randomness. You need a physical process like counting emissions to do that. Depending. But random numbers are so useful in computing, for example in resolving database keys, that you have to try.

    • @iansomers6485
      @iansomers6485 8 месяцев назад

      Pink noise has equal power in each logarithmic frequency band (or octave). This generates white noise with equal power in each linear frequency bandwidth.
      See my comment above.

    • @barrybogart5436
      @barrybogart5436 8 месяцев назад

      I did not know there were such precise definitions: en.wikipedia.org/wiki/Colors_of_noise I meant any non-random noise.@@iansomers6485

  • @10vid5
    @10vid5 8 месяцев назад

    On the CPU, this approach of shifting out a single bit per iteration would be a bit slow (especially for graphics), that's why in the DOS era I would use a sequence of 3 instructions like this:
    ADD EBX, ECX ;add two 32 bit registers
    SUB BL, CH ;subtract the "liver" in one from the "lung" of the other
    ADD ECX, EBX ;add again the two regs to create the result for the 2nd reg
    This produces 64 new random bits per iteration in EBX:ECX. Although repeatability was not tested, it sure did look ok on screen (no "beats" or repeating patterns), it looked just like TV static.
    However I did write a small program that built a histogram over time to check uniformity among individual 8-bit values, and it was even.

  • @staryduren
    @staryduren 8 месяцев назад +1

    Try this using program with internal registers in something like stm32f1xx or higher. Very interesting, easy switchable wide bandwidth signals. Even programing in c you can achieve 'shift' frequency in tens of MHz range.

  • @kensmith5694
    @kensmith5694 8 месяцев назад

    No, it can't average to the middle. It is close but it is an average of an off number of bits so it can't be the middle.
    If you want a fairly easy way to make a lot longer version but also be able to test it to make sure you got it right you can to this:
    So long as the lengths of two sequences share no common divisor, the XOR of those two sequences will give you a new sequence that is length N*M. Thus if you make a 32 bit one and a 31 bit one, you can produce a 63 bit one. At 1MHz each of your 32 bit things will complete a cycle in about an hour so you can test them. The combined result will, however, practically never repeat.
    Also: If you want to use fewer chips, you can say that the 1's bit XOR the 4's bit of a decade counter is "random" and XOR that with your LFSR to make a sequence that is 10 limes longer.
    0000 -> 0
    0001 -> 1
    0010 -> 0
    0011 -> 1
    0100 -> 1
    0101 -> 0
    0110 -> 1
    0111 -> 0
    1000 -> 0
    1001 -> 1

  • @joeteejoetee
    @joeteejoetee 8 месяцев назад

    VERY HIGH BROW CONTENT SIR!!!
    It's wonky that ALL of the LFSR "Gold Code" taping points are not as easily internet discoverable in this century....at least not the ones over 16 "taps" into the XOR gates. YMMV !

  • @charlesnelson619
    @charlesnelson619 8 месяцев назад

    National Semiconductor had an 8 pin device (MM5437) that operated similar to your circuit. Now some CPUs include a pseudorandom generator since they take a miniscule amount of chip area. I prefer 32bit random noise for audio.

  • @uni-byte
    @uni-byte 8 месяцев назад +1

    But if it has a 6dB per octave low pass filter on the output would it not be a pink noise generator?

    • @IMSAIGuy
      @IMSAIGuy  8 месяцев назад

      I did a quick and dirty 'average' filter. not sure what my 6db frequency was.

    • @kensmith5694
      @kensmith5694 8 месяцев назад

      No, that is not pink noise. A one stage low pass gives you "red noise". The pink noise filter has a lot of poles and zeros so it falls at 3dB per octave and not 6.

    • @uni-byte
      @uni-byte 8 месяцев назад

      @@kensmith5694 Yes, now I remember. Thanks for jogging the old mind.

  • @joeteejoetee
    @joeteejoetee 8 месяцев назад

    Um, Question from the novices: What app-note did you semi-display that contained all of that LFSR feedback connectivity in it?

  • @colonelbarker
    @colonelbarker 8 месяцев назад

    I wanted to hear how the sound would change as you altered the speed of the 555! :P
    I really enjoyed this video, more like this please! :D

  • @MishTheMash
    @MishTheMash 8 месяцев назад

    Not asking my whole life ..... but for about 3 or so years

  • @boonedockjourneyman7979
    @boonedockjourneyman7979 8 месяцев назад

    Thank you.

  • @DavidMulligan
    @DavidMulligan 8 месяцев назад

    IMSAI Guy, I noticed your photo board was by Opto Guy. Are you related?

    • @IMSAIGuy
      @IMSAIGuy  8 месяцев назад +2

      that was my consulting company name

  • @user255
    @user255 8 месяцев назад

    Do you have video about stable analog noise generator circuits? Maybe some of those could be used as true random number generators with A/D converter.

    • @IMSAIGuy
      @IMSAIGuy  8 месяцев назад

      ruclips.net/video/evJcZdRJKT0/видео.htmlsi=M3oelG3gJim1xeNY
      also on my synth project: ruclips.net/video/Ow9zQXPYm3g/видео.htmlsi=BcbRdTCTnXUojSEz

  • @user.A9
    @user.A9 7 месяцев назад

    Links to the documents you were using?

    • @IMSAIGuy
      @IMSAIGuy  7 месяцев назад +1

      www.ti.com/lit/an/scta036a/scta036a.pdf
      pages.mtu.edu/~suits/LFSR.html

  • @byronwatkins2565
    @byronwatkins2565 8 месяцев назад

    There are 10 kinds of people in this world: those who understand binary and those who don't...

    • @IMSAIGuy
      @IMSAIGuy  8 месяцев назад

      Every idiot can count to 1: www.reddit.com/r/ElectricalEngineering/comments/fhpgv6/thanks_bob_very_true/

    • @kensmith5694
      @kensmith5694 8 месяцев назад

      There are three kinds of people in the world. There are those who can count and those who can't.

  • @mr1enrollment
    @mr1enrollment 8 месяцев назад

    neat circuit

  • @ornithopterindia
    @ornithopterindia 8 месяцев назад

    👍

  • @magnuswootton7368
    @magnuswootton7368 8 месяцев назад

    cant you do this with a megaohm resistor?

    • @ivolol
      @ivolol 8 месяцев назад +1

      Yes, but it would become very sensitive to loading.

    • @magnuswootton7368
      @magnuswootton7368 8 месяцев назад

      @@ivololfalse. (i dont want to sound arrogant, and the truth is boring anyway.)

    • @Peter_S_
      @Peter_S_ 8 месяцев назад +3

      No. Johnson noise isn't repeatable and you'll find the spectral content different. The repeatability of LFSR sequences is why these are used to "scramble" the data for EMI reduction on high speed data links including HDMI, USB, PCIe, SATA, and Bluetooth to name a couple. In commercial implementation, you have to ask yourself why Japanese consumer electronics manufacturers like Roland would use a 3 chip circuit with a high BOM cost when a 1 meg resistor could do the job? See the Roland TR 909 for their 32 bit LFSR based on a pair of now rare HD14006B 18 bit shift registers. When building synths, you seldom want perfect white noise and the Shot noise in PN junctions was the historical standard until material science reduced gold contamination to semiconductors to almost zero.

    • @andymouse
      @andymouse 8 месяцев назад +1

      Yes ! classic simple noise generators consisted of a couple of transistors amplifying the breakdown of a reversed biased diode @@Peter_S_

    • @magnuswootton7368
      @magnuswootton7368 8 месяцев назад

      @@Peter_S_ resistor noise isnt that easy to make really, its more just a resistor, you have to make it that quiet, and then amp it by more than a billion times maybe, and u have to get the dc offset of the noise right as well, that could go wrong too.

  • @freeman5867
    @freeman5867 8 месяцев назад

    It would be good if you did a continuing video showing how the ‘white’ noise spectrum changed with driving frequency. Thanks.

  • @hflorin07
    @hflorin07 8 месяцев назад

    @Time: 03:40 - "x to the sixteenth plus y to the fourteenth plus x to the thirteenth plus y to the eleventh plus one" You are so dizzy... don't take anything before making videos! 😁Maybe that way you won't create confusion.

    • @IMSAIGuy
      @IMSAIGuy  8 месяцев назад

      don't worry, everyone is confused no matter what I said.