Friday, December 6, 2013

Microsoft Ends Windows 7 Retail Sales



Microsoft quietly announced that it officially ceased sales of Windows 7. This is the first time I am actually sad to see a previous version of Windows come to an end. Windows 7 has been my favorite incarnation of the popular OS to date. I have called it "Vista, done right". With Windows 7, Microsoft solved a number of nagging problems from earlier versions, including performance, security, usability, and so on.

Originally, I was anxious to know what Windows 8 would bring. But not anymore. Windows 8 is a huge regression, in my humble opinion. I have been using Windows 8, side-by-side with Windows 7 on various machines. I still stand by my assessment that Windows 8 is a usability disaster; a schizophrenic OS that does a poor job as a tablet interface and as a desktop interface, and forces users to switch between vastly different UIs to accomplish tasks on the same platform. It's just dreadful.

I write software for a living, so I feel that I have some knowledge of which I speak. I'm sorry to see Win7 die, and I hope Microsoft can see fit to give Windows 8 some much needed treatment for its schizophrenia.

Wednesday, November 6, 2013

High Fidelity Hobby Becomes Necessity

I have been an audiophile all my semi-adult life, getting into it in a big way while I was in high school. I just bought the most sophisticated sound system that I have ever owned: a Phonak Audeo Q90-312 system. That's right, they're deaf-aids. I have been struggling with hearing loss for about a decade, and I finally got fed up with not hearing offhand remarks in meetings, and asking people to repeat themselves. My music enjoyment was never affected much, if I turned it up loud enough. But my family objected to that.

I resisted getting hearing aids because I figured the fidelity would be low; optimized for speech intelligibility over fidelity. I had already decided what I wanted: Something like the Dolby S encoder for cassette tape. And it had to be high fidelity, wide band and low distortion.

The Dolby S encoder is essentially a multi-band, equalized compressor, whose job it is to keep low-level signals above the tape hiss, backing off once the input signal gets above the noise level. In my case, the noise is tinnitus - ringing in the ear. For me, it's like narrow band pink noise, centered on about 4 kHz. Sounds need to be louder than that, in that spectral region, in order for me to hear them.

One of the features I like about Dolby S is that the design was based on the principle of least action (Ray Dolby borrowed the term from physics, but it makes sense in a different way, in this context too). As the signal gets above the noise, further expansion isn't necessary, so Dolby S gets out of the way, and lets the system behave normally. Of course, my hearing is compromised, so while the encoder (hearing aid) brings the signal up above the ringing in my ears, there is no corresponding decoder to undo the encoding. Or is there? As a matter of fact, there is: my brain! I'll get back to that.

Hearing Impaired Musician
I started researching hearing aid technology, asking in particular, what do hearing impaired musicians use? Well, they use high-fidelity, WDRC-TILL (wideband dynamic range compression with treble increase at low levels) devices (or they did a decade or so ago). So, armed with this information, I sallied forth to my local audiologist, and told her that I'm her worst nightmare: a well-informed electronics buff, critical listener and opinionated & demanding audiophile. That news didn't seem to upset her in the least.

She took me back to the soundproof room and we did a hearing test. She keyed the data into her desktop computer, which displayed my hearing chart and calculated the necessary correction. We discussed various models of deaf-aids, and I explained that I would require the highest possible fidelity, and that I was very skeptical that anything could meet my requirements. She finally selected a sample and put them in my ears. She then radioed the prescription to the devices, configured them with the necessary gain, equalization and compression (in 20 bands). I could instantly hear better, and they sounded great (w00t)!

These devices have FM transceivers, so they can communicate with each other, and with a Bluetooth ComPilot that I can wear around my neck if I want to use my cell phone hands-free, or listen to a TV or iPod through my deaf-aids. In normal operation, they radio audio information left and right, to continuously triangulate on stereophonic directional cues, just as our brains do. So they can classify noise sources, as well as speech sources, that the digital signal processor on each ear can then sort out in real time. It's quite amazing, and all that in a package that is so small that the casual observer cannot even see I'm wearing unless I point them out.

The electronics (7/8" long) tuck behind each ear, and the tiny loudspeakers, pictured above right, on the other end of the wire, go in each ear canal. They have excellent fidelity - at least for frequencies above 300 Hz or so. Below 300 Hz, where I don't require any assistance anyway, the direct sound just goes right past them. They're driven by a super high-efficiency class-D amplifier, so battery life is about six or seven days (if I turn the devices off at night when I'm not using them). Batteries are mercury free air-zinc type 312.

For the first two weeks, I was delighted that I could understand speech so much better, even in noisy restaurants, and in conferences at work. But I did notice some distracting artifacts: the stereo image seemed to move around, and I noticed a strange "warble", kind of like the sound I would hear when I was a kid, and my brother and I would talk to each other through a rotating fan. Some people describe the sound as being like talking in a corrugated pipe.

The first artifact was undoubtedly due to the devices trying to make voices more intelligible, by changing their directional characteristics. It's great for speech, but for music, not so much. The second artifact, I found after doing a bit of research on the web, is probably caused by the anti-feedback algorithm being set too high. This chipset (code named Spice) has a characteristic sound when feedback cancellation kicks in.

So when I went in for my initial two-week tune-up and oil change, I told the audiologist that I need a "stable platform" for music; I described the warble, and what I had found on the web. She pulled up the configuration software, and I was pleased to see, there was a "music" program right on the menu. So she added it to my configuration options. When I listen to music, I can push the button behind my ear to select the music mode.

The audiologist also noted that anti-feedback was set rather high. She turned it off, and we experimented with various feedback-inducing scenarios, none of which set them off, so we disabled anti-feedback, and the warble is gone. My hearing loss probably doesn't require enough gain to risk feedback. That could change if my hearing continues to decline, but for now it isn't a problem.

When I first started wearing the devices, it was like having new glasses: everything sounded freakishly clear, and I noticed details that I hadn't heard in years. This is like listening to a Dolby S-encoded cassette without the decoder turned on, only more so. But after a while I became accustomed to the sound, until now it just sounds natural - except that I can understand speech and hear soft music. My brain has adapted and provides the necessary decoding.

The fidelity is spectacular - and I'm speaking as an audiophile now. I can listen to music and enjoy it more, and the hearing aids only enhance the experience - they don't get in the way, as I feared they might. Low-volume live music is audible and enjoyable again. I have noticed zero distortion or overload with loud music, and no compression artifacts with sudden dynamic changes. My family appreciates that I don't have to turn up my sound system or the TV to deafening levels. Now I wonder why I waited so long to do this.

Saturday, October 19, 2013

Confessions of a Frustrated Audiophile

Magnavox Portable Stereo Record Player
I have been an audiophile ever since my Grandfather gave me a homemade cabinet containing an Electro-Voice SP12B speaker with an Atlas horn tweeter. At the time (1970), I had a portable Magnavox stereo.

I think the Magnavox had about 3 watts per channel into those 3x6 oval speakers shown in back. Well, I found some RCA plugs and just paralleled the outputs together and hooked them to my Grandfather's single mono speaker (not recommended for audiophile work). But it worked, and the amplifier didn't seem to mind. The sound blew me away. The high end and the low end were like I had never heard before, even from the "hi fi" my parents had in the living room. I was hooked.

The next task was getting back to stereo. So I hunted down a source of EV SP12B speakers. Unfortunately, the one my Grandfather gave me was from the late '50s, and the new ones were of a slightly different design. No matter. I only had $50.00, so I could only afford one. I built some cabinets from a project in Popular Electronics (I think it was), that used some mail-order tweeters from Mouser Electronics. The cabinets were designed for some Radio Shack woofers, but the specs were similar enough to the EVs that I decided to go ahead. I finished building the cabinets, and now I had full range stereo. At 3 WPC. With a ceramic cartridge. Still, I remember it sounded great! I got a lot of enjoyment playing Nilsson Schmilsson, Abbey Road, Ram, Straight Up, The Best of the Guess Who, and ... and I think that was the extent of my record collection then. I had some singles, Joy to the World, American Pie, Albert Flasher, a few others.

BSR 610 Automatic Record Changer
I started reading Stereo Review, and from there I realized that I would need a magnetic cartridge. Also, I started to notice thumps and rumble coming from the record changer in the little Magnavox. Plus, I wished it could play a little louder. My fascination with electronics had led me to get on the Heathkit mailing list, and they always had the most beautiful audio gear (for the time). It was time for an upgrade (such as my meager income could afford). So I bought a Heathkit AA-1214 amplifier and a BSR 610 record changer (with a Shure M71 cartridge). I eventually got matching woofers and purchased EV "building block" midrange horns, tweeters and crossovers.

BIC 980 Belt Drive Turntable
The BSR turntable also had thumps and rumble, so eventually I upgraded it to a BIC 980 with a Shure V15 Type III (I was making more money by then). I used the BIC until about 1984, when CDs started coming out. I bought a Magnavox 4X oversampling CD player (which was actually a Philips, which contained very good electronics and converters). In those days, it was nearly impossible to build a 16 bit D/A converter that was actually accurate to 16 bits. But Philips made 14-bit oversampling converters. The 4X oversampling produced the additional 2 bits by duty cycle modulating bit 0 of the 14-bit converter for 16-bit accurate output. It was ingenious, and it sounded great. So much so, that I started to wish I had a better turntable. Which brings me to the subject of this article. (That's the longest intro I ever wrote).

Dual 505-2 Belt Drive Turntable
Here's my confession: I love my Dual 505-2 turntable! I think it cost me about $300.00 in the day. The salesman talked me into a Denon high-output moving coil cartridge. Moving coils were all the rage in those days. But the Denon never sounded great to me. For one thing, my Heathkit AA-1214 had kind of a noisy phono preamp, and even though the Denon was "high output" for a MC design, it was lower than any moving magnet cartridge. So I purchased an Ortofon OM-20, which is one of the highest output moving magnet cartridges out there. I was kind of a Shure bigot, though. I only went with Ortofon because of the high output, and I had read that Ortofon and Dual had teamed up to match the 505-2 tonearm with the OM-20.

Ortofon OM-20 Phono Pickup
When the cartridge arrived in the mail, I hooked that baby up, and put on my Mobile Fidelity copy of Abbey Road. Wow! I was hooked. That was about 1986. My vinyl collection didn't get as much use in the CD era, or in the MP3 era, for that matter. But what I didn't have in digital format, I have played on vinyl. Over the past few weeks, I have been spinning a lot of vinyl, and really enjoying it, on a turntable and cartridge that is now 27 years old. The OM-20 stylus is still in good shape (I used to replace my old Shure stilii every year or two - don't ask me why the Ortofon has stood up so well). Fortunately, OM-20 replacements are still being made.

Here's the bottom line: Audiophiles and vinylphiles are quick to poo-poo any turntable that costs less than $1000.00, and is built with anything less than unobtanium parts and magical wire, broken in for three months. Well, the fact is, that old Dual is still kicking (after a belt replacement and a few other maintenance repairs), and it is capable of producing sound that is as good as can be stored on vinyl. A 50-lb platter just doesn't turn any more evenly or quietly than a well-engineered lighter one.

Thorens TD 235 Semi-Automatic Turntable
And here's a really interesting tidbit. I was looking at Thorens* turntables with the thought of updating (just because). Guess what I found? One of the midrange Thorens turntables is a dead ringer for the Dual 505-2, and I'm not just a-woofin'. Check it out: The tonearm is identical (right down to the gimbals and headshell), and the semi-automatic operation is as well. The plinth as been redesigned slightly (possibly for easier manufacture), but the look is nearly identical. MSRP: $1000.00 US.

I might buy the Thorens TD 235 someday, but for now, I still love my Dual 505-2 and that sweet sounding Ortofon OM-20. As long as I can still get parts.

* Thorens makes very high-end turntables for the rarefied audiophile community.

Friday, October 4, 2013

WxService Update Available

WxMonitor ow4j130929

  • Modified the Wind Vector to show the wind direction in blue when the average wind speed is zero. The reason for this is that when there is no wind, the wind direction is meaningless. The wind vane will be pointing somewhere, but the direction is completely arbitrary. What's more, without the wind and its turbulence to buffet the wind vane and dither the data, the displayed direction will only be precise to the nearest compass point. When the average wind picks up above zero, the indicator turns red to indicate active status. 

Saturday, September 21, 2013

Going Down! (For Maintenance)

I will be taking the weather station offline for a short time while I upgrade my weather server computer. I hope that this interruption will be brief (less than a day).

Update: We're back!

Wednesday, August 28, 2013

WxService Update Available

WxMonitor ow4j130826

  • Fixed discrepancy with event intervals when wind speed and wind direction both contribute to a single composite value (wind history).  
  • Changed wind history display defaults to 120000 msec. (two minutes) interval and 3600000 msec. (one hour) length; updated config.html to document this.  
(Download...)

Tuesday, August 27, 2013

Building Your Own Computer? Important Safety Tip!

If you are building your own computer, or replacing a motherboard, or moving cables around, here is an important safety tip: Due to atrociously bad engineering, motherboard headers are physically identical for USB and firewire. However, the power and signal assignments are quite different. If you accidently connect your front panel USB ports to a firewire header on the motherboard, then any USB device that you connect to those ports will be destroyed instantly. It may also destroy the firewire port on the motherboard as well. My son and I found that out the hard way, but if you Google it, you will find that we are far from alone.

USB Header Pin Configuration

Firewire Header Pin Configuration

This is an easy mistake to make, especially if it is not the initial build, where you have the motherboard layout docs handy. The headers may not be clearly marked, and often the header nomenclature will be obscured by other components, and board real-estate for silkscreened labels sometimes puts the labels ambiguously far from the thing being labeled.

Update: It is also possible to sabotage your front panel USB jacks by plugging the internal connectors on backwards if the case uses connectors split down the middle. On such a connector, there is no key to prevent reversal, in which case the data polarity is reversed, and worse, +5 goes to GND and vice-versa. The power swap will destroy any attached USB devices. 

Tuesday, August 13, 2013

How Vector Average Would Sum to Zero

In my post Consensus Averaging vs. Vector Averaging, I mentioned that adding two opposing vectors could produce undefined results. In a wind vane data averaging scenario, this would be extremely unlikely.

Assume the following conditions: A sample interval of 1 second, an average interval of 2 minutes, yielding 120 samples per average result. Incoming data is aligned on 16 compass headings:


It is quite possible for any two vectors to sum to zero. But we have 120 vectors to sum. In order to cancel out completely, we would require one of the following:
  • 60 vectors symmetrically distributed on either yellow or violet line.
  • 30 vectors symmetrically distributed on both the yellow and violet lines.
  • 30 vectors symmetrically distributed on any red, green or blue rectangle.
  • 15 vectors symmetrically distributed on all points.
  • Other permutations of symmetrical distributions on the various lines and rectangles and their rotations.
  • Equal numbers of samples from the northeast and northwest will result in a north vector that could be canceled by some number of south vectors. 
This list goes on, but when the wind is blowing, by far the most common scenario will have chaotic or turbulent input data in which more than half of the input data will be in the general direction of the prevailing wind, providing a dithered average with good resolution.

Friday, August 9, 2013

WxService Update Available

WxMonitor ow4j130809

  • Widened Add Property dialog input field labels to display correctly on OpenJDK in Linux.

WxService ow4j130809

  • Refactored WindVane averaging algorithm to use pre-calculated sin and cos values, since we know what they are all the time. Looks up the values based on one of the 16 cardinal compass points. 

Thursday, August 8, 2013

WxService Update Available

WxMonitor ow4j130807

  • Made the WxMonitor animation speed configurable. The animation speed can be controlled by the configuration property wxmonitor.sensor.event.animation.interval. It is normally set for 38, or about one sensor event per minute (fast). You can set it as low as 1, or about 38 sensor events per minute (slow). 
  • Made the WxMonitor animation length configurable. The animation length can be set from 0 milliseconds (no event backlog) to 86,400,000 milliseconds (24 hours) as the last argument on the command line.

WxService ow4j130807

Consensus Averaging vs. Vector Averaging

One Wire Weather Service for Java has been using Consensus Averaging to smooth wind vane data and increase device resolution, from its initial implementation several years ago. I thought it gave good results, although the algorithm proved difficult for me to analyze clearly.

I was reviewing some weather data recently, and I noticed that the wind direction seemed to have slight but noticeable affinity for the sixteen primary compass points. Since nature doesn't do that, I had to suspect a problem with the hardware or software. I decided to start with the software, since that's easier to tweak. I began looking for angle averaging algorithms on the web, simply to get an idea of what kinds of solutions other people had come up with. There are several, some of them quite convoluted, home-brew algorithms. However, I found several similar examples of vector averaging. 

Vector averaging entails converting each angle (wind compass heading from the wind vane) to a vector on the unit circle, and finding the x and y coordinates, averaging the coordinates, and taking the arc tangent, converting them back to an angle. The code to do this is actually very simple.

    /**
     * Calculates the average value by converting the angles to 
     * vectors on the unit circle and averaging the Cartesian 
     * coordinates. This avoids the 360~0 wrap-around at North. 
     * Math.atan2 returns the angle between -pi and pi. Therefore, 
     * we add tau to the result to force a positive angle, mod by
     * tau and convert to degrees.
     * @param data array of sensor data to average.
     * @return average directional value.
     */
    public double averageValue(double[] data) {
        int length = data.length;
        double sin = 0, cos = 0;

        for (int ii = 0; ii < length; ii++) {
            sin += Math.sin(data[ii]);
            cos += Math.cos(data[ii]);
        }
        double theta = Math.atan2(sin / length, cos / length);

        return Math.toDegrees((tau + theta) % tau);
    }

where tau = 2Ï€.

One of the main reasons for averaging wind vane data is that the resolution of the wind vane itself is very coarse - only 16 compass points. But wind is turbulent, so the wind vane swings back and forth over several points. This turbulence dithers the data, so the average has a much higher resolution.

I mentioned earlier that consensus averaging did increase the wind vane resolution, but some affinity remained. I had difficulty analyzing the algorithm, so it wasn't obvious to me how to modify it. But the vector averaging algorithm appears to exhibit no affinity; the output is completely de-correlated, without requiring any tweaks or tuning. It "just works".

Vector averaging does have one potential problem: if two vectors are 180 degrees out of phase, they will cancel out, yielding an undefined angle. Fortunately, we have about 40 data points for each average sample. In order for the average to be zero, all of the vectors would have to be in opposition. That would be exceedingly unlikely for a wind vane that is supposed to point into the wind, even with very low air motion. The widest wind vane swing is about 90 degrees over relatively short time periods (e.g., a two minute averaging interval).

Update: I found out from the authors of consensus averaging that the original implementation did not have the benefit of a software math library with floating point arithmetic and trigonometric functions. That makes all the difference in the world. Necessity is a mother ... ~ KU

Sunday, July 28, 2013

WxService Update Available

WxMonitor ow4j130728

  • Made WxMonitor animate the backlog of sensor events missed since the last update. In the case of WxMonitor initial start-up, if WxService has been running for 24 hours or more, the past 24 hours' events will be animated. If the computer running WxMonitor has been sleeping or hibernating, the animation will cover the duration that the computer was offline, or 24 hours, whichever is lesser. It takes about 30 seconds to animate 24 hours worth of data, and it's entertaining and informative to watch.
  • Widened the buttons on the Configure tab and the Add Property dialog to provide more room when running on Open JDK under Linux, which uses boldface for the dialog font button labels. They didn't fit in the allotted space. A future update will also address a similar problem with the text field labels.

WxService ow4j130728

  • Updated WxService to use OWAPI library version 1.11, which includes support for 64-bit 1-Wire drivers when installed on a 64-bit operating system. (Note: for some reason, the Dallas/Maxim OWAPI library is still tagged with version 1.11, so I'm not sure how one can tell which library is actually present by looking at the WxService logs.)

Thursday, July 18, 2013

WxService Update Available

WxMonitor ow4j130713

  • Added a status bar message string "Downloading 24 hour sensor backlog from %s.", where %s is the URL of the WxService. This provides an indication that the initial backlog of sensor data has not yet been received. On a fast network, you may not get a chance to view this message. On a slow network (e.g., being served from a host that is running behind a DSL connection), it could take up to a minute to catch up.

WxService ow4j130713

  • Changed getSensorData to return all data for the last 24 hours, if the time argument is 0. This is the case when WxMonitor has not received any prior data (as on startup). This change allows WxMonitor to accurately reflect the minimum and maximum readings, and fill all of the averaging buffers on startup. 
This may seem like a step backwards in performance, but it is a major improvement in accuracy. I think accuracy beats the illusion of performance without the accuracy, every time.

(Download...)

Friday, July 5, 2013

Electric Vehicles -- Growing Pains

I have been intrigued by electrically powered vehicles. I know they're more efficient than Carnot-cycle internal combustion engines, and I know that electric motors have a much more user-friendly power curve than IC engines do. Electromotive propulsion is so desirable that diesel-electric railroad locomotives carry their own power generation plants on their backs wherever they go.

I just don't want to ignore practical problems that may also exist. I believe humans (and their media) are overstating the problems of fossil energy. It's because we're familiar with them: They have been in use for a long time, and the nearly universal application by millions of consumers brings the drawbacks up above the noise level. They rise to the level of measurable significance. Meanwhile, the problems associated with electrically powered vehicles are still too small to be obvious because the adoption rate is still negligible, so the media, the environmentalists, the government regulators, the road tax structure, have not picked up on it.

Now, if the illiberal control freaks in government would leave the free market to work these things out (save for the road tax angle), we humans - voting with our hard-earned dollars - would naturally gravitate towards the most practical (or at least cost-effective) solutions without a bunch of top-down central planners making all the wrong decisions for us, based on politics, junk science and poor engineering. If individuals make the wrong decisions, it doesn't require an act of congress to correct them. We just sell or scrap our bad decisions, and buy better ones. It's an evolutionary process.

We still need to solve the problem of how to pay for roads, when electric vehicles are all mains-powered. I don't like the idea of government tracking our position by GPS. Commercial charging stations and battery-swap stations would be a reliable and convenient choke-point for road taxes. I assume that domestic charging will not be the dominant go-forward mechanism for reforming the batteries. I actually think battery-swap stations would be more practical, unless we can dramatically increase the charging rates, or switch to ultracapacitors or some other technology.

The nice thing about charging stations or swap stations, is that they are responsible for their own power supply - generation or connection to the power grid, where it can be taxed at the point of sale. Battery swap stations can have battery banks in stock, so the charging demand could be moved to off-peak times. They might be able to make some use of solar or wind power (although I'm skeptical of that - I think it would be partial at best). Maybe they could even use Crower-cycle diesel generators. The Crower-cycle design would be extremely beneficial in this application. Of course, an intrinsically safe, 20-year pebble bed nuclear reactor buried onsite would be awesome!

Finally, I am very concerned that batteries, especially Li-ion, are not environmentally friendly to make. Even with recycling, which isn't 100% efficient at reclaiming the components, the demand would increase dramatically, and Lithium mines and the manufacture of other components will bring down the wrath of NIMBYs and environmental extremists, dramatically driving up costs, and curtailing the availability (which also drives up prices).

So, lots of things to think about. Left to individual ingenuity, I think we humans would work them out naturally. What we end up with might not look anything like the electric car as we envision them today. But if we allow bureaucrats to regulate the snot out of it, we'll be driving gasoline powered cars up until the point where cost of obtaining gasoline becomes prohibitive.

In case you haven't guessed, the thing that bothers me the most are the agenda-driven regulators, bureaucrats, NIMBYs and environmental extremists. Illiberal control freaks, all of them.

Friday, June 28, 2013

PI is Wrong!

PI isn't wrong in the sense that it is inaccurate, but it was the wrong choice for the circle constant. So many equations have terms that include 2Ï€, if we had chosen a different constant, equal to 2Ï€...



It's a long video, but well worth the time to watch.

Tuesday, April 23, 2013

Lousy Sound -- Capacitors

I am an audiophile, but not an audiophool. I don't buy magic elixirs and oxygen-free copper, especially not in mains cords and speaker wire. The difference between capacitor sounds and amplifier sounds, tubes and transistors, digital vs. analog, have to have some basis in physics, and be demonstrable in a blind A/B comparison, or it doesn't exist. If a blind A/B difference can be detected, then we need a scientific hypothesis, and an explanation with reproducible results, or it's mere superstition.

There are some differences that are so gross, so obnoxious that you don't need a blind test to detect. We all know that. It sometimes happens when a component fails, and all of a sudden there's a hum that wasn't there before, or some kind of distortion that is just painfully obvious, and it goes away when you fix the problem.

Case in point: I have a pair of JBL 500 bookshelf speakers that I purchased for my office about 15 years ago. They're not what I would call hi-fi, but they are adequate for use with my computer sound system, playing the various bleeps and boops, and sometimes an AAC or MP3 here and there. They sounded OK for the past decade or so, but lately they have just started sounding obnoxious. I simply could not stand to listen to music through them. I would have to turn them off. "Obnoxious" was definitely the operative word here. And it wasn't just while I was thinking about it. Background music was distracting me from my other work. It wasn't subliminal.

I was able to rule out the source and most of the amplifier by switching to my AKG K-501 headphones. I still wondered if the amplifier was behaving badly, maybe oscillating, or under-biased with nasty crossover distortion (I usually listen at low volume). But no, the amplifier bench tested well within spec, and all the voltages and currents were normal. It was definitely the speakers -- or my hearing. But no, the headphones sounded OK. It was the speakers. But how? I've never experienced speakers going bad before.

I finally popped the back off the speakers, and at one glance, I had my suspicions. The crossover. It is the simplest kind of crossover that would possibly work, using the cheapest components possible: one (ferrite core) inductor and one (electrolytic) capacitor. The capacitors had gone bad in both channels. They were five microfarad bipolar electrolytics, and if their values changed, if they shorted in one direction, they could become quite non-linear. And of course, a change in value would make the crossover operate at the wrong frequency, and hence, change the frequency response and distortion characteristics of the speakers. I had to replace the caps.

So, what to replace them with? Electrolytics? Well no, but not with audiophool caps either. Electrolytics can deteriorate over time. Film caps generally do not. Five microfarad film caps are available for building crossovers. They're more expensive, and they're physically larger than electrolytics, which is why JBL didn't use them on entry-level bookshelf speakers, which outlived their warranty by some 14 years anyway.

So I paid my three dollars each, and put them in. The main problem was, they wouldn't fit on the crossover circuit board. I had to wire them on, and then use hot glue to secure them in place so they wouldn't vibrate and rattle around. But I got them installed.

The speakers sound much better now, thank you very much. Not obnoxious. I can work once again, undistracted, with music playing in the background. There is definitely a difference when a component is malfunctioning or operating out of spec. Capacitors can have a "sound", especially when they're used as a frequency-discriminating element in a filter, such as a speaker crossover, where voltages are gyrating all over the place. Bypass and coupling capacitors most likely do not have a "sound", unless they're inadequately specified, or if they're malfunctioning.


Thursday, February 14, 2013

Lousy Sound

I have noticed a trend -- lousy sound. I have been a music lover and audiophile (not audiophool, which is unscientific superstition, like anthropogenic climate change) since high school.

Listening to Pandora, I was struck by a new kind of distortion. It's an obnoxiousness in the upper midrange, almost like a harsh, noise modulation being kicked up by things like electric guitars and vocals. It isn't harmonic, and it isn't normal intermodulation. And no, it's not this.

What a long strange trip it's been, getting to the bottom of it. At first, I figured it was Pandora's standard AAC bitrate. So I paid for the subscription version so that I could get the high quality feeds. No joy. Besides, AAC actually sounds really good at reasonable bitrates.

So then I suspected my speakers. Maybe they were just obnoxious, so I started listening with headphones -- three different ones. No joy. Next was the sound card, so I tried a number of different ones on various machines I have at my disposal. They all exhibited the same obnoxiousness.

Heathkit AA-1214
Crossover distortion in my amplifier? I replaced the finals in it a while back, because they went into Vce breakdown and burned up. I used the original part, but with a higher breakdown voltage that wasn't available in 1972. Did I get the bias wrong? It turns out, one of the bias resistors had changed value. So I re-biased both channels. Distortion measurements are well within their original spec. Besides, this amp has never sounded bad to me in the 40 years since I first assembled it. The obnoxiousness persists.

My ears? Maybe... I do have tinnitus... but no, it doesn't happen on every song. I don't notice it with my old personal CD or vinyl collections (although the distortion does sound somewhat similar to vinyl damage from a worn out stylus). But I have been familiar with that phenomenon since the early '70s, when my ears were brilliant. Although I miss with great anguish the acuity of my youth, I do know how to listen. This ain't it.

To reiterate: it doesn't happen on every song. I have heard of the loudness wars that CD producers have been engaged in. It's the same idiotic loudness wars that broadcasters have been engaged in for many years, except it's even more idiotic when we're dealing with a medium that so doesn't need any additional processing to sound good. There's more than enough headroom on a CD for the dynamic range of any music known to humans. There's no reason to pack it all into the top 6 dB of the 96 dB available.

Not only do they compress the snot out of it, they clip it too. If this clipping occurs before the A/D converters, the higher harmonics that would cause aliasing get filtered out. But if they clip after the A/D converters, it will cause aliasing, and aliasing sounds nasty.

Aliasing has no correlation with the harmonic structure of the music (in fact, it's inverted). But it will kick up as noise whenever the digital clipping occurs. I can't imagine that recording engineers and record producers would be so stupid as to clip in the digital domain (without using the proper anti-aliasing filters), but maybe they do. If anybody knows, please drop me a line, or post a comment here.

I would not expect this obnoxiousness to occur with the classics, but with so many classics being remastered and reissued, I expect that the new releases of old material are also getting the same treatment. It certainly sounds like it is. Even our proud legacy is being mutilated.

Thursday, February 7, 2013

Realtek Sound Improving?

A favorite pastime among gamers and audiophiles is to bash Realtek audio codecs. This may have been justified at one time. A build I did several years ago using an Intel D945GCCR motherboard with the Realtek ALC883 audio codec certainly deserved the drubbing. Even an old Sound Blaster 16 PCI was a dramatic improvement.

But a recent build using an Intel DH67BL motherboard with the Realtek ALC892 audio codec was a very pleasant surprise. In A-B listening tests, I was unable to discern the difference between the Realtek and the Asus Xonar DG (a very well regarded audio board).

It's possible that the ALC892 sounds better than the ALC883 chipset. However, the published specs of the two chipsets are too close to quibble, and frankly the horribleness of the sound of the D945GCCR motherboard would have made any specification pointless. The thing that curled my eyelids was the harsh upper midrange distortion, which if anyone measured it, would have pegged the needle. It was that nasty.

You want to know what I think? I think both Realtek chipsets are just fine. I think Realtek is a victim of industry-wide poor motherboard design. I think the problem is with the analog portion of the D945GCCR motherboard, which was designed by Intel. Intel are digital logic designers, not analog audio designers. I think they botched it with the D945GCCR, but they finally got it right with the DH67BL. The former requires an add-in sound card. The latter really is a pleasure to listen to.

I think Realtek's problem is that it's their face on the audio subsystem -- their volume controls, equalizers, effects controllers, media players (if you use them). If Realtek were smart (or a bit smarter anyway), they would let the motherboard manufacturers put their logo on those apps. Then the blame (or praise) for the sound quality would go to the board manufacturer, which actually has more to do with the sound quality anyway.

The sound really depends on the board layout, the analog design and choice of components, whereas if you get the audio codecs right, they're right -- period, end of story. It really isn't any more expensive to make a good audio codec than a poor one, so might as well make a good one. If you get a justifiable reputation for making poor audio codecs, your bottom line will suffer terminally, regardless.

Now, having said all that, I should point out that the Realtek chipsets are not as quiet as the Xonar (with noise levels in the -90 dB range, the Realteks are comparable to 16-bit conversion), whereas the Xonar approaches -120 dB, which consistent with 20 ~ 24-bit conversion. They all claim 24-bit resolution, but only the Xonar approaches actual 24-bit performance.

Make no mistake though, unless you're using this for professional studio work, 16-bits is far more resolution than you'll be able to discern with your naked ear in anything but an anechoic recording studio. As a point of reference, the noise level of a good vinyl analog recording corresponds to about 8 ~ 10-bit resolution.

Saturday, January 26, 2013

Windows 8: Designed by Idiots, for Idiots

Now that I have your attention... I don't really think Windows 8 users are idiots, nor do I think the Microsoft Windows 8 designers and developers are idiots.

But Windows 8 is moribund. DOA. Stillborn. It reminds me of something one of my most respected colleagues once said, "If you make something foolproof, only fools will want to use it". Microsoft has acknowledged that Windows 8 is not as successful as they had hoped. They're blaming everyone but themselves.

I am a software engineer by trade, and one of the most fundamental principles is, "Don't remove features!" The corollary is, "Try not to force users into a particular way of doing things". I've watched Bill Gates for thirty years. I know that he understands these principles. Under Gates' direction, Microsoft understood. But with Windows 8, they threw both of them under the bus. Bill Gates would be spinning in his grave, but he's not dead yet.

Windows 8 offers a new start screen, optimized for touch screens, such as the ones found on tablet computers and phones. Windows 8 needs to support these new technologies. But Microsoft still has many millions of customers who use traditional desktop machines. People with jobs that require them to sit at a desk and type on a keyboard.

I believe Windows 8 would have been much more successful if Microsoft had done two simple things:
  1. Don't remove the Start button! It would have been fine if the Start button had been disabled by default, but give us the option to re-instate it if we want. The total removal is dictatorial, pure and simple. People want control of their lives. They don't like dictators. 
  2. Don't force us to use the Start screen! If someone's job involves desktop apps, don't make them have to dismiss the big green screen just to start working. Put the Start screen on the same footing as the desktop. In fact, the Windows behavior could change based on the computer's capability, and/or the docking state of the main computing unit. 
Microsoft used to understand this. For four Windows generations, users could still use the Windows 95 look and feel. Many of my co-workers still use this, because it gives higher performance, and they just like the old design. 

People are asking Microsoft to re-instate the Start button, but I'm afraid that ship has left the barn. That cow has sailed. Even before Windows 8 hit the streets, at least two (now six) independent software vendors introduced products designed to replace the Start button functionality in Windows 8. If Microsoft were to restore that feature in the OS, they would be in direct competition with these very popular products. Maybe MS could license them, but really Microsoft doesn't need third party software to implement something as simple as a pop-up menu on the task bar. To avoid lawsuits, they'd probably have to pay the Start button ISVs for damages. 

Sorry Microsoft, it was an idiotic move. We're your customers. You're not the boss of us. You're just another OS vendor, in competition for our dollars. Customers vote with their dollars. I am typing this on a shiny new computer that I just built. I had a choice of purchasing Windows 7 or Windows 8. Guess which one I chose. I thought Windows 7 was the best Windows ever. It was Vista done right. Windows 8 could have been a continuation of that theme, but noooo...

Update: Microsoft is reportedly re-instating the Start menu in Windows 8.1. It is also reportedly going to add a "boot to desktop" feature. I won't say, "I told you so", but those were the two things I was ranting about.

Update: Um, no. I just installed 8.1. Microsoft did not re-instate the start menu. They merely re-instated the start button. It takes you to the Metro screen. Whoopee. No dice, M$. I didn't like your shiny new schizophrenic OS, and I still don't. I'm running Start Menu 8, and will continue to do so until M$ pulls their heads out. Why a company would alienate an installed base of millions is beyond me.

One last update: Microsoft got one thing right with the reinstated start button: you can right click it, and get a menu of some fairly useful stuff.
  • Programs and Features
  • Power Options
  • Event Viewer
  • System
  • Device Manager
  • Network Connections
  • Disk Management
  • Computer Management
  • Command Prompt
  • Command Prompt (Administrator)
  • ----------
  • Task Manager
  • Control Panel
  • File Explorer
  • Search
  • Run
  • ----------
  • Shut Down or Sign Out > (the usual options)
  • Desktop (cancels the menu?)
Okay, so that's almost useful. Worst case, I'll be right clicking for the run dialog all the time.

Monday, January 14, 2013

Windows: Choppy Audio and Poor Performance

A computer system running Windows XP (yes, it's that old) had been running fine for several years, when all of a sudden it started feeling really sluggish, and most annoying, the audio playback became very burbly. The audio buffers were not getting filled as fast as the sound card emptied them. As a result, the sound card was looping sporadically on the same buffer. This happened mainly when disk activity was occurring.

After trying several time-consuming and pointless exercises to fix the problem, I happened on the solution more or less by accident:


You can see that the Current Transfer Mode is Ultra DMA Mode 5. This is what you want. What I found was PIO Mode. PIO stands for "Programmed I/O", and it is the slowest transfer mode, which requires the processor to stop what it's doing (like playing audio), and move the data from the drive controller to memory and vice-versa. DMA stands for "Direct Memory Access", which allows the processor to set up the transfer, and then allows the DMA controller to actually move the data from the drive controller to memory and vice-versa, so the processor can keep working on other things.

When your disk drive performance suddenly seems sluggish, and especially if multimedia performance becomes jerky and choppy, check your IDE channel properties, and make sure it's running in DMA mode. In Windows XP (and on Vista and Windows 7 as well), select Computer Management/Device Manager, and expand IDE ATA/ATAPI controllers, and make sure they're running in DMA mode.

How does the controller get into PIO mode in the first place? Several reasons. The most common one is that there have been too many drive read errors, and after several of these, Windows reverts to a "fail safe" mode. Unfortunately, it doesn't alert you about it. So yes, you might have a disk drive failure looming. Other reasons include a faulty or improperly plugged drive cable or power cable. After you have verified that everything is connected properly, and maybe run chkdsk, use Device Manager to uninstall the lobotomized controller and then restart Windows. Windows will re-install the controller automatically. In the process, it should revert to DMA mode if the drive is responding properly.