Monday 28 July 2014

AirPlay Problem :(

BitPerfect appears to have a problem with AirPlay following the coincidental updates of OS X to version 10.9.4 and iTunes to version 11.3.  It is most likely that the OS X update is responsible, but we can't be sure at this time.  The problem results in there being no sound over AirPlay even though BitPerfect's menu bar icon is green.  Error messages from 'coreaudiod' are sent to the console log every second or two.  We are still trying to get to the bottom of this, and I will post further information here as things become clearer.

Friday 25 July 2014

The Gold Standard?

Audiophiles often report being able to hear audible effects for which the currently accepted wisdom has no adequate explanation.  In such circumstances, the internet trolls - who are only ever skeptics - can be relied upon to invoke two ideas from medical science to disparage any viewpoints which disturb their comfort zones.  The first is the Double Blind Test (DBT).  According to those “experts”, unless you can demonstrate that a thing is audible via a scientifically-conducted DBT, then you have no basis for claiming that it is at all audible in the first place.  The second is that, when faced with a significant body of opinion that the disputed audibility is in fact real, they will attribute the result to “the placebo effect”, the strong implication being that idiot audiophiles are simply fooling themselves.  Unfortunately, the underlying basis of these invocations almost always goes unchallenged.  Is it right to uphold a DBT as the Gold Standard for determining subjective attributes?  And can the placebo effect be validly raised to explain away subjective observations?  I thought it would be worthwhile to take a closer look at those things.

A medical experiment often involves comparing one thing with another - usually a specific treatment and a placebo.  A DBT is conceived to eliminate two critical sources of bias from the test - those originating from the subject and those originating from the experimenter.  In the medical field, both sources of bias are unusually significant.  The subject clearly has a personal vested interest in the outcome of the test, and knowing whether they are receiving a real treatment or a placebo may compromise its validity.  A medical experimenter is typically a doctor, who has a overarching duty to the patient, and maybe also has a biased interest in the outcome of the experiment.  Bias on either part can destroy the validity of the experiment, and so a DBT is a test regimen which ensures that neither the subjects nor the experimenter are aware which of the test subjects are receiving which of the treatment options, knowledge which could affect the outcome of the experiment.

The first recorded DBTs were done during WWI with patients suffering from “shell shock”, a syndrome with which there was considerable disagreement within the medical profession regarding its interpretation, treatment, and prognosis - it was therefore particularly important that the treating physician be ‘blinded’ from the specifics of the ongoing test.  To be fair, DBTs are used these days in fields other than medicine (although much more rarely), but usually only where there is reason to suspect the influence of experimenter bias.

Incidentally, there is also a “Triple Blind Test” in which the person assessing the results and determining the formal outcome of the experiment is also blind to the details of the experiment.

A key element of a DBT is that the subject must be responsive to the test.  In other words, if we are testing the efficacy of an anti-cancer drug, it is no use using subjects who do not have cancer.  The responsiveness of the patient is usually assured by the fact that patient desires to be cured.  But if the test requires its subjects to walk five miles every day between visits to the clinic, it is important to weed out subjects who are likely to play fast and loose with their obligations to faithfully pursue the prescribed regimen.  Finally, if the outcomes are self-reported (for example, the subjects are asked whether their headaches disappeared), the experiment’s entire outcome relies on the subjects’ ability to self-report, both accurately and consistently.

So there we have the three pillars of a successful DBT.  Both the experimenters and the subjects must be free from bias, and the observed outcomes of the test must be both unambiguous and reliable.  That third requirement is one which high end audio’s internet trolls tend to forget.  It is no use whatsoever constructing a test with great detail paid to the blinding of the subjects and experimenters if the ability of the test methodology to delineate the anticipated outcomes has not been previously established.  In a medical example, this would be like using a DBT to determine whether a certain treatment made the subjects “feel better”.  The experiment would be totally pointless unless we had evidence to show that the methodology of the test can satisfactorily extract from the subjects reliable information as to the extent to which they “feel better”.

In audio, this third requirement is usually the killer.  ‘Blinding’ both the subjects and the experimenters is a trivial thing to do.  Extracting unambiguous test results from the subjects is not, and there are good reasons for this.  For a start, Joe Average is not a good test subject when it comes to detecting subtle differences in audio presentation.  The fact that Joe cannot perceive something is not proof that the thing cannot be perceived, even if you assemble a thousand Joes.  It is necessary to pre-qualify the test subjects, to establish that they can reliably detect the sort of differences that you are looking to test for under the conditions of your test methodology before you include them in the test.  The kind of skeptics who promote the concept of DBTs to resolve audiophile disputes usually find this requirement to be in some way unacceptable (of course), but that’s the truth of it.

Stereophile’s Michael Fremer - a favourite target of the internet trolls - has never made any secret of his willingness to participate in a properly conducted test to determine whether or not he can actually hear the things he claims he can.  He has even volunteered to go head-to-head with the Amazing Randi with $10,000 at stake.  But he has always insisted on having a veto over the methodology.  In other words, he won’t allow himself to be tested under conditions where he doesn’t think he will be able to perform.  He is very open about what he considers those conditions to be.  I find nothing wrong with that, and I fully accept that the more esoteric the differences he is expected to be able to resolve, the more picky his requirements are by necessity going to be.

The other medical tool in the audio skeptic’s armoury is the “Placebo Effect”.  Most people think they know what the placebo effect is, but very few actually do.  In reality, surprisingly little is known about it.  It arose from the first clinical drug trials, when it was discovered that patients tended to improve when treated with sugar pills which had no apparent active medicinal effect.  Such pills - and their procedural analogues - became known as placebos.  Therefore the standard that any drug or procedure had to meet before it could be introduced onto the market was that it had to outperform a placebo.  That is fair enough, but for decades the question was always “how can we make better drugs” and never “how can we make better placebos”.  That is changing, though.

A significant hindrance in pursuing placebos as a treatment was - and is - the troublesome ethical dimension to the debate.  Treating with a placebo would appear to require deliberate deception on the part of the doctor.  But placebo research is now a lot closer to mainstream, and the medical establishment is prepared to at least consider as valid a lot of the research into what the placebo effect actually is.  This research is beginning to deliver some unexpected answers, and while these are interesting they only serve to give rise to some new and unexpected questions.  For example, early studies appear to show that you can actually tell patients that they are taking placebos and yet still observe the same benefits.  Other studies are now looking into the physiological response of patients to placebo treatment, and comparing these responses to responses under other types of stimulus.  Just the simple fact of a doctor displaying a sympathetic and attentive bedside manner turns out to be an effective placebo, which may not be something your budget-constrained Minister of Health wants to hear.  So studies are also looking at the physiological responses of doctors while administering placebo treatments - who knows where that might lead!  With all this new interest, a lot of traditional non-western medicines - acupuncture would be a clear example - are now suggested as being perhaps elaborate protocols for administering the placebo effect.  It is a fascinating topic.  If you are interested to read more, do a Google search for “The Placebo Phenomenon” - the first hit should be from Harvard Magazine.  Read it.

The key takeaway for those who want to invoke the placebo effect in the audiophile debate is that it is a real and quantifiable effect.  Phenomena attributable to the placebo effect are undeniably real - it’s just that you don’t have an adequate explanation as to why.  It is wrong to invoke it in order to imply that something exists only in a person’s imagination, or is a product of self-delusion.  If a person insists that placing an Elvis Presley bobble-head on his amplifier improves the imaging depth of his system, it might be quite reasonable to be a little skeptical, but it would be incorrect to suggest that the placebo effect is responsible.  Actually, by suggesting it is a placebo effect, you are in effect acknowledging that the system’s imaging depth IS improved!  An Elvis bobble-head may be a lot of things, but a placebo probably ain’t one of ‘em.

Wednesday 23 July 2014

Sports Stars

Here in Canada - and particularly here in Montreal - we love our Hockey.  Ice Hockey, that is.  Hockey is arguably the fastest, most energetic, most physical professional sport on the planet.  With enough moolah in your pockets, you can buy NHL tickets that seat you right up against the glass - less than an inch from the most explosive action in sports.  No professional sport in the world can come close to providing the experiencing of watching an NHL game from one of those seats.

Like most professional sports, if you want to play NHL Hockey you need to be seriously committed from an early age.  You’ll need the right combination of body type, serious skills, unblinking determination - not to mention parental support - if you are to crack the 23-man roster on one of the 30 teams in the National Hockey League.  So many aspire to join those ranks, but so few ever make it.  Every single teenager who plays amateur Major Junior Hockey in the USA or Canada shares that ambition, but in fact less than one in twenty will succeed.

It is like that in other major league sports, too.  Baseball, Football (aka Soccer), Football (aka Football), Tennis, Formula One, Golf, Basketball, Boxing.  But the financial rewards for making it to the pinnacle can be truly staggering.  In all of these professional sports, the top stars earn mind-boggling sums of money.  I suppose that’s fair enough. In all walks of life, those with the greatest skills and steeliest determination tend to make it furthest up the ladder, whether you are a businessman, a doctor, a lawyer - or a sportsman. I  suppose that is something we can all accept.

But yesterday, I heard something in a Ted Talk (it was on the radio so I can’t post a link) that made me stop and think.  In Basketball, as we all know, it pays to be tall.  The shorter you are, the less chance you have of making it to the NBA.  According to Wikipedia, in its entire history, only 24 players 5’ 9” tall (the height of an average American male) have ever made it to the NBA.  Apparently, there are only two such players active today.  Imagine the skill you would need to make it to the NBA as a human being of only average height.  Today, in the NBA, a full 10% of all the players are seven feet tall or more.

Does just being seven feet tall trump all the skill in the world?   Incredibly, it would appear so.  Today, according to the Ted Talk, of all Americans alive today who are seven feet tall, an incredible 17% of them are **ALREADY** playing in the NBA!!  And that’s before we take into account those who are too old (or too young).

Think about that.  If you grow up to be seven feet tall, before we even start to consider any physical skills that you may or may not possess, you already have a better than one-in-five chance of being accepted into a professional cadre whose minimum salary is half a million dollars a year; whose average salary is 5 million dollars a year; and whose top performers pull in more than 20 million dollars a year.

I find that surprisingly disturbing.

Tuesday 22 July 2014

The Thrill Of The Chase

I had a friend named Steve (not his real name). He was originally my financial adviser, and at one time we got to the point where we started looking at opportunities to go into business together. Steve became disillusioned with the financial advice business which he saw as being over regulated. The role of a financial adviser, as he saw it, had become one of trying to keep up with the ever-increasing mass of regulations, and picking one of an ever-diminishing selection of investment options which the regulations prescribed according to the client’s circumstances. Worse than that, he perceived a widening disconnect between actions that were in the client’s best interests and those that were in the adviser's best interests.

Steve was an archetypical sales guy. The CEO of a company I once worked for told me that there were two types of sales guys, which he called Hunter-Killers and Gardeners. The Hunter-Killer is always on the lookout to close a deal, and if he doesn’t see any kind of a deal in the offing he won’t hesitate to cut bait and go look elsewhere. The Gardener, on the other hand, knows that it is often necessary to cultivate a client over the long term, and to gradually build him up to the point where a deal is ready to be harvested. The Hunter-Killer is in his element with smaller deals, the Gardener with bigger ones. The Hunter-Killer is a big, energetic, bouncy dog, ready to hurtle off at full pace in pursuit of a stick. The Gardener is a cat, hopping up onto your lap, taking its time to get comfortable, and settling down for a long nap accompanied by a loud and satisfied purr. Depending on the kind of business you are in, you need one type of salesman or the other. And often you need both.

Steve was your typical Hunter-Killer. Me, I’m not any kind of salesman. Its not in my makeup. If pushed I could function better as a Gardener than a Hunter-Killer, but that’s just how it is. I am more of a strategist. So Steve and I potentially made for a good team. Steve, the big, energetic, bouncy dog, would hustle off in the direction of a potential business opportunity, and drop it in my lap. I would figure out what was necessary to turn that opportunity into a functioning business. Usually, the opportunity would be flawed, and Steve would immediately hurtle off after another one. The trouble was that to make an opportunity work for Steve, we would have to start up the business on Monday, and Steve would head out on Tuesday and start selling. By Friday I would tell him how much money we had made. Businesses rarely, if ever, work like that, so naturally we never got anything off the ground. But it was an endless source of fascination to examine the surprising variety of opportunities he unearthed, something I look back on with some fondness.

One thing Steve wanted more than anything else was to own a BMW dealership. Actually, he wanted to own a BMW, but projecting that ambition further led him to covet a whole dealership. So he left the financial services company and went to the local BMW dealer to get a job as a salesman. This would be an ideal position, he figured, from which to learn what it would take to acquire a dealership. Unfortunately, BMW are very selective in whom they employ, and salesmen with no experience whatsoever selling cars are not generally welcome. Steve was advised to go get some experience elsewhere. So he got a job with a local GM dealer, who were less picky. By the end of his second month he was their second-highest performing salesman, and from the third month onward became their top performer. Within less than a year he went back to the BMW dealer and was hired on the spot. He became an effective salesman very quickly. But the deal he really wanted to close was to own a dealership. He cozied up to the owner, and the more he learned about how the business worked, the more he realized that it wasn’t going to happen for him. For a start, the buy-in cost alone was so much more that he ever imagined. Why, he asked me with his financial adviser's hat on, if you had that kind of money, would you ever spend it on a BMW dealership?

Steve had one client in his role as financial adviser, who was raking in a lot of money in the used car business. Steve was anxious to know how he did it. The client was equally anxious not to tell him, but Steve is nothing if not persistent, and so he managed to extract an outline of how this man’s business worked. Basically, as he described it, he bought certain specific models of used GM vehicles at auction in Canada and exported them to the southern States where their resale value was a lot higher. Steve and I got together to try and figure out how a business model like that could rake in the amount of money his client was clearing, but the one thing we couldn’t get a handle on was how the business of buying cars at auction worked.

As it happened, at about the same time I was introduced to a guy called Nick (also not his real name) who was in the used car business. His thing was that you told him what vehicle you were looking for - being as specific as you wanted - and he would go out and find one for you, and sell it to you at a good price. Having learned a thing or two from Steve, I pressed Nick for more details on where these cars came form, and learned that he bought them at massive trade-only auctions. I persuaded him to take me to one of these auctions, where I was formally registered as his assistant (you can’t get in if you’re not in the trade). What I found was a facility with thousands upon thousands of used vehicles, virtually all of which would be sold at the upcoming auction. These auctions happened every week. The auction itself was staggering. Vehicles passed through so quickly, and bidding on each one was over in a matter of seconds. If you knew what you were doing, it was possible to come away with a surprisingly good deal. In the end, Nick bought two cars for me this way, which I was pretty happy with.

Steve managed to negotiate a nice little sideline for himself by bringing clients to Nick and arranging financing for their purchases. With Steve plugged in this way, Steve and I were able to glean sufficient information from Nick to establish that Steve’s client, whatever he was doing, was not raking in the cash he said he was by exporting used Chevrolets to Florida! Another business opportunity that fell by the wayside.

But Steve did see an opportunity to acquire for himself the BMW he had always wanted. Steve was a big guy, so the 7-series was his thing. He saw that the 740iL and 750iL, particularly the ones with high mileage, could sometimes be picked up for a song. The value of a 7-series at auction was very mileage dependent, and from his experience at the BMW dealer he knew two things - how to check a BMW’s service history and how the company’s warranty system worked. From his experience in financial services he also knew a third thing - how private car lease financing worked. Prowling the auctions with Nick he looked for high mileage 7-Series Bimmers with spotty service records. He instructed Nick to buy at a particularly low price if the opportunity came up. It did, and Steve became proud owner of a two-year old BMW 740iL. Steve then had Nick wind its clock back from 120,000km to 60,000km, which meant it still had 20,000km before its warranty expired. He arranged lease financing with a fixed buy-back based on a book price which three years down the road would be more than he paid up front for the car. He took the car to a BMW dealership and had them inspect the hell out of it and perform a whole bunch of warranty work including, incredibly enough, a re-spray. Steve apparently had no qualms about any of this.

Thus, in May of 2000, Steve became the proud owner of a near-new BMW 740iL in tip-top condition, and was paying less in lease payments than he was previously paying for the Nissan Maxima that he sold to make room for it. Steve, for one who negotiated so effectively with his cards close to his chest, was surprisingly a man who often wore his heart on his sleeve. We were going for a long drive in the 740iL one day, when he told me what he thought about the whole affair. He had wanted a BMW for so long, he said, that he never thought he would be able to afford one. Now that he had one, and had owned it for several months, he told me that he realized something important. The long-felt desire to own such a fabulous vehicle, and the thrill of the chase to come up with a scheme that actually put one in his garage, were in the end deeper passions than the actual fact of owning the thing. He was quite disappointed that the thrill of the chase and the thrill of the kill were somehow not being satisfied by the subsequent feast. Yes, the BMW as a vehicle was everything he thought it would be. The sound system, I can tell you, was fantastic. But in the end it was just another vehicle that needed to be filled with gas, washed, and driven from place to place. And the jaws of your friends and neighbors would only ever drop once. Not a person to let the grass grow under his feet, he told me he was going to sell it. In fact he had lined up a buyer. More than that, he had put his house on the market and was going to move to Florida. Just like that.

Steve did move to Florida, where, last I heard, he was selling private medical insurance and planning to take a course to get his Real Estate license. My guess is he won’t have had the patience to complete it.

Nick, on the other hand, absconded one day with thousands of dollars of someone’s money, on deposit for a specific vehicle he was tasked to obtain. He hasn’t been heard of since. I’m just glad it wasn’t me that recommended him to the client who got fleeced.

Friday 18 July 2014

Impulse Response

If you choose to embark upon an entrepreneurial career, you will often find yourself putting together financial spreadsheets to model your business. Investors in particular love to pore over scenarios of how your business might develop, and having a good financial model is an invaluable tool to have at your disposal. Of course, if you’re smart, you’ll want to thoroughly test your spreadsheet to make sure that your financial logic contains no embarrassing errors. One of the techniques for doing that is to enter an arbitrary billion dollars into one of the input cells, and see where else in your spreadsheet unexpected extra billions show up. It is very easy to spot billions of dollars when they start to appear in places they don’t belong. You might say that what you are doing is measuring the “impulse response” of your spreadsheet.

Digital filters are no different. Data goes in one place, and results come out someplace else. In this case, both the inputs and outputs are streams of numbers. Conceptually, digital filters are quite simple things. You take the input value, and add to it bits of the previous input values together with bits of the previous output values. That’s really all there is to it. The filter design tells you how many of the previous input and output values go into the mix, and precisely what fraction of each to use. Some filters only rely on the previous input values, and don’t use the previous output values. Filters that do use the previous output values have an interesting property - each output value contains a little bit of each and every previous input value.

What are the implications when a bit of one input value ends up in each and every one of the subsequent output values? A very easy analysis would be to take a signal comprising digital silence - in effect nothing but zeros - and modify it so that one data point (and only one data point) is at a maximum value. We call this waveform an “Impulse”. We put this data stream through our digital filter and see what comes out the other end. What happens is that the output comprises a stream of zeros up until the time the impulse reaches the input of the filter. After that, the output will comprise a sequence of non-zero values - in effect a series of echoes of the original impulse. This artificial construct - how the residue of one single impulse value in a sea of zeros appears in the output data stream - is called the “impulse response” of the filter. If the filter uses only previous input values and no previous output values, then the echoes will fall to zero as soon as we reach the point where the impulse is no longer one of the previous values that goes into the mix. Such filters are called “Finite Impulse Response” (FIR) filters. If, however, the filter uses previous output values, then the echoes of the impulse will remain within the output signal forever, or at least until such time as its magnitude becomes too small to register. These filters are called “Infinite Impulse Response” (IIR) filters.

An impulse response looks like a waveform. You can easily plot it out. It looks like a waveform precisely because it is a waveform, and you can do anything with it that you can do with any other waveform. Impulse responses have many interesting properties, most of which are beyond the scope of this post. But, as an example, if we take its Fourier transform, the result is the transfer function of the filter, which is to say its frequency and phase responses. This is why the key aspects of a filter’s performance are intimately inter-related. Once you define a filter’s frequency response (for example by defining the characteristics of a low-pass filter) and phase response (for example by specifying linear phase or minimum phase), you will have set in stone its impulse response. In other words, the impulse response (IR) is the direct consequence of the choices you have made in terms of frequency response (FR) and phase response (PR). What it boils down to, is that when it comes to filter design, you only get to specify any two of its IR, PR and FR, and the third will be determined for you.

Tuesday 15 July 2014

The Most Beautiful Piece of Music Ever Written

They say beauty is in the eye of the beholder. What is beautiful to one person, may not be beautiful to another. However, a significant element of that is cultural. The things we have grown up being told are beautiful are usually the things we hold to be beautiful for the rest of our lives. But those standards evolve over time and place. The ideal classical female figure is apparently somewhat chunky to the modern sensibility, just as today’s anorexic teenaged supermodels would appear emaciated to Da Vinci, Michelangelo, and the Ancient Greeks (although maybe not to Botticelli, whose aesthetic appears to have been somewhat more ‘modern’ with his tall, willowy, long-limbed blondes).

Faces are somewhat different. There is plenty of evidence that the most attractive facial features have remained more or less constant over the ages, with many common traits that can be discerned across both ethnic and cultural boundaries. Symmetry, for example, is a notable common factor. Men and women around the globe tend to find symmetric facial features to be superficially more attractive in the opposite sex.

What about music? Can music be said to be fundamentally beautiful? For sure, there is some music which is very clearly the opposite of beautiful, and people from different cultures can be found to agree on that. After all, there is no requirement for music to be beautiful in order to be good. Music tends to benefit greatly from the creation and resolution of tension, dissonance, and rhythmic discord. But some music is undeniably beautiful, like Schubert’s “Ave Maria”. Who would disagree with that? How about the Ode to Joy from Beethoven’s 9th symphony. Is that beautiful? How about NWA’s “Straight Outta Compton”? The fact that you can discern meaning and feel a powerful connection with a piece of music is not the same thing as finding it beautiful.

What is it about music that makes it beautiful to our ears? Three things tend to stand out. The first is that beauty pretty much always requires a major key. The sort of beauty that makes you smile is inevitably in a major key. The second is that beautiful music tends to have slow tempi and simple rhythmic structures. This is wonderfully expressed by the title of a great Alison Moyet song “I Go Weak In The Presence Of Beauty”. That’s what beauty does. It doesn’t enervate you. It makes you go weak at the knees. The third attribute is that beautiful melodies tend to have arching spans. Most well-known tunes follow a path of adjacent notes up and down the musical scale. The theme from Beethoven’s Ode To Joy that I mentioned earlier follows this path. It may be stirring music, but it is not particularly beautiful. Beautiful music tends to have themes which feature prominent jumps from one note to another some distance away. These jumps - usually jumps up in pitch rather than down - are usually themselves the focal points of the music’s inherent beauty.

There is one piece of music that to my ears epitomizes beauty in music. I first heard it in 1972 when the choir I was in performed a version of it. I think no less of it today than I did then. It is one of my “desert island” pieces. It is, I humbly assert, the most beautiful piece of music ever written. I think it would be terribly sad to go through life without ever hearing it.

“Serenade To Music” was written by the English Composer Ralph Vaughan Williams in 1938. It is scored for an orchestra, solo violin, and 16 vocal soloists, and is a setting of an extract from Shakespeare’s “The Merchant Of Venice”. The solo vocal parts were specifically written for 16 prominent English singers of the day including Isobel Bailie and Heddle Nash, and each part is annotated by the composer with the initials of the designated singer. A recording exists, made shortly after the work’s premiere, by the same performers. It is more of musical and historical than audiophile significance, but captures a wonderful vignette of the ethereal beauty that was soprano Dame Isobel Baillie in her prime. Sergei Rachmaninoff, himself no stranger to musical beauty, attended the premiere (having performed his 2nd Piano Concerto in the first half of the concert) and was said to have broken down in tears at the beauty of the music.

There are precious few recordings of Serenade To Music, and I can’t think why. It is a bucket list composition. The best is Sir Adrian Boult’s 1969 recording with the London Philharmonic on EMI’s HMV label. This is a terrific performance (Boult was an absolute master of Vaughan Williams) marred only by Shirley Minty’s dreadful - and thankfully brief - contribution which literally makes me cringe for a second until she’s finished. I have this on LP only and I don’t know if it is available anywhere for download. The world still awaits a modern digital recording of this stunning work.

It would be worth a little effort on your part - well OK, maybe quite a lot of effort - to seek it out.

Monday 14 July 2014

Fazed by Phase

In my discussion on square waves, when I mentioned the properties of its Fourier components, I glibly suggested “We’ll ignore phase”.  In truth, we need to look a little more closely at it.   I’ll start by defining phase.

Imagine in your mind’s eye a graph of a sine wave. If this were to represent a sound wave, the vertical axis would represent the air pressure oscillating up and down, and the horizontal axis would represent the passage of time. If you were to capture that sound wave with a microphone, the voltage waveform that the microphone would create would look just the same. Imagine now that you could actually “see” the sound waves, as though they were waves on the surface of a pond. Imagine yourself standing next to the microphone, observing the sound waves as they travel toward you and the mic. Imagine that you can make out the individual peaks and troughs. You can watch an individual peak approach and impinge on the microphone. At the instant it does so, you observe the output voltage of the microphone. You will see that the output voltage also goes through a peak. You watch as the peak passes by and is replaced by its trailing trough, and you observe the voltage from the microphone simultaneously decay from a peak to a trough. I hope this is all pretty obvious.

Now we are going to add a second microphone. Except that we are going to align this one a short distance behind the first one. Now, by the time the peak of the sound wave impinges on the second microphone, it has already passed the first one. The output voltage from the first microphone has already passed its peak and is on its way down to the trough. But the output voltage of the second microphone is only just reaching its peak. Over a period of time, both microphones capture exactly the same oscillating sine wave, but the output of the second is always delayed slightly compared to the output of the first. This is the Phase of the sine wave in action. The phase represents the time alignment. And, as you can work out for yourself, it is not the absolute phase which is important, but the relative differences between phases.

Interesting things happen when we add two nominally identical sine waves together. Let’s specify two sine waves which have the exact same magnitude and frequency, but differ only in phase. I won’t go into the mathematics of this, but what you get depends strongly on the phase difference. If both phases are identical the two sine waves add up, and the result is a sine wave of exactly twice the magnitude of the original. However, if the two sine waves are time aligned such that the peak of one coincides with the trough of the other, then the end result is that both sine waves cancel each other out and you end up with nothing. These two extreme conditions are often referred to as “in-phase” and “out-of-phase”. However, there are a whole spectrum of phase relationships between these two extremes. As the phase difference gradually varies from “in-phase” to “out-of-phase”, so the magnitude of the resultant signal gradually falls from twice that of the original, down to zero.

Lets now go back to the square-wave example of yesterday’s post. Yesterday’s example was concerned with the summing of individual sine waves (a fundamental and its odd harmonics), and how the more of these odd harmonics you added in, the closer the result approached to a square wave. We also saw that by limiting the number of harmonics, what we got was a close approximation to a square wave, but with some leading and trailing edge overshoot, and a bit of ripple. However, in all of that discussion we took no account of phase. Or, more specifically, we allowed for no phase difference between the different harmonics. What happens if we start to introduce phase differences?

The result is that we no longer get a nice clean square wave. As we mess with the phase relationships we get all sorts of odd-looking waveforms, some of them bearing precious little visual relationship to the original square wave. Yet all of these different waveforms comprise the exact same mixture of frequencies. The obvious question arises - do they sound at all different? In other words, can we hear phase relationships? This is a tricky question.

My own experiments have shown me that I have problems detecting any differences between test tones that I have created artificially, comprising identical assemblies of single frequency components added together with different - and sometime arbitrary - phases. But from a psychoacoustical perspective this is perhaps not surprising. Our brains are not wired to recognize test tones, and cannot therefore create a sonic reference from memory with which to compare them, so it is not surprising that I would find it very difficult to hear differences between them.

The conventional wisdom is that relative phase is inaudible, but this is hard to test with anything other than synthesized test tones. With real music there is no possibility to independently adjust the phase of individual frequency components (for reasons I won’t get into here) so the question of the audibility of relative phase is one which remains either unproven, or proven as to its inaudibility, depending on your perspective.

Saturday 12 July 2014

The Square Waveform

In digital audio, a simple square wave has some interesting properties. On the face of it, you can actually represent the square wave digitally with no error whatsoever. The quantization error, such as it is, becomes merely a scaling factor. If you adjust the input gain, you can get it so that the quantization error is zero for every single recorded value.

Imagine that - a waveform captured digitally with no loss whatsoever. Even though it is of no practical value (who wants to listen to recorded square waves?) you would imagine that it would be useful for test and measurement purposes if nothing else. And people do imagine that. In fact, it is not unusual to see reproductions of square waves, captured on an oscilloscope, as part of a suite of measurements on a DAC. But in digital audio things are seldom quite what they may logically appear to be. Lets take a closer look at square waves and see what we come up with.

A true and perfect square wave can be analyzed mathematically and broken down into what we call its Fourier components. These are nothing more scary than simple sine waves, each one having its own frequency, phase, and amplitude. The Fourier components (sine waves) which make up a square wave comprise the fundamental frequency plus each of its odd harmonics. The fundamental frequency is simply the frequency of the square wave itself. The odd harmonics are just frequencies which are odd multiples of the fundamental frequency (3x, 5x, 7x, 9x, 11x, etc). The amplitudes of each Fourier component are inversely proportional to the frequency of the harmonic. We’ll ignore phase.

If that sounds complicated, it really isn’t. Start with a sine wave, at the frequency of the square wave which I will refer to as ‘F’. Now add to it a sine wave of its third harmonic, which is three times the fundamental frequency, ‘3F’. This sine wave should have an amplitude 1/3 of the amplitude of the fundamental sine wave. OK? Next we add a sine wave of the fifth harmonic, 5F, with an amplitude 1/5. Then the seventh harmonic (7F) with an amplitude 1/7, the ninth harmonic with amplitude 1/9, and so on, ad infinitum. The more of these harmonics you add into the mix, the closer the result approaches a perfect square wave. A truly perfect square wave comprises an infinite number of these Fourier components. Here is a link to an animated illustration which might help make this clearer.

Some interesting things happen as we add more and more Fourier components to build up our square wave. The ripple on the waveform gets smaller in magnitude, and its frequency gets higher. The ‘spikes’ at the start and end of the flat portions of the waveform decay more rapidly. These things can all be seen clearly on the web page I mentioned. However, one surprising thing is that the ‘spikes’ don’t ever disappear, no matter how many Fourier components you add in. In fact, their magnitude doesn’t even get smaller. As you add Fourier components, the 'spikes' converge to about 9% of the amplitude of the square wave, something referred to as the ‘Gibbs Phenomenon’. The spike itself ends up approximating a rapidly decaying oscillation at the highest frequency Fourier component present.

So now lets go back to the idea at the start of this post, that we can easily encode a square wave with absolute precision in a digital audio stream. If this were actually true, it would imply that we are encoding Fourier components comprising an infinite bandwidth of frequencies. But Nyquist-Shannon sampling theory tells us that any frequencies that we attempt to encode which are higher than one half of the sampling rate actually end up encoding ‘alias’ frequencies, which are things that are seriously to be avoided. The square wave that we thought we had encoded perfectly, and with absolute precision, turns out to contain a whole bunch of unwanted garbage! And that, to many people, is bizarrely counter-intuitive.

We’ve gone over this in previous posts, but the bottom line is that any waveform that you wish to capture digitally - square waves included - need to be first passed through a low-pass filter called an ‘anti-aliasing’ filter, which blocks all frequencies above one half of the sampling rate. For the purpose of this post, lets assume that the anti-aliasing filter is ‘perfect’ and does nothing except remove all frequencies above half the sampling frequency. What this filter does to our square wave is, in effect, to strip off the vast majority of the square wave’s Fourier components, leaving only a few behind.

Lets look at what this means in the context of Red Book (44.1kHz sample rate) audio. If the square wave is, for example a 1kHz square wave, then its first ten Fourier components (the 3rd through 21st harmonics) are left intact. However, if the square wave is a 10kHz square wave, not one single odd harmonic component makes it through the filter! This means that if you attempt to record a 10kHz square wave, all you could actually ever capture would be a pure 10kHz sine wave.

What does this mean for DAC reviews where you are presented with a screenshot illustrating the attempted reproduction of a square wave? The bottom line here is that for such a screenshot to make any sense at all, you need to know exactly what a perfectly reproduced square wave ought to look like. For example, it ought to have leading and trailing edge ‘spikes’ which approximate to half cycles of an approximate 20kHz sin wave, and with an amplitude which is about 9% higher than the amplitude of the square wave itself. It needs to have ripple. I could be a lot more specific about those things, but the fine details end up being governed by issues such as the frequency of the square wave, and - far more complex - the characteristics of the anti-aliasing filter used to encode the original signal. Without this information a square-wave screenshot is of limited value. If nothing else, it can provide a level of confidence that the person conducting the test knows what they are talking about. Not to mention avoiding allowing the reader to infer or imply erroneous conclusions of their own.

Friday 11 July 2014

The Unanswered Question

Back in 1970 or ’71, my mother gave me an LP she thought I might like.  I’m not sure why she did that, since she had no conception of the sort of music I played.  She herself listened to very little other than Austrian popular music from the ‘40s and ‘50s.  Anyway, maybe because they were seriously cheap, she came home with two LPs, one of which was “Classical Heads”, a peculiar album released on the prog rock Charisma label.

Classical Heads was a mild re-working of mostly mainstream classical music, dominated by Berlioz.  The ‘progressive’ element comprised playing with the phasing effects slider here and there, and occasional over-dubbing with spoken word.  It was not a good album at all, but for whatever reason (maybe because I didn’t actually own many other records) I found myself playing it quite a lot.  And I still have it.  It is sitting at my side as I type this.

But Classical Heads did contain one work which lodged in my consciousness, a track titled ‘The Unanswered Question”.  I rather liked it a lot and imagined it might have been the work of a contemporary prog rock band - sort of Moody Blues meets Pink Floyd.  It was ascribed to a certain “Ives” whose name was unfamiliar to me.  In those days, of course, there was no Internet.  In my youthful naïveté I assumed it was some contemporary piece chosen to fill out the album, but regardless, it became the one track that I wanted most to hear when I took the album out to play it.

Many years later I came across the piece again, this time performed more professionally, and learned that “The Unanswered Question” was in fact a major piece written by the American composer Charles Ives, back in 1908.  In fact, it is considered to be in many ways Ives’ most notable work, despite being very short - typically something like seven minutes in duration.  Despite being hardly demanding on the performing requirements, it is a piece that does not command appropriate prominence in the major classical repertoire.  Both performances and recordings are sparse and hard to come by.

I wanted to write an analysis of the piece, but I find that its Wikipedia page does such a good job that I feel it would be pointless for me to elaborate upon it.  But, in brief, it comprises three components: a slow and quiet shimmering string chorale which forms a permanent backdrop and evolves at the pace of a lava lamp; a solo trumpet which poses an atonal question several times; and a discordant wind quartet which attempts unsuccessfully to answer each question, getting progressively more distraught with each failure.  The final question is, as you might imagine, left unanswered.  Read the Wikipedia page I linked to.

It is a haunting piece, short enough not to require you to invest too much of your time in it, accessible enough to hold your attention, intriguing enough to draw you back again for more.

I have two performances on LP and one on CD.  The CD version is by far and away the best.  It is by the Chicago Symphony Orchestra, conducted by Michael Tilson Thomas, on Sony Classical from 1990.  If you look around you can still find it.

I hate to recommend something that can be a swine to find, but sometimes the thrill of the hunt is half the fun!

Thursday 10 July 2014

OS X 10.9.4

I have been using the latest update to OS X (version 10.9.4) for a few days now on multiple machines and have encountered no problems with BitPerfect. BitPerfect users who wish to apply this update should therefore feel free to do so.