DSPRelated.com
Forums

Looking for the whitest sequence of 1's and 0's

Started by Tim Wescott July 6, 2016
On Thursday, July 7, 2016 at 10:40:48 PM UTC-7, Tim Wescott wrote:

(snip, someone wrote)

> > You can, but the result would not be bipolar, it would be real-valued.
> > Tim states "a vector filled with binary numbers". (I think he meant > > bipolar, or bi-valued, or whatever the correct terminology du jour is.)
I believe it is binary. Not so long ago, I wrote a JBIG compressor. JBIG is Joint Binary Image Group, and the algorithm is for compressing binary (black and white but not gray) images.
> That's correct. Bipolar but not in a medication-needing sort of way.
I always thought bipolar related to transistors. I was reading not so long ago "The Invention That Changed the World" which is mostly the story of the invention of microwave radar. During WW2, they built 10cm and 3cm radar units, or 3GHz and 10GHz in more usual units. To do that, they used point contact rectifiers, along with a process for purifying silicon appropriately. (But leaving in enough impurities so that it was actually doped.) At one point near the end of the war, someone had a rod of silicon that rectified one way at one end, and the other way at the other end. That is, was p-type one end and n-type the other. It was understanding the properties of silicon and germanium that led to the point contact transistor, and not so much later to the junction transistor. But it all traces back to radar work on semiconductor rectifiers. They also trace back magnetic core memory to computers used for early warning radars near the beginning of the cold war, and so credit much of the computer industry to radar developments.
<herrmannsfeldt@gmail.com> wrote:

>On Thursday, July 7, 2016 at 10:40:48 PM UTC-7, Tim Wescott wrote:
>(snip, someone wrote)
That was I.
>> > You can, but the result would not be bipolar, it would be real-valued. > >> > Tim states "a vector filled with binary numbers". (I think he meant >> > bipolar, or bi-valued, or whatever the correct terminology du jour is.) > >I believe it is binary.
Bipolar is correct. Google on "bipolar signal", "bipolar signaling". Binary means base 2, and so it can be confusing to use binary to indcate bipolar. Steve
On Friday, July 8, 2016 at 4:14:52 PM UTC-7, Steve Pope wrote:

(snip)
> >On Thursday, July 7, 2016 at 10:40:48 PM UTC-7, Tim Wescott wrote:
> >(snip, someone wrote)
> That was I.
> >> > You can, but the result would not be bipolar, it would be real-valued.
> >> > Tim states "a vector filled with binary numbers". (I think he meant > >> > bipolar, or bi-valued, or whatever the correct terminology du jour is.)
> >I believe it is binary.
> Bipolar is correct. Google on "bipolar signal", "bipolar signaling".
"In telecommunication, a bipolar signal is a signal that may assume either of two polarities, neither of which is zero."
> Binary means base 2, and so it can be confusing to use binary > to indcate bipolar.
So, if one of the values is zero, it isn't bipolar. I thought the one under discussion had one that was zero, but yes it can be confusing. For example, "binary file" is often used to mean a file that isn't readable text, even though text files are normally stored in binary. -- glen
<herrmannsfeldt@gmail.com> wrote:

>On Friday, July 8, 2016 at 4:14:52 PM UTC-7, Steve Pope wrote:
>> >I believe it is binary. > >> Bipolar is correct. Google on "bipolar signal", "bipolar signaling". > > "In telecommunication, a bipolar signal is a signal that may assume >either of > two polarities, neither of which is zero." > >> Binary means base 2, and so it can be confusing to use binary >> to indcate bipolar. > >So, if one of the values is zero, it isn't bipolar.
Per the above, yes. I think in a narrow sense, bipolar connotes that not only is the signal representing just one bit, but that bit is represented at the physical layer by two values. I am not sure about the "neither is zero" part of the definition; you could get in trouble relatively quickly by applying this to conclude that, for example, an ECL signal is bipolar but a CMOS signal is not bipolar. A example of a signal that is clearly bipolar is RS-232.
>I thought the one under discussion had one that was zero, but yes it can >be confusing.
I think in this discussion we can leave the physical layer out of it, but maybe I introduced it by using the bipolar terminology in the first place. Steve
On Fri, 08 Jul 2016 16:24:02 -0700, herrmannsfeldt wrote:

> On Friday, July 8, 2016 at 4:14:52 PM UTC-7, Steve Pope wrote: > > (snip) >> >On Thursday, July 7, 2016 at 10:40:48 PM UTC-7, Tim Wescott wrote: > >> >(snip, someone wrote) > >> That was I. > >> >> > You can, but the result would not be bipolar, it would be real-
valued.
> >> >> > Tim states "a vector filled with binary numbers". (I think he
meant
>> >> > bipolar, or bi-valued, or whatever the correct terminology du jour
is.)
> >> >I believe it is binary. > >> Bipolar is correct. Google on "bipolar signal", "bipolar signaling". > > "In telecommunication, a bipolar signal is a signal that may assume
either of
> two polarities, neither of which is zero."
[possibly OT] You should be aware that in telecommunication there are some modified AMI (alternate mark inversion) + RZ (return to zero) line codes that are described as bipolar despite having three voltage levels: +, - and 0. AMI: A one is signalled by an alternating + or - (i.e. one symbol uses +, the next uses -, the next uses + and so on) simply to provide DC balance. RZ: the voltage returns to zero during each symbol to provide transitions for clock recovery. i.e. a symbol consists of: Zero: 0 for the full T symbol duration One: + or - for T/2, followed by 0 for T/2. (+ and - typically alternate to give DC balance, sometimes with "bipolar violations" to signal ... things) Examples: HDB3, used on E1 B3ZS, used on T3 The 'B' in those acronyms stands for Bipolar. Reference: ITU-T G.703. Whilst these are quite old line encodings (1970s?) they were quite popular and are still used in new products today (albeit mostly to connect to legacy equipment). The codes are, of course, fairly inefficient in terms of channel capacity, but they were just right for the technology of the day (e.g. using a full wave rectifier + LC tank for the symbol timing recovery (yes, I have done that in actual products)). These codes should not be confused with true ternary codes (which also use three voltage levels). E.g. 4B3T (ISDN), MLT3 (100M Ethernet), etc. Regards, Allan
Allan Herriman  <allanherriman@hotmail.com> wrote:

>You should be aware that in telecommunication there are some modified AMI >(alternate mark inversion) + RZ (return to zero) line codes that are >described as bipolar despite having three voltage levels: +, - and 0.
>AMI: A one is signalled by an alternating + or - (i.e. one symbol uses +, >the next uses -, the next uses + and so on) simply to provide DC balance. >RZ: the voltage returns to zero during each symbol to provide transitions >for clock recovery.
>i.e. a symbol consists of:
>Zero: 0 for the full T symbol duration
>One: + or - for T/2, followed by 0 for T/2. (+ and - typically >alternate to give DC balance, sometimes with "bipolar violations" to >signal ... things)
Thanks for this information. Without saying that any of the following applies to any of the above: My experience is that terminology as used in standards documents is often inconsistent with that used (or previously used) by researchers and design engineers. In some cases, a section of a standard might be correctly named initially, but then as the standard is developed the technical content changes without the section being re-named, and that gets finalized. Or naming is used that conforms to regulatory nomenclature without the actual technical content conforming, as a sort of end-run around a regulation. Steve
On Wed, 06 Jul 2016 15:59:42 -0500, Tim Wescott wrote:

> I want to fill a vector with binary numbers, evenly balanced between ones > and zeros, such that (with the exception of the honkin' big spike at DC) > its FFT is as flat as possible. > > Is there an algorithm for doing this?
Wild-arsed guess: 1. Generate a random vector of bits 2. Compute its FFT 3. Find the frequency whose magnitude is farthest from the average magnitude. 4. Find the bit which, if flipped, will make that magnitude closest to the average magnitude, and flip it. If the number of 0s and 1s is unequal, only consider bits which have the correct value. 5. Update the FFT. 6. Go to 3.
Nobody  <nobody@nowhere.invalid> wrote:

>1. Generate a random vector of bits >2. Compute its FFT >3. Find the frequency whose magnitude is farthest from the average >magnitude. >4. Find the bit which, if flipped, will make that magnitude closest to the >average magnitude, and flip it. If the number of 0s and 1s is unequal, >only consider bits which have the correct value. >5. Update the FFT. >6. Go to 3.
Great idea. A related, more complex approach might be to use the Forney algorithm to flatten the response. I once had a one-bit (bipolar, dare I say) signal from which I needed to remove an unwanted third harmonic, and Forney worked in that case. (While it's most common to use a Forney equalizer to flatten the spectrum of a signal, if the signal is bipolar (or I suppose, m-polar for small m) you can flatten the signal directly without passing it through an equalizing filter.) Steve
On Sat, 09 Jul 2016 12:34:31 +0100, Nobody wrote:

> 3. Find the frequency whose magnitude is farthest from the average > magnitude. > 4. Find the bit which, if flipped, will make that magnitude closest to the > average magnitude, and flip it. If the number of 0s and 1s is unequal, > only consider bits which have the correct value. > 5. Update the FFT. > 6. Go to 3.
Tried this, and it tends to get stuck in false minima. Similarly for just selecting a random bit and testing whether flipping it makes the spectrum more or less flat.
On Sun, 10 Jul 2016 09:40:45 +0100, Nobody <nobody@nowhere.invalid>
wrote:

>On Sat, 09 Jul 2016 12:34:31 +0100, Nobody wrote: > >> 3. Find the frequency whose magnitude is farthest from the average >> magnitude. >> 4. Find the bit which, if flipped, will make that magnitude closest to the >> average magnitude, and flip it. If the number of 0s and 1s is unequal, >> only consider bits which have the correct value. >> 5. Update the FFT. >> 6. Go to 3. > >Tried this, and it tends to get stuck in false minima. Similarly for >just selecting a random bit and testing whether flipping it makes the >spectrum more or less flat.
Getting stuck in local minima is a common issue with adaptive algorithms. You might try flipping a bunch of bits to check whether the current minimum is local or not.