Electronics-Related.com
Forums

Circuit for Randomized Pulse Width Modulation

Started by Robert Martin January 8, 2019
On 2019-01-09, Robert Martin <rmartin@bristol.edu> wrote:
> > I tried using noise, as recommended earlier on this group and elsewhere. > The filtered amplitude below 10Hz was too low to produce a workable result, > > Your idea about using a candlelight flickering LED is interesting, but > looking at the video the switching appears to be a bit sharp.
if you connect a loudspeaker in series with the led it plays "jingle bells" (or some other music) it's not random.
> In any case, I would prefer a circuit over which I have a degree of > design control as I may need to tinker to get the chaotic wave-like > effect with smooth transitions that I am looking for.
Maybe Chua's circuit, perhaps folloed by an envelop detector? -- When I tried casting out nines I made a hash of it.
On 2019-01-10, Robert Martin <rmartin@bristol.edu> wrote:

> You are certainly right about a shortage of LF noise sources. A friend > once used a photocell pointed at trees blowing in the wind. Clever but > not very portable.
also somwwhat temporary. photocell and lava lamp, portable, but heavy, somewhat fragile and slow to start. -- When I tried casting out nines I made a hash of it.
On 10-1-2019 5:25, Jasen Betts wrote:
> On 2019-01-10, Robert Martin <rmartin@bristol.edu> wrote: > >> You are certainly right about a shortage of LF noise sources. A friend >> once used a photocell pointed at trees blowing in the wind. Clever but >> not very portable. > > also somwwhat temporary. > > photocell and lava lamp, portable, but heavy, somewhat fragile > and slow to start. >
When I needed about 8 low frequency noise signals, I used a noisy zener diode, amplified its noise with a video opamp to about 4volts/15MHZ. Put heavy shielding around that, to avoid radio interference. I then used 16 sample/hold amplifiers, and let them sample the 15mhz signal, each shifted a handful of microseconds. That gave me 6 outputs, each nicely uncorrelated, Filter/amplify to clean up the outputs. You can change the bandwidth by changing the clock for the 16 bit shift register controlling the s/h amps. Used to produce wind and engine noise in a car simulator. I still have the backplane of sounds generator.
On 10/1/19 3:21 pm, Jasen Betts wrote:
> On 2019-01-09, Robert Martin <rmartin@bristol.edu> wrote: >> >> I tried using noise, as recommended earlier on this group and elsewhere. >> The filtered amplitude below 10Hz was too low to produce a workable result, >> >> Your idea about using a candlelight flickering LED is interesting, but >> looking at the video the switching appears to be a bit sharp. > > if you connect a loudspeaker in series with the led it plays "jingle > bells" (or some other music) it's not random. >
So, it's an audio memory module. Interesting. There are ones based on the WTV020SD that accpt an SD card. A few dollars each out of China. But again, not what I was looking for.
>> In any case, I would prefer a circuit over which I have a degree of >> design control as I may need to tinker to get the chaotic wave-like >> effect with smooth transitions that I am looking for. > > Maybe Chua's circuit, perhaps followed by an envelop detector? >
http://www.chuacircuits.com/howtobuild2.php Nice but a bit kinky. Robert Martins
Robert Martin <rmartin@bristol.edu> wrote:
>I have a CD4060 outputting a 5Vpp 4Hz (4 hertz) square wave at 50% duty >cycle.
>How can I randomly pulse width modulate this so that when a low pass >filter is added a constantly changing, "wave-like" arbitrary waveform >will be produced?
>I would prefer analog or CMOS IC's, not a microprocessor, and minimum >parts count.
>The "randomness" does not need to be true but only a reasonable >approximation.
>Thank you for any ideas or available circuit diagrams.
Perhaps you could use a electronic tea light. If you prefer to build it using standard chips then consider using a noice generator with a BJT. -- Dipl.-Inform(FH) Peter Heitzer, peter.heitzer@rz.uni-regensburg.de
On 1/9/19 3:53 PM, George Herold wrote:
> On Wednesday, January 9, 2019 at 3:39:10 PM UTC-5, Robert Martin wrote: >> On 10/1/19 12:47 am, George Herold wrote: >>> On Wednesday, January 9, 2019 at 8:16:36 AM UTC-5, Robert Martin wrote: >>>> On 9/1/19 5:26 pm, bitrex wrote: >>>>> On 01/08/2019 06:48 PM, Robert Martin wrote: >>>>>> I have a CD4060 outputting a 5Vpp 4Hz (4 hertz) square wave at 50% >>>>>> duty cycle. >>>>>> >>>>>> How can I randomly pulse width modulate this so that when a low pass >>>>>> filter is added a constantly changing, "wave-like" arbitrary waveform >>>>>> will be produced? >>>>>> >>>>>> I would prefer analog or CMOS IC's, not a microprocessor, and minimum >>>>>> parts count. >>>>>> >>>>>> The "randomness" does not need to be true but only a reasonable >>>>>> approximation. >>>>>> >>>>>> Thank you for any ideas or available circuit diagrams. >>>>>> >>>>>> Robert Martin >>>>> >>>>> I think the simplest way to do it without a uP would to build an analog >>>>> white noise source a la: >>>>> >>>>> <http://www.electro-music.com/forum/phpbb-files/2tran_wn_203.gif> >>>>> >>>>> and then aggressively low-pass filter it. then feed your square wave >>>>> into one input of a comparator and the appropriately-scaled low-passed >>>>> noise into the other. >>>> > >>>> >>>> I tried using noise, as recommended earlier on this group and elsewhere. >>>> The filtered amplitude below 10Hz was too low to produce a workable result, >> >> >> >>> That makes sense (loss of signal) how about filter it at ~10-100 kHz >>> and then send it into a counter/ divider to get to lower frequency. >>> >>> George H. >> >> Good suggestion. I'll first apply a 1KHz LPF and clip its output to >> simulate a logic signal into a divide by 100 counter. >> >> Robert Martin > > Robert, now that I think about it, I'm not sure that is going to work... or be that useful. If you've got random pulses coming at some rate... > then counting to some number is giving you a running average of the counts > And I don't think you'll see a lot of variation. > One of the pseudo-random shift register things may be better... > you can clock at the rate you like. There are not many low frequency > noise sources... maybe 1/f noise in the old carbon comp resistors? > Geiger counter with weakish source, some chaotic pendulum... > > George H. >
Yup, the central limit theorem will make the duty cycle approach 50% as the division ratio goes up. That's actually pretty useful sometimes, e.g. in building noise servos based on false-count rates. A PRBS generator's output is periodic, and so consists entirely of harmonics of f_clk/(2**N -1), where N is the register length. Filtering just changes the harmonic amplitudes. To make that look continuous, so as to get good noise down below 1 Hz, you need a fair few bits and a lowish clock frequency, so that the period is much longer than your measurement. The OP seems to be making very heavy weather of a simple job. "Too small to produce a workable result" is a typical example. An ordinary op amp running with a closed loop gain of 100 dB will produce a lot of low frequency noise, and give some lowpass filtering as a bonus. (The amp would need at least 120 dB of open-loop gain, but there are lots of those around.) Assuming its 0.1-10 Hz p-p noise is 5 uV, the amplitude would be around 500 mV, not counting resistor noise. If he uses a chopamp, the noise would even be reasonably close to white, but it would probably need two stages to get enough gain. An OPA378 has very flat noise of about 20 nV/sqrt(Hz), so in a 10-Hz bandwidth with a gain of 100000, that would be about 6 mV. A second stage could make that anything he likes. Cheers Phil Hobbs -- Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC / Hobbs ElectroOptics Optics, Electro-optics, Photonics, Analog Electronics Briarcliff Manor NY 10510 http://electrooptical.net http://hobbs-eo.com
On Thursday, January 10, 2019 at 9:30:34 AM UTC-5, Phil Hobbs wrote:
> On 1/9/19 3:53 PM, George Herold wrote: > > On Wednesday, January 9, 2019 at 3:39:10 PM UTC-5, Robert Martin wrote: > >> On 10/1/19 12:47 am, George Herold wrote: > >>> On Wednesday, January 9, 2019 at 8:16:36 AM UTC-5, Robert Martin wrote: > >>>> On 9/1/19 5:26 pm, bitrex wrote: > >>>>> On 01/08/2019 06:48 PM, Robert Martin wrote: > >>>>>> I have a CD4060 outputting a 5Vpp 4Hz (4 hertz) square wave at 50% > >>>>>> duty cycle. > >>>>>> > >>>>>> How can I randomly pulse width modulate this so that when a low pass > >>>>>> filter is added a constantly changing, "wave-like" arbitrary waveform > >>>>>> will be produced? > >>>>>> > >>>>>> I would prefer analog or CMOS IC's, not a microprocessor, and minimum > >>>>>> parts count. > >>>>>> > >>>>>> The "randomness" does not need to be true but only a reasonable > >>>>>> approximation. > >>>>>> > >>>>>> Thank you for any ideas or available circuit diagrams. > >>>>>> > >>>>>> Robert Martin > >>>>> > >>>>> I think the simplest way to do it without a uP would to build an analog > >>>>> white noise source a la: > >>>>> > >>>>> <http://www.electro-music.com/forum/phpbb-files/2tran_wn_203.gif> > >>>>> > >>>>> and then aggressively low-pass filter it. then feed your square wave > >>>>> into one input of a comparator and the appropriately-scaled low-passed > >>>>> noise into the other. > >>>> > > >>>> > >>>> I tried using noise, as recommended earlier on this group and elsewhere. > >>>> The filtered amplitude below 10Hz was too low to produce a workable result, > >> >> > >> > >>> That makes sense (loss of signal) how about filter it at ~10-100 kHz > >>> and then send it into a counter/ divider to get to lower frequency. > >>> > >>> George H. > >> > >> Good suggestion. I'll first apply a 1KHz LPF and clip its output to > >> simulate a logic signal into a divide by 100 counter. > >> > >> Robert Martin > > > > Robert, now that I think about it, I'm not sure that is going to work... or be that useful. If you've got random pulses coming at some rate... > > then counting to some number is giving you a running average of the counts > > And I don't think you'll see a lot of variation. > > One of the pseudo-random shift register things may be better... > > you can clock at the rate you like. There are not many low frequency > > noise sources... maybe 1/f noise in the old carbon comp resistors? > > Geiger counter with weakish source, some chaotic pendulum... > > > > George H. > > > > Yup, the central limit theorem will make the duty cycle approach 50% as > the division ratio goes up. That's actually pretty useful sometimes, > e.g. in building noise servos based on false-count rates. > > A PRBS generator's output is periodic, and so consists entirely of > harmonics of f_clk/(2**N -1), where N is the register length. Filtering > just changes the harmonic amplitudes. > > To make that look continuous, so as to get good noise down below 1 Hz, > you need a fair few bits and a lowish clock frequency, so that the > period is much longer than your measurement. > > The OP seems to be making very heavy weather of a simple job. "Too > small to produce a workable result" is a typical example. > > An ordinary op amp running with a closed loop gain of 100 dB will > produce a lot of low frequency noise, and give some lowpass filtering as > a bonus. (The amp would need at least 120 dB of open-loop gain, but > there are lots of those around.) > > Assuming its 0.1-10 Hz p-p noise is 5 uV, the amplitude would be around > 500 mV, not counting resistor noise. >
Yeah that might work (gain up the 1/f noise of an opamp.) or use my favorite noise source a 20V zener run at ~10 uA of current. George H.
> If he uses a chopamp, the noise would even be reasonably close to white, > but it would probably need two stages to get enough gain. An OPA378 has > very flat noise of about 20 nV/sqrt(Hz), so in a 10-Hz bandwidth with a > gain of 100000, that would be about 6 mV. A second stage could make > that anything he likes. > > Cheers > > Phil Hobbs > > > -- > Dr Philip C D Hobbs > Principal Consultant > ElectroOptical Innovations LLC / Hobbs ElectroOptics > Optics, Electro-optics, Photonics, Analog Electronics > Briarcliff Manor NY 10510 > > http://electrooptical.net > http://hobbs-eo.com
On Thursday, January 10, 2019 at 9:30:34 AM UTC-5, Phil Hobbs wrote:
> On 1/9/19 3:53 PM, George Herold wrote: > > On Wednesday, January 9, 2019 at 3:39:10 PM UTC-5, Robert Martin wrote: > >> On 10/1/19 12:47 am, George Herold wrote: > >>> On Wednesday, January 9, 2019 at 8:16:36 AM UTC-5, Robert Martin wrote: > >>>> On 9/1/19 5:26 pm, bitrex wrote: > >>>>> On 01/08/2019 06:48 PM, Robert Martin wrote: > >>>>>> I have a CD4060 outputting a 5Vpp 4Hz (4 hertz) square wave at 50% > >>>>>> duty cycle. > >>>>>> > >>>>>> How can I randomly pulse width modulate this so that when a low pass > >>>>>> filter is added a constantly changing, "wave-like" arbitrary waveform > >>>>>> will be produced? > >>>>>> > >>>>>> I would prefer analog or CMOS IC's, not a microprocessor, and minimum > >>>>>> parts count. > >>>>>> > >>>>>> The "randomness" does not need to be true but only a reasonable > >>>>>> approximation. > >>>>>> > >>>>>> Thank you for any ideas or available circuit diagrams. > >>>>>> > >>>>>> Robert Martin > >>>>> > >>>>> I think the simplest way to do it without a uP would to build an analog > >>>>> white noise source a la: > >>>>> > >>>>> <http://www.electro-music.com/forum/phpbb-files/2tran_wn_203.gif> > >>>>> > >>>>> and then aggressively low-pass filter it. then feed your square wave > >>>>> into one input of a comparator and the appropriately-scaled low-passed > >>>>> noise into the other. > >>>> > > >>>> > >>>> I tried using noise, as recommended earlier on this group and elsewhere. > >>>> The filtered amplitude below 10Hz was too low to produce a workable result, > >> >> > >> > >>> That makes sense (loss of signal) how about filter it at ~10-100 kHz > >>> and then send it into a counter/ divider to get to lower frequency. > >>> > >>> George H. > >> > >> Good suggestion. I'll first apply a 1KHz LPF and clip its output to > >> simulate a logic signal into a divide by 100 counter. > >> > >> Robert Martin > > > > Robert, now that I think about it, I'm not sure that is going to work... or be that useful. If you've got random pulses coming at some rate... > > then counting to some number is giving you a running average of the counts > > And I don't think you'll see a lot of variation. > > One of the pseudo-random shift register things may be better... > > you can clock at the rate you like. There are not many low frequency > > noise sources... maybe 1/f noise in the old carbon comp resistors? > > Geiger counter with weakish source, some chaotic pendulum... > > > > George H. > > > > Yup, the central limit theorem will make the duty cycle approach 50% as > the division ratio goes up. That's actually pretty useful sometimes, > e.g. in building noise servos based on false-count rates. > > A PRBS generator's output is periodic, and so consists entirely of > harmonics of f_clk/(2**N -1), where N is the register length. Filtering > just changes the harmonic amplitudes. > > To make that look continuous, so as to get good noise down below 1 Hz, > you need a fair few bits and a lowish clock frequency, so that the > period is much longer than your measurement. > > The OP seems to be making very heavy weather of a simple job. "Too > small to produce a workable result" is a typical example. > > An ordinary op amp running with a closed loop gain of 100 dB will > produce a lot of low frequency noise, and give some lowpass filtering as > a bonus. (The amp would need at least 120 dB of open-loop gain, but > there are lots of those around.) > > Assuming its 0.1-10 Hz p-p noise is 5 uV, the amplitude would be around > 500 mV, not counting resistor noise. > > If he uses a chopamp, the noise would even be reasonably close to white, > but it would probably need two stages to get enough gain. An OPA378 has > very flat noise of about 20 nV/sqrt(Hz), so in a 10-Hz bandwidth with a > gain of 100000, that would be about 6 mV. A second stage could make > that anything he likes.
All you'll end up making with that setup is a thermal gradient/ microphonics detector that outputs a bunch of off scale DC level jumps that take minutes to settle back down.
> > Cheers > > Phil Hobbs > > > -- > Dr Philip C D Hobbs > Principal Consultant > ElectroOptical Innovations LLC / Hobbs ElectroOptics > Optics, Electro-optics, Photonics, Analog Electronics > Briarcliff Manor NY 10510 > > http://electrooptical.net > http://hobbs-eo.com
On 1/10/19 2:18 PM, bloggs.fredbloggs.fred@gmail.com wrote:
> On Thursday, January 10, 2019 at 9:30:34 AM UTC-5, Phil Hobbs wrote: >> On 1/9/19 3:53 PM, George Herold wrote: >>> On Wednesday, January 9, 2019 at 3:39:10 PM UTC-5, Robert Martin wrote: >>>> On 10/1/19 12:47 am, George Herold wrote: >>>>> On Wednesday, January 9, 2019 at 8:16:36 AM UTC-5, Robert Martin wrote: >>>>>> On 9/1/19 5:26 pm, bitrex wrote: >>>>>>> On 01/08/2019 06:48 PM, Robert Martin wrote: >>>>>>>> I have a CD4060 outputting a 5Vpp 4Hz (4 hertz) square wave at 50% >>>>>>>> duty cycle. >>>>>>>> >>>>>>>> How can I randomly pulse width modulate this so that when a low pass >>>>>>>> filter is added a constantly changing, "wave-like" arbitrary waveform >>>>>>>> will be produced? >>>>>>>> >>>>>>>> I would prefer analog or CMOS IC's, not a microprocessor, and minimum >>>>>>>> parts count. >>>>>>>> >>>>>>>> The "randomness" does not need to be true but only a reasonable >>>>>>>> approximation. >>>>>>>> >>>>>>>> Thank you for any ideas or available circuit diagrams. >>>>>>>> >>>>>>>> Robert Martin >>>>>>> >>>>>>> I think the simplest way to do it without a uP would to build an analog >>>>>>> white noise source a la: >>>>>>> >>>>>>> <http://www.electro-music.com/forum/phpbb-files/2tran_wn_203.gif> >>>>>>> >>>>>>> and then aggressively low-pass filter it. then feed your square wave >>>>>>> into one input of a comparator and the appropriately-scaled low-passed >>>>>>> noise into the other. >>>>>> > >>>>>> >>>>>> I tried using noise, as recommended earlier on this group and elsewhere. >>>>>> The filtered amplitude below 10Hz was too low to produce a workable result, >>>> >> >>>> >>>>> That makes sense (loss of signal) how about filter it at ~10-100 kHz >>>>> and then send it into a counter/ divider to get to lower frequency. >>>>> >>>>> George H. >>>> >>>> Good suggestion. I'll first apply a 1KHz LPF and clip its output to >>>> simulate a logic signal into a divide by 100 counter. >>>> >>>> Robert Martin >>> >>> Robert, now that I think about it, I'm not sure that is going to work... or be that useful. If you've got random pulses coming at some rate... >>> then counting to some number is giving you a running average of the counts >>> And I don't think you'll see a lot of variation. >>> One of the pseudo-random shift register things may be better... >>> you can clock at the rate you like. There are not many low frequency >>> noise sources... maybe 1/f noise in the old carbon comp resistors? >>> Geiger counter with weakish source, some chaotic pendulum... >>> >>> George H. >>> >> >> Yup, the central limit theorem will make the duty cycle approach 50% as >> the division ratio goes up. That's actually pretty useful sometimes, >> e.g. in building noise servos based on false-count rates. >> >> A PRBS generator's output is periodic, and so consists entirely of >> harmonics of f_clk/(2**N -1), where N is the register length. Filtering >> just changes the harmonic amplitudes. >> >> To make that look continuous, so as to get good noise down below 1 Hz, >> you need a fair few bits and a lowish clock frequency, so that the >> period is much longer than your measurement. >> >> The OP seems to be making very heavy weather of a simple job. "Too >> small to produce a workable result" is a typical example. >> >> An ordinary op amp running with a closed loop gain of 100 dB will >> produce a lot of low frequency noise, and give some lowpass filtering as >> a bonus. (The amp would need at least 120 dB of open-loop gain, but >> there are lots of those around.) >> >> Assuming its 0.1-10 Hz p-p noise is 5 uV, the amplitude would be around >> 500 mV, not counting resistor noise. >> >> If he uses a chopamp, the noise would even be reasonably close to white, >> but it would probably need two stages to get enough gain. An OPA378 has >> very flat noise of about 20 nV/sqrt(Hz), so in a 10-Hz bandwidth with a >> gain of 100000, that would be about 6 mV. A second stage could make >> that anything he likes. > > All you'll end up making with that setup is a thermal gradient/ microphonics detector that outputs a bunch of off scale DC level jumps that take minutes to settle back down.
If your layout is sufficiently horrible and you pick the wrong parts. A chopamp and a couple of SMT resistors isn't going to give any problems in a sane layout. I gather you're speaking from experience? ;) Cheers Phil Hobbs -- Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC / Hobbs ElectroOptics Optics, Electro-optics, Photonics, Analog Electronics Briarcliff Manor NY 10510 http://electrooptical.net http://hobbs-eo.com
On 11/1/19 9:44 am, Phil Hobbs wrote:

>>> The OP seems to be making very heavy weather of a simple job.&nbsp; "Too >>> small to produce a workable result" is a typical example. >>> >>> An ordinary op amp running with a closed loop gain of 100 dB will >>> produce a lot of low frequency noise, and give some lowpass filtering as >>> a bonus.&nbsp; (The amp would need at least 120 dB of open-loop gain, but >>> there are lots of those around.) >>> >>> Assuming its 0.1-10 Hz p-p noise is 5 uV, the amplitude would be around >>> 500 mV, not counting resistor noise. >>> >>> If he uses a chopamp, the noise would even be reasonably close to white, >>> but it would probably need two stages to get enough gain.&nbsp; An OPA378 has >>> very flat noise of about 20 nV/sqrt(Hz), so in a 10-Hz bandwidth with a >>> gain of 100000, that would be about 6 mV.&nbsp; A second stage could make >>> that anything he likes. >> >> All you'll end up making with that setup is a thermal gradient/ >> microphonics detector that outputs a bunch of off scale DC level jumps >> that take minutes to settle back down. > > If your layout is sufficiently horrible and you pick the wrong parts.&nbsp; A > chopamp and a couple of SMT resistors isn't going to give any problems > in a sane layout. >
How about if I use junction white noise, add a 1KHz LPF and bias the input of an op amp so it only sees the highest amplitude spikes. I have no idea what the rep rate of those spikes might be, but I may be able to adjust so it is primarily within the sub audio range. These could used as is, or to trigger a square wave which in turn could be filtered to approximate a sine. Robert Martin