DSPRelated.com
Forums

Binary white noise signal

Started by pa1kumar July 5, 2007
>Randy Yates wrote: >> julius <juliusk@gmail.com> writes: >>> [...] >>> Strictly speaking, it is not "white". >> >> A digital signal can never be white anyway... > >In a sampled-time system if each sample is independent from all the rest
>and the mean is zero, then the power spectral density of the >sampled-time signal will be flat. > >Further, if your output is in the form of a train of dirac impulses >taking on the weighting of the sampled signals then the spectrum in >continuous time will be flat, also. > >I think it's entirely fair to describe such a signal as "white", as long
>as you make sure folks know that it's in sampled time. > >-- > >Tim Wescott >Wescott Design Services >http://www.wescottdesign.com > >Do you need to implement control loops in software? >"Applied Control Theory for Embedded Systems" gives you just what it
says.
>See details at http://www.wescottdesign.com/actfes/actfes.html >I am sorry guys that i was not that clear with my question. So the
spectrum i want for the binary signal is that it should be as flat as possible until the 2Hz and roll off at 2HZ. I think i cant say it entirely as white but i want this kind of a binary signal. Ok step is the clock step , which is if i have a file of input data it reads each line at every clock step which here is the 0.01ms. To Julius: The PWM is pulse width modulation. I used a random spike generator and a sinusoidal signal. Compared both signals to get the binary signal. Yes i can take the ascii values of the output and read it into other, but consider i have a time interval of my output till 1000 (generated matlab output so units here doesnt matter).If i read this into an another software(which is a neural software, where the time is taken in ms) it reads the entire input data to only 10 ms since my time step there is 0.01ms. So you see here my input gets compressed when it is read but i want my software to read it as 1000ms itself and i dont want to change my time step there as it will effect the accuracy of output of my software. I hope i am clear with the question this time. Thanks Pavan
Tim Wescott <tim@seemywebsite.com> writes:

> Randy Yates wrote: >> julius <juliusk@gmail.com> writes: >>> [...] >>> Strictly speaking, it is not "white". >> A digital signal can never be white anyway... > > In a sampled-time system if each sample is independent from all the > rest and the mean is zero, then the power spectral density of the > sampled-time signal will be flat.
It will be flat from -pi to +pi. That's not "flat to infinity."
> Further, if your output is in the form of a train of dirac impulses > taking on the weighting of the sampled signals then the spectrum in > continuous time will be flat, also.
Wow! I think you just crossed a couple of mathematically dangerous lines. First of all, a "signal" consisting of weighted Dirac delta functions is not transformable since it has infinite energy. Second (and related), the spectrum of a random signal is not defined by taking the Fourier transform of the signal directly, but rather by taking a) the continuous-time Fourier transform of the continuous-time autocorrelation function if the random signal is continuous, or b) the discrete-time Fourier transform of the discrete-time autocorrelation function if the random signal is discrete. (And assumed wide-sense stationary in either case.) Since, in the case of a discrete signal, the result of the discrete-time Fourier transform is only defined from -pi to +pi (or -Fs/2 to +Fs/2, depending on how it's defined), you can't talk about what's outside that range.
> I think it's entirely fair to describe such a signal as "white", as > long as you make sure folks know that it's in sampled time.
If you looked at the analog output of a digital signal with independent samples, I'd expect you'd see something that was flat from DC to Fs/2. That isn't "white" as I understand the term white since, for one thing, it's a finite-power signal. -- % Randy Yates % "And all that I can do %% Fuquay-Varina, NC % is say I'm sorry, %%% 919-577-9882 % that's the way it goes..." %%%% <yates@ieee.org> % Getting To The Point', *Balance of Power*, ELO http://home.earthlink.net/~yatescr
"pa1kumar" <pavan352004@yahoo.com> writes:

> I am sorry guys that i was not that clear with my question. So the > spectrum i want for the binary signal is that it should be as flat as > possible until the 2Hz and roll off at 2HZ. I think i cant say it entirely > as white but i want this kind of a binary signal.
That's easy - generate a series of independent samples and run them through a filter of the desired shape. The hard part is specifying and designing the filter. -- % Randy Yates % "My Shangri-la has gone away, fading like %% Fuquay-Varina, NC % the Beatles on 'Hey Jude'" %%% 919-577-9882 % %%%% <yates@ieee.org> % 'Shangri-La', *A New World Record*, ELO http://home.earthlink.net/~yatescr
Randy Yates wrote:
> julius <juliusk@gmail.com> writes: >> [...] >> Strictly speaking, it is not "white". > > A digital signal can never be white anyway...
A digital signal has limited bandwidth, but a signal can be flat (or not) over the bandwidth it has. If "white" is taken to mean infinite bandwidth rather that the bandwidth of interest, then there can be no white light. Jerry -- Engineering is the art of making what you want from things you can get. &macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;
Randy Yates wrote:

> Tim Wescott <tim@seemywebsite.com> writes:
(snip)
>>In a sampled-time system if each sample is independent from all the >>rest and the mean is zero, then the power spectral density of the >>sampled-time signal will be flat.
(snip)
>>Further, if your output is in the form of a train of dirac impulses >>taking on the weighting of the sampled signals then the spectrum in >>continuous time will be flat, also.
> Wow! I think you just crossed a couple of mathematically dangerous > lines.
> First of all, a "signal" consisting of weighted Dirac delta functions > is not transformable since it has infinite energy.
It was previously decided that white noise has infinite energy, so it seems the right direction.
> Second (and related), the spectrum of a random signal is not defined > by taking the Fourier transform of the signal directly, but rather by > taking a) the continuous-time Fourier transform of the continuous-time > autocorrelation function if the random signal is continuous, or b) the > discrete-time Fourier transform of the discrete-time autocorrelation > function if the random signal is discrete. (And assumed wide-sense > stationary in either case.)
My interpretation is that he was taking a signal that was white over the given bandwidth (0 to Fs/2) and aliasing to infinity. That isn't quite the same as white, since it will have correlations that it shouldn't otherwise have, but I would agree that under spectral analysis it should look white. -- glen
Randy Yates wrote:
> Tim Wescott <tim@seemywebsite.com> writes: > >> Randy Yates wrote: >>> julius <juliusk@gmail.com> writes: >>>> [...] >>>> Strictly speaking, it is not "white". >>> A digital signal can never be white anyway... >> In a sampled-time system if each sample is independent from all the >> rest and the mean is zero, then the power spectral density of the >> sampled-time signal will be flat. > > It will be flat from -pi to +pi. That's not "flat to infinity."
Yup. That's probably why I said "flat", not "flat to infinity". You say later in your post that the output of a discrete-time Fourier transform is only defined from -pi to +pi -- thus, a signal as I have described is flat over the entire range of valid frequencies of the analysis -- you can't get any flatter than that.
> >> Further, if your output is in the form of a train of dirac impulses >> taking on the weighting of the sampled signals then the spectrum in >> continuous time will be flat, also. > > Wow! I think you just crossed a couple of mathematically dangerous > lines.
Probably. It's fun, and safer than drinking while skateboarding.
> > First of all, a "signal" consisting of weighted Dirac delta functions > is not transformable since it has infinite energy.
Neither is purely white noise, for the same reasons. Continuous-time white noise is a convenient mathematical fiction. So are Dirac delta functionals. Why admit the one and not the other?
> > Second (and related), the spectrum of a random signal is not defined > by taking the Fourier transform of the signal directly, but rather by > taking a) the continuous-time Fourier transform of the continuous-time > autocorrelation function if the random signal is continuous, or b) the > discrete-time Fourier transform of the discrete-time autocorrelation > function if the random signal is discrete. (And assumed wide-sense > stationary in either case.)
If you don't like the Dirac delta functional your analysis will choke pretty quickly when you try to find the autocorrelation function of white noise. One runs into difficulties with analyzing the signal, but they can be resolved if you hold your mouth right. Of course the fact that the signal is sampled throws a wrench into the works if you're not careful, but it can be overcome. I think you'll find that if you represent the impulses as rectangles with area = 1, that are parameterized for width, you can the analysis then take the limit as the width goes to zero -- you'll find that the spectrum goes to white as expected. If you're more adventurous, you can just extend the definition of the sampling property of a Delta functional to include generating a functional -- then it all works in one step. I don't think you have to assume wide-sense stationarity, but if you must just consider that you don't know the phase of the sample clock, and refuse to find out -- then your signal (although odd) is WSS.
> > Since, in the case of a discrete signal, the result of the > discrete-time Fourier transform is only defined from -pi to +pi (or > -Fs/2 to +Fs/2, depending on how it's defined), you can't talk about > what's outside that range.
That depends on how you model your signal. If you model the signal as a series of numbers, then you are constrained to the discrete-time Fourier transform but you have to take aliasing into account in your reconstruction (which is, in this case, by generating equivalent-strength delta functionals). If you model the signal, as is often done, as a sequence of delta functionals then you don't do the discrete-time Fourier transform on it -- you do a continuous-time Fourier transform, whose result _is_ defined over all frequencies.
> >> I think it's entirely fair to describe such a signal as "white", as >> long as you make sure folks know that it's in sampled time. > > If you looked at the analog output of a digital signal with independent > samples, I'd expect you'd see something that was flat from DC to Fs/2.
I'd expect I'd see something that diminished as sin(pi * f * Ts)/f, at least if the signal is just going to a normal DAC that acts as a zero-order hold.
> That isn't "white" as I understand the term white since, for one thing, > it's a finite-power signal.
Well, that's why I was trying to define what "white" means in sampled time! -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" gives you just what it says. See details at http://www.wescottdesign.com/actfes/actfes.html
On Jul 6, 12:53 am, "pa1kumar" <pavan352...@yahoo.com> wrote:
> Hi, > > I am trying to generate a random binary white noise signal such that when > we take the auto spectrum of the signal it should roll of at 2Hz. I tried > to do that by PWM but wasn't close. I was wondering if there is any better > way to do this? > > I want to use this signal as an input in other software where the time is > taken as a default milliseconds(ms) and the time step is 0.01ms. Is there > a way to make my output in matlab compatible with the other software. > > Any help regarding this would be great. > > Thanks > Pavan
Just pass white noise through a filter with the desired cut-off. It's then coloured noise but white up to the passband freq.