Friday, April 24, 2020

The Big Algorithm


As I have mentioned in these pages, I collect old records, of the type commonly known as “78s,” and I enjoy restoring them digitally, removing the noise and making them sound as originally intended (or as close to it as possible). It is in fact my favorite pastime, but about four years ago I more or less stopped working on 78s, because I was growing increasingly dissatisfied with my results.

I didn’t realize it at the time, but this was an early sign of my heart condition. My declining circulation diminished my aural acuity, and rising blood pressure introduced tinnitus (the perception of noise that isn’t actually occurring), which I didn’t really notice because of my diminished aural acuity.

I did continue to work on restoring the occasional LP and the like, because restoration of this kind of thing is usually a comparatively trivial matter, and I hoped it would serve to keep my skills from deteriorating completely.

After my operation, my blood pressure increased temporarily when I was taken off blood thinners, and then I was able to hear the tinnitus, because thanks to the new valve my aural acuity had greatly improved. In fact, it got to the point that I could eventually tell what was happening with my blood pressure by the loudness of the tinnitus. 

This annoying but useful condition soon showed me that my blood pressure would rise whenever I ate anything with any salt in it at all. I found different things to eat, and in early February of this year my blood pressure finally returned to normal healthy levels. The tinnitus was now pretty much gone.

February was a pretty wet month hereabouts, and one of the rainy-day projects I set for myself was to clean up the “Current Projects” sound-file folder on my computer—something I had never done in twenty years at the activity. Believe me, there were very few projects that still had any currency!

Still, I did find over three dozen 78-restoration projects that I had abandoned in frustration over the previous nine years (which indicates just when my hearing problems began). I decided to try to finish them, and discovered to my great joy that I was miraculously now several orders of magnitude better at the task than I had ever been before. 

I can only conclude that, like Demosthenes and his pebbles or a sprinter running with leg weights, the process of attempting to work through my temporary hearing impediment over those nine years somehow strengthened my abilities and honed my skills. Or, it was a miracle. Either way, I was elated. What used to take me days or even weeks was now taking just hours, and my restorations were noticeably better than ever: less noise, and a livelier sound.

Over the course of the next four weeks I completed all my abandoned projects with resounding success. At the same time, I fully re-engaged with the whole record-collecting thing, cleaning and cataloguing all the incoming records that had piled up since months before my operation, and playing them for Wifey in the evenings. 

This was a doubly-fortunate development, because at about this time it became evident that Wifey and I would be spending the next month or so in relative isolation. It looked like the perfect opportunity to indulge my favorite pastime in a big way, and also to take care of some long-deferred interior home-improvement tasks. Goodness knows that I had little else to distract me, because the weather was perversely bad for spring hereabouts, and I couldn’t go about my usual springtime duties of renovating the yard.

Soon thereafter, an odd distortion began to materialize in the sound of the records as I played them: a hard echo that sounded only once. It was a bit distracting, but I didn’t let it bother me, because it didn’t show up in the digital transfers of records I was making.

And then, one literally and figuratively dark day, it did, and all the transfers I made that day were worthless. Now I was bothered, mightily, because my triumphant return to my favorite pastime was dead in the water. My very next task was finding the source of that distortion.

* * *

At this point in the story, I should mention that during my banking career, one of my main tasks was the monthly auditing of all the branch asset and liability accounts. These audit activities may sound boring, and I certainly found them so when first I was assigned them. So boring, in fact, that I tackled them hard so that I could get them behind me as quickly as possible. I tend to address my most dreary tasks first, because I crave happy endings.

I was soon rewarded for my efforts. It wasn’t very long before I began to see patterns in the kinds of errors I found. For example, a difference of an amount divisible by 9 was virtually always caused by the switching of two numbers in a figure, e.g., 15.49 instead of 14.59. And, since banking seems to attract the dyslexic, this happened with remarkable frequency.

This indicated that when I discovered a difference divisible by 9 it was quite justifiable to assume that switched numbers were the cause. I could thus omit the laborious search for needles in a haystack that was the standard audit process, and confine my search to locating this specific kind of error, cutting the time spent from several hours to several minutes. And there were other patterns that offered similar savings of time and effort.

At that point, I actually began to enjoy the work, because it had ceased to be pure, rote drudgery, and had become instead an exercise in deduction. Suddenly I was Sherlock Holmes, and every out-of-balance condition became an opportunity to hone my sleuthing skills. 

Certainly there were instances where I did have to make a full audit to find the error, and in these cases, it is true, my method ended up taking longer than going directly to a full audit,  but as I gained in experience, these instances became increasingly rare. With time, I developed an algorithm that yielded a solution unfailingly with a minimum of time and effort. I can state with pride that never once in my career did I allow a penny to go astray. I never left behind any unsolved cases.

This talent served me well in my banking career, and in my life in general, because I naturally began to apply this sort of algorithm to every little mystery I encountered. Whenever a problem cropped up in any area, say an inoperative electrical circuit or a stuck window or a suddenly-unfriendly friend, I would apply the same sort of algorithm. I would assess the situation, prioritize my investigation in order of probability, then start investigating. 

Thus, when the distortion appeared in my transfer setup, I naturally approached it in the same way that has been so successful for me in the past.

* * *

My setup for transfers is a turntable connected to a switch box that also has a cassette deck connected to it (allowing me to transfer cassette recordings as well). The switch box then goes to an analog processor that serves to recover latent sound in the recording. From there, one output goes to the digital recorder, and the other to a high-quality amplifier, dedicated to this purpose, and then to a big old pair of speakers handed down from my Grandpa Kesling. 

I began my investigation by considering the facts already in evidence, which were a bit confusing: at first, the distortion did not appear in the digital transfer, and then it did. I decided to disregard that for the present, and proceeded with the situation as it then was, because I was eager to find the problem and solve it as quickly as possible so I could get back to restoring records.

This meant that the problem was occurring somewhere between the record and the digital recorder, and thus the source was one of three things: the turntable, the switch box or the processor box. The easiest of these to check was the turntable, so I switched over to the cassette deck and played a cassette. The distortion affected the cassette, which eliminated the turntable as the source. 

From there, I went on down the chain. I disconnected the turntable from the switch box and connected it directly to the processor box. The distortion was still there.

At this point, I began to grow quite concerned, because the processor box is the single most expensive component in my system. It’s a professional unit, and pro electronics are always prodigally costly. Now, Wifey kindly said to me, “Well, let’s just buy a new one.” But when I checked to see what the current price was, I discovered that the box is not made any more. 

I then girded my loins and set about the grim business of confirming the passing of my dear processor box. I took it out of the chain, connecting the switch box directly to the amplifier.

To my great relief, and my utter consternation, the distortion was still there! I had seemingly eliminated every possible source of the distortion, and it was nonetheless still there. Out of leads to follow for the moment, I put the matter completely aside for several days as I awaited the arrival of further inspiration.

It eventually came when I remembered that my turntable did in fact have internal electronics: a switchable onboard pre-amplifier. Turntable preamps used to be built into all home stereo amplifiers, back when everyone had a turntable, but over the past twenty years or so they have begun to disappear. 

Thus, all turntables now come with internal preamps so that they can simply be plugged into any standard line-level input. While it seemed impossible that the preamp could be the source of the distortion, I decided for the sake of thoroughness to check it anyway.

Fortunately, I do have a high-quality stand-alone phono preamp. I connected it between the turntable and the processor box, and switched off my current turntable’s internal preamp. Then, I fired up the system and played a record. No sound came through the speakers. The stand-alone preamp could not possibly have simply stopped working, but I just could not figure out what the problem was.

Well, there was only one logical conclusion to derive from this: I was trying too hard. I was missing something. There were other steps I could take at this point, but the most prudent step was away from this whole mess to get some perspective. I had to get back on my good foot with my algorithm.

I switched the turntable’s inboard preamp back on and reconnected everything the old way so that we could at least listen to records, and then I turned my attention to some of the million other things that needed doing.

* * *

A few days later, on a nice sunny day when Wifey was working from home, we sat down to lunch in the den, and she said in an enthusiastic voice, “Why don’t we listen to a few records?” So I put on a record.

The distortion was gone! Gone with the wind!

I thought back to the early days of our marriage, when the toaster or can opener stopped working and Wifey would say to me, “Try unplugging it and plugging it back in again.” I would smile at her indulgently, try her fix, and it would never work, because of course it didn’t.

Soon thereafter, toasters and can openers and pretty much everything came with computers in them, and the first suggestion in the troubleshooting section of all their instruction manuals was, “Try unplugging it and plugging it back in again.”

I just sat there for a minute, completely paralyzed by the arbitrariness of it all. I struggled mightily to trace a logical path through all that had happened. I thought to myself, “So disconnecting the internal preamp and then reconnecting it fixed the problem, did it? Huh. Well … okay. I guess the preamp switch must’ve been dirty, and turning it off and then back on again cleared the dirt. A simple dirty switch caused that weird distortion. It figures it would be something stupid like that.”

No, wait—it didn’t figure at all. It didn’t make sense. Nothing about this whole mess made any sense to me. First the distortion didn’t affect the transfers, then it did, and then the turntable wasn’t the source, and then it was? I just couldn’t accept it.

Because of this, I had no confidence that the distortion was truly banished. I fully expected it to reappear just as capriciously as it had disappeared. A deus ex machina may be acceptable in a story, but I had never encountered one in real life, and was not about to accept it now. It didn’t fit my algorithm.

While I resolved to get back to restoring records for as long as the distortion stayed away, my heart was not in that resolution, and I spent the next few fleeting days of sunny weather catching up a bit on the yard work. The exercise cleared my terribly fogged mind considerably, and finding myself in a mood to write, I resumed work on a project I had started back during my recent restoration work that was related to it.

So records and restoration were on my mind just the other night as I was surfing the Net doing some technical research. I was reading about turnover frequencies and electronic circuits and time constants when I heard a voice that sounded a lot like my own say, softly, “The dimmer.” And then, if I am not very much mistaken, I heard the ding of a little bell, but I couldn’t swear to it.

My mind is like that. It is exceedingly slow, but it is just as stubborn. In retrospect, I know what happened. While consciously I had disengaged from contemplation of the distortion matter, subconsciously I was still flogging the old algorithm. 

Free to work without interference from me, my mind went to work dredging the muddy bottoms of its many fetid swamps, seeking a clue as to what was really happening with my transfer setup. When it at last unearthed that clue, it floated to the top of my conscious mind like the answer on the underside of a Magic 8 Ball.

It was the dimmer I had installed on the overhead light circuit in the den in mid-March, just as I finished my successful run of restorations. It’s a very nice electronic unit, designed to work with modern LED bulbs yet presenting the appearance of an old-fashioned pushbutton light switch.

Immediately, I ran downstairs, turned on the light in the den, adjusted the dimmer to halfway, and played a record. The distortion was still gone. I turned the dimmer all the way down and all the way up. I turned the light on and off. The distortion did not return. Blasted evil distortion! Where are you when I need you?

It was like when you have some annoying problem with your car, say the steering makes a frightening clunk when you turn the wheel all the way to the right, and you take it in to the mechanic and he can’t find any problem at all.

But no matter. I was, and still am, convinced the dimmer was the cause of the problem. Sure, I have no proof of that at this point, but who cares? I mean, it has to be the source. To paraphrase Nick Charles in the dénouement of The Thin Man, it has to be the way things happened, because it’s the only way any of this makes sense.

First of all, the distortion first appeared after the installation of the dimmer. Second of all, as well as the dimmer works most of the time, it has shown some occasional instability, causing the LED bulbs to strobe. Third, I am told that dimmers can readily cause interference in nearby electronic circuits, even if they appear to be working correctly.

Moving to the next level of proof, I recalled that at every time when I encountered the distortion, the overhead light was on because the weather was bad, and when I first noticed that the noise was gone, it was a sunny day, and the light was off.

At this point in my investigation, I had a large number of data points—a large body of evidence, both circumstantial and direct—that all aligned one way: that the dimmer was the source of the distortion.

My investigation was done. Beyond a reasonable doubt, the deus ex machina was the dimmer. And the fact that it was a deus ex machina was a huge red flag that I utterly failed to notice.

* * *

It all seems so silly in retrospect, doesn’t it, all that drama over a simple problem? Actually, it gets even sillier: the reason why my outboard phono preamp didn’t work when I connected it was that I neglected to connect its power cord. For what it’s worth, I did figure that out myself a few days later, but sheesh

That level of bovine stupidity serves to reveal my state of mind at the time. The world outside our door was falling apart. Now, that I could deal with, because I knew that the world would in good time fall back together again. 

Nevertheless, all the disruption in our normal routine brought about by the situation proved to be such a distraction that the further disruption brought about by the sudden, capricious appearance of the distortion in my transfer setup utterly blew my mind. It was just one thing too many for me. It’s always that last tiny little straw that breaks the camel’s back.

And so, I blundered my way through what should have been a simple, straightforward investigation, eventually working myself up into a state where I was so frustrated, confused and just plain mad at the world in general that I simply lost my nerve. And thus was a noble mind o’erthrown.

I then abandoned my algorithm, my old faithful friend, like a cat leaving a sinking shelf, and proceeded to follow any wild chimera that came into my mind, just to give it something to keep chewing away upon. Dr. Thorndyke would be disappointed in me.

John Thorndyke, you see, is the main character in a wonderful series of detective mysteries written by the British author R. Austin Freeman between 1907 and 1942. Dr. Thorndyke, in fact and fiction one of the first forensic scientists, had his own algorithm, and that was to seek out and document every fact he could find before beginning to form any conclusions regarding a case.

Thorndyke was constantly exhorting Jervis, his colleague and frequent amanuensis (i.e., what Dr. Watson was to Sherlock Holmes), that one must always conduct an investigation with an open mind, scrupulously avoiding the forming of any premature assumptions. “One can never determine the relevance of a clue until all the clues have been collected,” he liked to say. 

In this light, Thorndyke would have applauded my taking the time to check the operation of the internal preamp, in the name of collecting all available evidence. He would then, however, gently point out that I had begun the investigation with the mistaken assumption that the source had to be something in my transfer setup. 

Absent that assumption, I might well have realized that the probable source was something outside the setup the minute that the distortion, which at first did not occur in the transfers, suddenly did. It was when I chose to disregard this seemingly inexplicable change in the situation, simply because it was inconvenient, that I went astray.

Ironically, this is the very same mistake that Jervis always makes when he tries to solve the case for himself (as Thorndyke always exhorts him to do). He always boxes himself in by starting his investigations with unconscious and unjustified assumptions, which leads him to disregard crucial data. And every time, I say, “Come on, Jervis. You’re an intelligent, educated man. Learn from your mistakes already!”

Well, all I can do now is to send forth my humble apologies to you, Jervis, and to you as well, Dr. Thorndyke, and strive to follow my own advice. And with that, it’s back to restoring records, with my algorithm, and my assumptions, restored to their proper places.

* * *

“I could have told you it was that stupid thing on the wall, but I assumed you knew.”