There's nothing wrong with the idea of science in the media, per se: I want more and better science in the media. But there's a lot wrong when people who clearly don't know any science write (or illustrate) pieces about science or related matters like engineering, the environment, and space exploration.
The Wall St. Journal, where people who don't understand basic Physics units write tweets about trading systems designed by hordes of Math and Physics PhDs:
With friends like Engadget "green" writers, the environment won't improve.
The Motley Fool, being its foolish self.
That's it for September. A lot of incipient posts in the hamper, but paid work got in the way of blogging. Such is life.
Non-work posts by Jose Camoes Silva; repurposed in May 2019 as a blog mostly about innumeracy and related matters, though not exclusively.
Friday, September 30, 2016
Saturday, September 24, 2016
Carbon capture, perpetual motion machines, and IGORs
There's one quick rule to evaluate energy-related technologies: if you can turn them into perpetual motion machines, they aren't real.
In conversation with an IGOR (Ignorant Grandstanding Oblivious Rabble-rouser), I pointed out that the idea of using atmospheric carbon dioxide to make fuel isn't entirely new (Nature did it first), but the technologies being proposed aren't realistic, for the reason above.
IGOR countered that these processes could, in his view, be the solution to our energy crisis (do we have one?), because the fuel produced by carbon-capture will provide the energy to keep the process going.
Ahem. Let's think about this, with a diagram:
What reasonable people say is that the energy extracted from the fuel will partially cover the energy needs of the capture and conversion process (that is $x > y$ but not by much); what IGORs say is that $y>x$. But if that were so, we could feed the exhaust from the energy production system into the input for the capture system, and get a perpetual motion machine that generates free energy.
Some of the more reasonable proponents of this carbon-capture and conversion idea suggest that the energy coming in can itself be green energy, like solar, and therefore there's a net "carbon-based" energy coming out of the system. Two points:
It also has the advantage of being pretty, giving shade, operating in silence, and bearing fruit. Trees. It's trees. Let's plant more trees. I like trees.
One particularly oblivious IGOR insinuated I was anti-environment because I prefer trees to useless noisy subsidy-harvesting machines.
With friends like that, the environment is doomed.
In conversation with an IGOR (Ignorant Grandstanding Oblivious Rabble-rouser), I pointed out that the idea of using atmospheric carbon dioxide to make fuel isn't entirely new (Nature did it first), but the technologies being proposed aren't realistic, for the reason above.
IGOR countered that these processes could, in his view, be the solution to our energy crisis (do we have one?), because the fuel produced by carbon-capture will provide the energy to keep the process going.
Ahem. Let's think about this, with a diagram:
What reasonable people say is that the energy extracted from the fuel will partially cover the energy needs of the capture and conversion process (that is $x > y$ but not by much); what IGORs say is that $y>x$. But if that were so, we could feed the exhaust from the energy production system into the input for the capture system, and get a perpetual motion machine that generates free energy.
Some of the more reasonable proponents of this carbon-capture and conversion idea suggest that the energy coming in can itself be green energy, like solar, and therefore there's a net "carbon-based" energy coming out of the system. Two points:
First, that's fine, but then why use part of that solar energy to create carbon-based fuels, instead of using the solar energy to replace the carbon-based fuels? Note that any $\mathrm{CO}_2$ that gets turned into fuel will yield another $\mathrm{CO}_2$ after the energy generation (conservation of the carbon), so no advantage there.
Second, the designs proposed look extremely wasteful of energy: capturing $\mathrm{CO}_2$ after it has diffused into the atmosphere is bound to require a lot of energy to flow non-$\mathrm{CO}_2$ gases in the atmosphere through the carbon-capture process. Better to stop $\mathrm{CO}_2$ at the source, if that's what you're after.Of course, as I mentioned, Nature does provide us with a technology to use solar power to capture $\mathrm{CO}_2$ and turn it into fuel:
It also has the advantage of being pretty, giving shade, operating in silence, and bearing fruit. Trees. It's trees. Let's plant more trees. I like trees.
One particularly oblivious IGOR insinuated I was anti-environment because I prefer trees to useless noisy subsidy-harvesting machines.
With friends like that, the environment is doomed.
Labels:
Energy,
Engineering,
Environment,
IGORs,
science,
Solar power,
STEM
Saturday, September 17, 2016
The problem with wireless earbuds for audiophiles
(The lack of an headphone jack on the iPhone 7 upset many people, but not me. I generally don't use my iPhone as a source of music, and if I were to do so in the future, I'd use an external DAC/Amp.)
To see why the wireless earbuds are a problem for audiophiles, we need to begin at the opposite end of the process, when analog signal (music) becomes a digital representation.
There are two steps in the process: first, the continuous analog signal is sliced in time, "sampled," so that it's now represented by a sequence of analog levels; second, those analog levels are compared with a finite scale, the digital scale, and the best approximation is used to represent the level, thusly:
There are two sources of information loss (or "noise") in this process:
For example, CD encoding used 44,100 samples per second per channel at 16 bits of resolution (allowing $2^{16}$ or 65,536 different levels); this was deemed enough for music since it allowed for an upper frequency limit of over 20 kHz (generally considered the limit of human hearing) and a dynamic range of 96dB (each bit adds 6dB; the choice of 96dB was widely panned by audiophiles as too small).*
As with everything in engineering (and in life, really) this was a matter of trade-offs. Later we've gone beyond these limits with other standards like SACD, for example. But the problem of trade-off remains, typically that of space or bandwidth against quality of reproduction.
Before compression, the total number of bits necessary to represent a stereo signal sampled at a rate of $s$ samples per second and a number of digital levels $2^{N}$ is $2 \, s \, N$ bits per second; because there's a lot of redundancy in music (no, it's not just Philip Glass), there are opportunities for compression.
Sometimes the music is compressed without losing information, called "lossless compression"; an example is FLAC, which has all the information necessary to reconstruct the original uncompressed digital music file. This is similar to compressing a data file for transmission; after decompression the reconstituted file must be identical to the original. (FLAC uses regularities of music to compress data more efficiently than a general compression algorithm.)
Sometimes the compression loses information that is deemed unnecessary, called "lossy compression"; MP3 compression is lossy. Lossy compression adds sampling and/or quantization noise to the original data, though the design of the compression scheme is supposed to minimize the aural effect of those additional errors in some trade-off with the compression ratio.
On the other hand, because plastic CDs and wireless signals sometimes get damaged, some space or bandwidth has to be used for error-correction codes and other digital administrative minutia. When the iPhone connects to the earbuds by wire, it can send an analog signal, but when it connects via Bluetooth, the signal is digital, must be compressed for transmission and requires a lot of network administration detritus.
So, one of the first questions wireless earbuds raise is: is Apple sending enough data over that Bluetooth connection for an audiophile? This isn't the only question, though.
Using the very best in advanced engineering CAD displays, we can see that this is only the first of four classes of problems:
Problem class 1: Quality of the Data
Apple's decision to go wireless changes the transmission of data between the main processor and the digital-to-analog conversion from a wired connector inside the phone, and protected from most interference, to a digital transmission over a noisy channel (Bluetooth). That means that a lot of other things have to be transmitted, in particular handshaking data, error-correction codes, and diagnostic signals.
The problem is mostly that Apple went from being a perfectionist's personal fiefdom (during the reign of His Steveness, may his divine hand bless you with a bounty of new MacBookPros) to being a company looking to make a buck. And companies looking to make a buck make different trade-offs.
His Steveness wanted the best. He might not have gotten it always, but he made products for people who wanted to brag they had the best. (Even when by all objective measures they didn't.) But now, the whole company seems to be into the "milk our brand while it lasts" phase of its corporate life cycle, so I'd venture that their trade-offs are much closer to the general public's than those of the fringes.
His Steveness run the company targeting the fringes, so that the general [Apple-buying] public couldpretend aspire to be in the fringes. Depending on who you ask that's "aspirational marketing" or a "reality distortion field."
Not anymore. Not for Apple.
Taking a lossy compression like MP3 and compressing even further for the earbuds (possibly limiting both the frequency and the dynamic ranges) isn't a recipe for audiophile sound. It does work for phone calls, and that's probably what most phones are used for. But for music... no.
(At this point I should mention that digital audiophiles have moved on from Apple a while ago, putting up withmiserably bad less than optimal interfaces to use things like —to go entry-level— a second-generation Fiio X5.)
Problem class 2: Quality of Digital To Analog Conversion
A second source of problems is the digital-to-analog conversion circuitry. Among the many problems that can come from a cheap (and low-power, which is important in wireless earbuds) DAC, the most obvious are reproduction errors (the same digital input doesn't map to the same voltage consistently, or the difference between digital levels doesn't match to the appropriate difference in voltages). This isn't that much of a problem in 2016 (it used to be in the 1990s).
Another, more serious problem has to do with the precision of the timing, which is one of the major reason why if you care about computer music you'll get an external DAC, possibly a Chord Mojo or an Audioquest Dragonfly. (Or maybe something from the brand that can't be named.)
Even small errors in timing (some of which are induced by the buffering and data processing necessary to extract the digital music from the wireless signal) can lead to significant phase distortion, in that the 'time' used to reproduce the music doesn't match real time.
To illustrate this problem, consider the following phase-distorted sine wave (slightly exaggerated to make the case visible, but even very small phase distortions sound horrible):
Comparing the two periods of the distorted wave, T1 and T2, you can see that phase distortion in this case induces frequency variation. This means that instruments will sound as if they are out-of-tune, and [if you're over 30 you'll get this reference] like your brand-spanking-new iPhone is a cassette player running out of battery power.
If you accidentally downloaded a [poorly encoded] FLAC file from a torrent site you accidentally fell into while looking for a French Literature study group, accidentally run that FLAC file through a FLAC to MP3 converter that you accidentally had on your computer, then accidentally played it and noticed strange warbling and high pitch glitches, that's an entirely accidental observation of very bad phase distortion.
This is why any audiophile wants a DAC that uses its own timing circuitry and buffer, rather than depend on the shared circuitry involved in network management etc.
Problem class 3: Fixed- vs Variable-Gain Analog Amplification
Many computers (and I assume all iPods and iPhones) have a fixed gain amplifier for the reconstructed analog signal. That means that changes in volume are created by multiplying the digital signal by digital fractions prior to conversion to analog. In essence, removing data from the signal.
For example, to halve a digital number, all you need to do is shift all bits right, disposing of the lower-significance bit and adding a zero at the highest significant bit (or, depending on how negative numbers are encoded, adding a copy of the previously high bit). This means that one bit of data has been lost. The sound is not just half-volume, but also half-dynamic range; each halving of volume removes one bit or 6 dB of dynamic range:
$\texttt{[1000101001011011]} \rightarrow \texttt{[0100010100101101]} \rightarrow \texttt{[0010001010010110] }$
If the original dynamic range of the data was higher than that of humans (CD or CD-derived online purchase or stream? No, it wasn't!), then this loss isn't important. Otherwise (i.e. basically always), your music just became lower resolution.
In a better sound system (i.e. any external DAC/amp), the analog signal out of the DAC goes into an analog amplifier that has variable gain. In some systems the variable gain is controlled with a knob, in others using a digital interface. But in both cases the amplifier tends to be a digitally controlled variable gain amplifier, in which the analog signal path is all analog and only the gain is controlled by a digital system (typically a feedback network of switchable topology).
(An alternative approach is to take the, say, 16-bit data and shift it 8 bits up into the most significant bits of a 24-bit word, then multiply that by an 8-bit fraction (thus allowing for 256 different volume levels) and feed the result to a 24-bit DAC, whose result will feed a fixed-gain amplifier. This allows for the whole process to be digital as long as possible.)
The amplification issue alone is worth getting an external DAC; but it's important to also consider the next point.
(My Audioquest Dragonfly is usually plugged into a powered USB hub, so it doesn't rely on the computer USB bus power.)
Problem class 4: Power issues
And this is the big big one. You like loud music? Well, expect distortion as soon as the volume gets loud. Because most of these small batteries aren't able to deliver the current needed fast enough. So what happens is that as the output voltage increases by $\Delta v$, requiring a $\propto (\Delta v)^2$ increase in power, the amplifier "fixed" gain starts to decrease, more so the higher the $\Delta v$, and we get... well, we get this:
That compression of the sine wave makes it sound nasal. When your music sounds like that, it's a sign that your amplifier is not being able to draw enough power. Note that this is different from the clipping that happens if the transistors in the output stage enter the saturation regime; in that case, instead of a smooth scrunched sine wave, we get a flat-volume squared wave, which makes everything sound like a heavy metal guitar.**
Ever wonder why 100W audiophile amplifiers have external power supplies that look bigger than the 1000W power supply on a computer server? That's because they are. Abundant power is an essential part of clean amplification, and without clean amplification the rest doesn't matter. And the way you get abundant power is you have a lot of slack available.
Care to bet how much slack power those earbuds have?
Does it matter?
To whom?
To me, no. I have a number of other, better sources of music, and I use the iPhone as an internet device and, astonishingly, as a phone. Weird, I know.
To those who just want to listen to podcasts, audiobooks, maybe some music in noisy environments? Of course not.
To an audiophile, who for some unexplained reason doesn't get a cheap lossless player like the Fiio X5? Yes, it matters, but this audiophile has the option to get the new Audioquest Dragonfly RED, with a tail adapter for the iPhone, so that's what s/he should do. Pair that with a nice pair of big cans like the Sennheiser 650s (in my opinion the best quality/price cans on the market), and you're set.
To an audiosnob who can't tell the difference between 866kbps Apple lossless and 32kbps mono MP3 but insists on having "the very best," preferably Bang & Olufsen or some other design-heavy, sound quality-light, high-reconition brand? Yes, it will matter a lot. (Audiosnobs have already invaded Head-Fi and other audiophile forums arguing against the iPhone 7 from their usual position, ignorance.)
-- -- -- -- Footnotes -- -- -- --
* Yes, the Nyquist limit for 44.1 kHz sampling is 22.05 kHz... as long as the anti-aliasing filter is a perfect step function in the frequency domain. The universe containing exactly zero perfect step function anti-aliasing filters, I and the entire engineering profession prefer to hedge by saying that it's "over 20 kHz."
When audiophiles say that LPs (Long Play records, aka "vinyl," Olivia Wilde not included) have better sound than CDs, they are usually referring to dynamic range. It's not just that CDs have only 96dB of range, but much worse, that in transferring the music from the master recordings to CD, soundbutchers engineers would monkey about with the original dynamic ranges to "make it fit better," which was disastrous for music with broad dynamic ranges.
(The standard example is the butchery of Dire Straits' "Money For Nothing," which was so compressed for the CD that it lost the whole point of the intro. Hey, though I listen almost exclusively to art music and jazz, nostalgia has its place.)
** That's because the sound effect that makes electric guitars sound like that is precisely pre-amping the sound so high that the output stage transistors will saturate and clip the waveform square, at the same time removing almost all volume envelope effects. You can do this to any instrument including voice.
Added later: yes, I know all these effects are digital now. Kids these days! In my day you built your effects with transistors, µA741s and sometimes NE555s. None of that "digitize, FFT, do whatever, convert out" nonsense. We had grit!
To see why the wireless earbuds are a problem for audiophiles, we need to begin at the opposite end of the process, when analog signal (music) becomes a digital representation.
There are two steps in the process: first, the continuous analog signal is sliced in time, "sampled," so that it's now represented by a sequence of analog levels; second, those analog levels are compared with a finite scale, the digital scale, and the best approximation is used to represent the level, thusly:
There are two sources of information loss (or "noise") in this process:
1. By taking level slices of a continuous curve, the sampling creates an imperfect representation of the curve; that's called sampling noise. The longer the slices, that is the less often the analog input is sampled, the higher this sampling noise.
2. By forcing the analog samples, which are on a continuous scale, to match the limited levels of a digital scale, the process creates a second type of noise, quantization noise. In the above example, the difference between the digital output for periods (1) and (2) is higher than the difference between the analog samples for those periods. Also, periods (2) and (3) have the same digital output, despite the different analog sample levels.To reduce sampling noise we can sample more often, that is have thinner slices of time so that there are more analog samples to represent the same curve. To lower quantization noise we can have more digital levels; typically the number of levels is a power of 2, since we use binary coding.
For example, CD encoding used 44,100 samples per second per channel at 16 bits of resolution (allowing $2^{16}$ or 65,536 different levels); this was deemed enough for music since it allowed for an upper frequency limit of over 20 kHz (generally considered the limit of human hearing) and a dynamic range of 96dB (each bit adds 6dB; the choice of 96dB was widely panned by audiophiles as too small).*
As with everything in engineering (and in life, really) this was a matter of trade-offs. Later we've gone beyond these limits with other standards like SACD, for example. But the problem of trade-off remains, typically that of space or bandwidth against quality of reproduction.
Before compression, the total number of bits necessary to represent a stereo signal sampled at a rate of $s$ samples per second and a number of digital levels $2^{N}$ is $2 \, s \, N$ bits per second; because there's a lot of redundancy in music (no, it's not just Philip Glass), there are opportunities for compression.
Sometimes the music is compressed without losing information, called "lossless compression"; an example is FLAC, which has all the information necessary to reconstruct the original uncompressed digital music file. This is similar to compressing a data file for transmission; after decompression the reconstituted file must be identical to the original. (FLAC uses regularities of music to compress data more efficiently than a general compression algorithm.)
Sometimes the compression loses information that is deemed unnecessary, called "lossy compression"; MP3 compression is lossy. Lossy compression adds sampling and/or quantization noise to the original data, though the design of the compression scheme is supposed to minimize the aural effect of those additional errors in some trade-off with the compression ratio.
On the other hand, because plastic CDs and wireless signals sometimes get damaged, some space or bandwidth has to be used for error-correction codes and other digital administrative minutia. When the iPhone connects to the earbuds by wire, it can send an analog signal, but when it connects via Bluetooth, the signal is digital, must be compressed for transmission and requires a lot of network administration detritus.
So, one of the first questions wireless earbuds raise is: is Apple sending enough data over that Bluetooth connection for an audiophile? This isn't the only question, though.
Using the very best in advanced engineering CAD displays, we can see that this is only the first of four classes of problems:
Problem class 1: Quality of the Data
Apple's decision to go wireless changes the transmission of data between the main processor and the digital-to-analog conversion from a wired connector inside the phone, and protected from most interference, to a digital transmission over a noisy channel (Bluetooth). That means that a lot of other things have to be transmitted, in particular handshaking data, error-correction codes, and diagnostic signals.
The problem is mostly that Apple went from being a perfectionist's personal fiefdom (during the reign of His Steveness, may his divine hand bless you with a bounty of new MacBookPros) to being a company looking to make a buck. And companies looking to make a buck make different trade-offs.
His Steveness wanted the best. He might not have gotten it always, but he made products for people who wanted to brag they had the best. (Even when by all objective measures they didn't.) But now, the whole company seems to be into the "milk our brand while it lasts" phase of its corporate life cycle, so I'd venture that their trade-offs are much closer to the general public's than those of the fringes.
His Steveness run the company targeting the fringes, so that the general [Apple-buying] public could
Not anymore. Not for Apple.
Taking a lossy compression like MP3 and compressing even further for the earbuds (possibly limiting both the frequency and the dynamic ranges) isn't a recipe for audiophile sound. It does work for phone calls, and that's probably what most phones are used for. But for music... no.
(At this point I should mention that digital audiophiles have moved on from Apple a while ago, putting up with
Problem class 2: Quality of Digital To Analog Conversion
A second source of problems is the digital-to-analog conversion circuitry. Among the many problems that can come from a cheap (and low-power, which is important in wireless earbuds) DAC, the most obvious are reproduction errors (the same digital input doesn't map to the same voltage consistently, or the difference between digital levels doesn't match to the appropriate difference in voltages). This isn't that much of a problem in 2016 (it used to be in the 1990s).
Another, more serious problem has to do with the precision of the timing, which is one of the major reason why if you care about computer music you'll get an external DAC, possibly a Chord Mojo or an Audioquest Dragonfly. (Or maybe something from the brand that can't be named.)
Even small errors in timing (some of which are induced by the buffering and data processing necessary to extract the digital music from the wireless signal) can lead to significant phase distortion, in that the 'time' used to reproduce the music doesn't match real time.
To illustrate this problem, consider the following phase-distorted sine wave (slightly exaggerated to make the case visible, but even very small phase distortions sound horrible):
Comparing the two periods of the distorted wave, T1 and T2, you can see that phase distortion in this case induces frequency variation. This means that instruments will sound as if they are out-of-tune, and [if you're over 30 you'll get this reference] like your brand-spanking-new iPhone is a cassette player running out of battery power.
If you accidentally downloaded a [poorly encoded] FLAC file from a torrent site you accidentally fell into while looking for a French Literature study group, accidentally run that FLAC file through a FLAC to MP3 converter that you accidentally had on your computer, then accidentally played it and noticed strange warbling and high pitch glitches, that's an entirely accidental observation of very bad phase distortion.
This is why any audiophile wants a DAC that uses its own timing circuitry and buffer, rather than depend on the shared circuitry involved in network management etc.
Problem class 3: Fixed- vs Variable-Gain Analog Amplification
Many computers (and I assume all iPods and iPhones) have a fixed gain amplifier for the reconstructed analog signal. That means that changes in volume are created by multiplying the digital signal by digital fractions prior to conversion to analog. In essence, removing data from the signal.
For example, to halve a digital number, all you need to do is shift all bits right, disposing of the lower-significance bit and adding a zero at the highest significant bit (or, depending on how negative numbers are encoded, adding a copy of the previously high bit). This means that one bit of data has been lost. The sound is not just half-volume, but also half-dynamic range; each halving of volume removes one bit or 6 dB of dynamic range:
$\texttt{[1000101001011011]} \rightarrow \texttt{[0100010100101101]} \rightarrow \texttt{[0010001010010110] }$
If the original dynamic range of the data was higher than that of humans (CD or CD-derived online purchase or stream? No, it wasn't!), then this loss isn't important. Otherwise (i.e. basically always), your music just became lower resolution.
In a better sound system (i.e. any external DAC/amp), the analog signal out of the DAC goes into an analog amplifier that has variable gain. In some systems the variable gain is controlled with a knob, in others using a digital interface. But in both cases the amplifier tends to be a digitally controlled variable gain amplifier, in which the analog signal path is all analog and only the gain is controlled by a digital system (typically a feedback network of switchable topology).
(An alternative approach is to take the, say, 16-bit data and shift it 8 bits up into the most significant bits of a 24-bit word, then multiply that by an 8-bit fraction (thus allowing for 256 different volume levels) and feed the result to a 24-bit DAC, whose result will feed a fixed-gain amplifier. This allows for the whole process to be digital as long as possible.)
The amplification issue alone is worth getting an external DAC; but it's important to also consider the next point.
(My Audioquest Dragonfly is usually plugged into a powered USB hub, so it doesn't rely on the computer USB bus power.)
Problem class 4: Power issues
And this is the big big one. You like loud music? Well, expect distortion as soon as the volume gets loud. Because most of these small batteries aren't able to deliver the current needed fast enough. So what happens is that as the output voltage increases by $\Delta v$, requiring a $\propto (\Delta v)^2$ increase in power, the amplifier "fixed" gain starts to decrease, more so the higher the $\Delta v$, and we get... well, we get this:
That compression of the sine wave makes it sound nasal. When your music sounds like that, it's a sign that your amplifier is not being able to draw enough power. Note that this is different from the clipping that happens if the transistors in the output stage enter the saturation regime; in that case, instead of a smooth scrunched sine wave, we get a flat-volume squared wave, which makes everything sound like a heavy metal guitar.**
Ever wonder why 100W audiophile amplifiers have external power supplies that look bigger than the 1000W power supply on a computer server? That's because they are. Abundant power is an essential part of clean amplification, and without clean amplification the rest doesn't matter. And the way you get abundant power is you have a lot of slack available.
Care to bet how much slack power those earbuds have?
Does it matter?
To whom?
To me, no. I have a number of other, better sources of music, and I use the iPhone as an internet device and, astonishingly, as a phone. Weird, I know.
To those who just want to listen to podcasts, audiobooks, maybe some music in noisy environments? Of course not.
To an audiophile, who for some unexplained reason doesn't get a cheap lossless player like the Fiio X5? Yes, it matters, but this audiophile has the option to get the new Audioquest Dragonfly RED, with a tail adapter for the iPhone, so that's what s/he should do. Pair that with a nice pair of big cans like the Sennheiser 650s (in my opinion the best quality/price cans on the market), and you're set.
To an audiosnob who can't tell the difference between 866kbps Apple lossless and 32kbps mono MP3 but insists on having "the very best," preferably Bang & Olufsen or some other design-heavy, sound quality-light, high-reconition brand? Yes, it will matter a lot. (Audiosnobs have already invaded Head-Fi and other audiophile forums arguing against the iPhone 7 from their usual position, ignorance.)
-- -- -- -- Footnotes -- -- -- --
* Yes, the Nyquist limit for 44.1 kHz sampling is 22.05 kHz... as long as the anti-aliasing filter is a perfect step function in the frequency domain. The universe containing exactly zero perfect step function anti-aliasing filters, I and the entire engineering profession prefer to hedge by saying that it's "over 20 kHz."
When audiophiles say that LPs (Long Play records, aka "vinyl," Olivia Wilde not included) have better sound than CDs, they are usually referring to dynamic range. It's not just that CDs have only 96dB of range, but much worse, that in transferring the music from the master recordings to CD, sound
(The standard example is the butchery of Dire Straits' "Money For Nothing," which was so compressed for the CD that it lost the whole point of the intro. Hey, though I listen almost exclusively to art music and jazz, nostalgia has its place.)
** That's because the sound effect that makes electric guitars sound like that is precisely pre-amping the sound so high that the output stage transistors will saturate and clip the waveform square, at the same time removing almost all volume envelope effects. You can do this to any instrument including voice.
Added later: yes, I know all these effects are digital now. Kids these days! In my day you built your effects with transistors, µA741s and sometimes NE555s. None of that "digitize, FFT, do whatever, convert out" nonsense. We had grit!
Thursday, September 8, 2016
Multitasking at the gym
Powerlifting and other training (including conditioning) are not multi-taskable. It's very important to keep one's concentration and focus on the exercise. I cringe when I see people talking with each other while moving metal. Even during warm-up sets; perhaps especially during warm-up sets, when the low weight allows one to do a preflighting of the movement, check for any anomalies in mobility or weak or sore prime movers or stabilizers.
When walking short distances, cooking, or doing housework, I tend to listen to podcasts or sometimes to the audiotrack of YouTube hangouts (basically the equivalent of radio's Morning Zoo). These are ways to get some low-density information into the brainpan without distracting too much from the errands. (I also listen to podcasts on shared transportation, like shuttles. Too much entropy for anything else.)
Some podcasts I listen to (there are more; I usually only listen to a few episodes a week):
(Yes, I have a significant déformation professionelle.)
When I go for a real walk, what I call a walk-n-think, I typically listen to music, not any sources of information. The point is to think and clear the cobwebs of my mind. I find the Baroque a particularly good cobweb-solvent period. Here's a walk-n-think with a side-trip to exchange books at the SFPL:
Once in a repetitive-motion machine in the gym, for oxygenation not conditioning purposes, the main determinant of the type of content is the movement of the head, in particular the eyes.
When walking on treadmills (my preferred cool-down approach) or rowing on a machine (which for me is real exercise, but of form and rhythm, not muscle), the head moves too much to fix the eyes on a screen; as the activity itself requires less attention than the errands, freeing attention for content, my choices of media are audio lectures and audio books.
(I only run on treadmills for High-Intensity Interval Training, which is conditioning, which means it cannot be multitasked. When doing anything that stresses the body, I always want 100% of the attention to be on the exercise. I have this strange desire to avoid injury, ridicule, and absence of gains; sort of the philosophical opposite of CrossFit.)
I should clarify that I'm using "lecture" to mean all sorts of purposeful speeches, not just university lectures. I do have a number of these speeches and lectures which work out well, many of them extracted from videos of talks where there were no significant visuals (or the visuals were the dreaded "power points," which are speaker's notes not audience-centered visuals).
As for audiobooks, I've been a Platinum member of Audible for fifteen years, which means I have two new books per month, which I complement by filling up on the seasonal sales and the occasional extra purchase.
Here are a few of my latest Audible purchases:
On average I listen to around 30 audiobooks per year, some of which are re-listens.
(Yes, I re-read and re-listen to books. There are some books I read pretty much every year… Waugh, Wilde, and Wodehouse; certain Poirots and Maigrets; a few favorite Discworld pieces. There are 1000-page books I read every year, though that's just Anathem. And Cryptonomicon. And Reamde. And Seveneves, now on its second year. Guess who my favorite living author is.)
For other machines, like elliptical runners, stairclimbers, and exercise bicycles, the head doesn't move, so it's feasible to use the eyes. My old-but-trusted iPad 1.0 has seen this gym duty pretty much from the first day I bought it, which was the day it came out. (100% impulse purchase, as I was coming back from brunch and passed an Apple Store.)
Though in the past I've read books (paper books), journals (academic magazines), and magazines on paper on these machines, and have evolved to read electronic versions of these, I find that I prefer to give the eyes a break by letting them watch video instead of processing written words. I tend to watch lectures (again including speeches, but in this case a lot more real lectures) on the elliptical and the stairclimber, and to read books (ebooks with large type) only on the exercycle.
(Basically I use elliptical, exercycle, and stairclimbers in my building exercise room. It's not a "gym event," rather a "I need to take a break and instead of vegetating in front of the TV, which I no longer have service for, I can go do some movement while imbibing some basic knowledge.)
I hasten to point out that despite the déformation professionelle mentioned above, I tend to think of these books and lectures as leisure, so I keep them broadly within my areas of interest but not focussed on my actual area of work. For example, here are a few courses that I've enjoyed on the elliptical machines in the exercise room:
It's worth mentioning that real intellectual work cannot be multitasked, as indicated by the position of textbooks and research papers in the diagram. Anytime I'm looking to learn something, that requires dedicated attention, note-taking, and a block of dedicated time.
I don't mean work-related textbooks (though american textbook prices do their darndest to discourage the intellectually curious from serious study) or research papers (ditto with the gating, but public libraries and authors' own webpages are a good workaround), but even when I'm trying to learn something, say geology, our of pure curiosity, reading textbooks and research papers has been a much better experience than the materials that now pass for science popularization.
(My opinion on the decline of science popularization is well established in this blog.)
One thing I used to do at the gym (the real big gym, not the exercise room and not the powerlifting gym I occasionally go to instead of driving to the big gym) and eventually stopped due to social pressure, was to watch FoodTV network on the gym TV while cooling down on a treadmill or an elliptical, after 90-120 minutes of iron and conditioning. For some reason, those whose entire workout is 30 min of slow walking on the elliptical (what I call a Potemkin workout, still better than Planet Fatness or CrossFit) were not happy with my selection of programming.
Go figure.
Tuesday, August 30, 2016
Some thoughts on quant interviews
Being a curmudgeonly quant, I started reacting to people who "love" science and math with simple Post-It questions like this:
(This is not a gotcha question, all you need is to apply Pythagorean theorem twice. I even picked numbers that work out well. Yes, $9 \sqrt{2}$ is a number that works out well.)
Which reminds me of quant interviews and their shortcomings.
I already wrote about what I think is the most important problem in quantitative thinking for the general public, in Innumeracy, Acalculia, or Numerophobia, which was inspired by this Sprezzaturian's post (Sprezzaturian was writing about quant interviews).
In search of quants
That was for the general public. This post is specifically about interviewing to determine quality of quantitative thinking. Which is more than just mathematical and statistical knowledge.
One way to test mathematical knowledge is to ask the same type of questions one gets in an exam, such as:
$\qquad$ Compute $\frac{\partial }{\partial x} \frac{\partial }{\partial y} \frac{2 \sin(x) - 3 \sin(y)}{\sin(x)\sin(y)}$.
Having interacted with self-appointed "analytics experts" who had trouble with basic calculus (sometimes even basic algebra), this kind of test sounds very appealing at first. But its focus in on the wrong side of the skill set.
Physicist Eric Mazur has the best example of the disconnect between being able to answer a technical question and understanding the material:
Testing what matters
Knowledge tests should at the very least be complemented with (if not superseded by) "facility with quantitative thinking"-type questions. For example, let's say Bob is interviewing for a job and is given the following graph (and formula):
Nina, the interviewer, asks Bob to explain what the formula means and to grok the parameters.
Bob Who Recites Knowledge will say something like "it's a sine with argument $2 \pi \rho x$ multiplied by an exponential of $- \kappa x$; if you give me the data points I can use Excel Solver to fit a model to get estimates of $\rho$ and $\kappa$."
Bob Who Understands will start by calling the graph what it is: a dampened oscillation over $x$. Treating $x$ as time for exposition purposes, that makes $\rho$ a frequency in Hertz and $\kappa$ the dampening factor.
Next, Bob Who Understands says that there appear to be 5 1/4 cycles between 0 and 1, so $\hat \rho = 5.25$. Estimating $\kappa$ is a little harder, but since the first 3/4 cycle maps to an amplitude of $-0.75$, all we need is to solve two equations, first translating 3/4 cycle to the $x$ scale,
$\qquad$ $ 10.5 \, \pi x = 1.5 \, \pi$ or $x= 0.14$
and then computing a dampening of $0.75$ at that point, since $\sin(3/2 \, \pi) = - 1$,
$\qquad$ $\exp(-\hat\kappa \times 0.14) = 0.75$, or $\hat \kappa = - \log(0.75)/0.14 = 2.3$
Bob Who Understands then says, "of course, these are only approximations; given the data points I can quickly fit a model in #rstats that gets better estimates, plus quality measures of those estimates."
(Nerd note: If instead of $e^{-\kappa x}$ the dampening had been $2^{-\kappa x}$, then $1/\kappa$ would be the half-life of the process; but the numbers aren't as clean with base $e$.)
This facility with approximate reasoning (and use of #rstats :-) signal something important about Bob Who Understands: he understands what the numbers mean in terms of their effects on the function; he groks the function.
Nina hires Bob Who Understands. Bonuses galore follow.
Bob Who Recites Knowledge joins a government agency, funding research based on "objective, quantitative" metrics, where he excels at memorizing the 264,482 pages of regulation defining rules for awarding grants.
(This is not a gotcha question, all you need is to apply Pythagorean theorem twice. I even picked numbers that work out well. Yes, $9 \sqrt{2}$ is a number that works out well.)
Which reminds me of quant interviews and their shortcomings.
I already wrote about what I think is the most important problem in quantitative thinking for the general public, in Innumeracy, Acalculia, or Numerophobia, which was inspired by this Sprezzaturian's post (Sprezzaturian was writing about quant interviews).
In search of quants
That was for the general public. This post is specifically about interviewing to determine quality of quantitative thinking. Which is more than just mathematical and statistical knowledge.
One way to test mathematical knowledge is to ask the same type of questions one gets in an exam, such as:
$\qquad$ Compute $\frac{\partial }{\partial x} \frac{\partial }{\partial y} \frac{2 \sin(x) - 3 \sin(y)}{\sin(x)\sin(y)}$.
Having interacted with self-appointed "analytics experts" who had trouble with basic calculus (sometimes even basic algebra), this kind of test sounds very appealing at first. But its focus in on the wrong side of the skill set.
Physicist Eric Mazur has the best example of the disconnect between being able to answer a technical question and understanding the material:
TL; DR: students can't apply Newton's third law of motion (for every action there's an equal and opposite reaction) to a simple problem (car collision), though they can all recite that selfsame third law. I wrote a post about this before.
Testing what matters
Knowledge tests should at the very least be complemented with (if not superseded by) "facility with quantitative thinking"-type questions. For example, let's say Bob is interviewing for a job and is given the following graph (and formula):
Nina, the interviewer, asks Bob to explain what the formula means and to grok the parameters.
Bob Who Recites Knowledge will say something like "it's a sine with argument $2 \pi \rho x$ multiplied by an exponential of $- \kappa x$; if you give me the data points I can use Excel Solver to fit a model to get estimates of $\rho$ and $\kappa$."
Bob Who Understands will start by calling the graph what it is: a dampened oscillation over $x$. Treating $x$ as time for exposition purposes, that makes $\rho$ a frequency in Hertz and $\kappa$ the dampening factor.
Next, Bob Who Understands says that there appear to be 5 1/4 cycles between 0 and 1, so $\hat \rho = 5.25$. Estimating $\kappa$ is a little harder, but since the first 3/4 cycle maps to an amplitude of $-0.75$, all we need is to solve two equations, first translating 3/4 cycle to the $x$ scale,
$\qquad$ $ 10.5 \, \pi x = 1.5 \, \pi$ or $x= 0.14$
and then computing a dampening of $0.75$ at that point, since $\sin(3/2 \, \pi) = - 1$,
$\qquad$ $\exp(-\hat\kappa \times 0.14) = 0.75$, or $\hat \kappa = - \log(0.75)/0.14 = 2.3$
Bob Who Understands then says, "of course, these are only approximations; given the data points I can quickly fit a model in #rstats that gets better estimates, plus quality measures of those estimates."
(Nerd note: If instead of $e^{-\kappa x}$ the dampening had been $2^{-\kappa x}$, then $1/\kappa$ would be the half-life of the process; but the numbers aren't as clean with base $e$.)
This facility with approximate reasoning (and use of #rstats :-) signal something important about Bob Who Understands: he understands what the numbers mean in terms of their effects on the function; he groks the function.
Nina hires Bob Who Understands. Bonuses galore follow.
Bob Who Recites Knowledge joins a government agency, funding research based on "objective, quantitative" metrics, where he excels at memorizing the 264,482 pages of regulation defining rules for awarding grants.
Labels:
analytics,
business,
estimation,
math,
Numbers,
problem-solving,
Quants,
quantThoughts,
STEM
Friday, August 19, 2016
The strange case of the oscillating black hole at the gym
There's a micro-black hole at my gym, and it oscillates between a position under the squat cages and the deadlift platform, in synchrony with my powerlifting program.
It's the only possible explanation.
The data: following my not-very-demanding powerlifting program (which is very low volume, even for powerlifting), I should have gained $5\%$ in both the squat and the deadlift in the last six weeks. This is feasible because I'm recovering strength from the beginning of the year, not creating new strength. (Who said powerlifters have crazy superstitions?)
Clearly, what is happening is that the same mass (bar + weights) is exerting a larger force on my body, which means that there's a micro-black hole under the gym. Since I estimate that there's a 3-meter foundation, this being earthquake territory and all, I postulate that the black hole is below that:
Furthermore, it has to move, since it doesn't affect bench press (where, despite a damaged right rotator cuff, I'm recovering strength well above the program envelope) but it affects the other two lifts. Since it affects both lifts the same percentage, that black hole has to move diagonally, as seen above. It also oscillates back and forth between the squat and deadlift stations.
Two black holes, you say? Don't be ridiculous. Two back holes, indeed! Pah!
So, a little back-of-the-drawing calculation, the kind that drives OCD quants crazy...
(with three or four corrections along the way, including a slight ahem when I used $c = 3\times 10^{9}$ instead of the correct $c = 3\times 10^{8}$ m/s)
... and I have my micro-black hole. As small as the total gains of an entire continent's worth of CrossFitters, at a Schwarzchild radius of $3\times 10^{-16}$ meter and as heavy as a Planet Fitness personal trainer, at a mass of $2\times 10^{11}$ kilogram. That mass means that the black hole won't evaporate anytime soon, so my stalled gains will continue.
(The time to evaporate a black hole with a mass of $10^{11}$kg is in the billions of years, about the time it would take for a CrossFitter to do one good chin-up or a Planet Fitness client to lose five ounces of fat.)
Clearly this is an important discovery. Hello, Nobel Committee? Got a pick for 2017 Physics yet?
Alternative explanation 1: weight gain on my part
First off, to cancel a $5\%$ increase in squat and deadlift, I'd have to have gained close to $15\%$ of my bodyweight over six weeks. That's not impossible (or even unheard of), but in reality I've been losing weight at about 1kg per week, mostly fat, hopefully more than 1.5kg of fat per week (muscle mass increasing at 0.5kg/week during a recovery is reasonable).
Also, weight gain wouldn't affect squat and deadlift in the same way, unless I gained all the weight above my sternum. (I continue to improve my mental skills, but that doesn't significantly increase the mass of the brain...)
In an ass-to-grass squat (my type of squat), the femur goes over a 110-120 degree arc, hence getting to the weakest part of the quads force curve. So, some more weight in the torso may affect the ability to squat heavy. But for the deadlift, the drive with the legs is only an arc of 60-70 degrees, well away from the weak part of the force curve for the quads, therefore the loss of deadlifting power given additional bodyweight should be much lower than the loss for the squat, not the same. But the same it is.
(In the squat my weakness is the quads, in the deadlift, the spinal erectors; never my glutes. Hip thrusts, baby, hip thrusts FTW! I do leg-extensions with the full stack for reps, but only an ass-to-grass squat hits the quads at their full extension...)
This explanation is therefore dismissed.
Alternative explanation 2: poor supplementation
A picture is worth a thousand words (and about two hundred dollars):
Of course, I eschew that marvelous "supplement" family, anabolic steroids, or if one wants to be a little more discreet, TRT, testosterone replacement therapy. I like my reproductive system to stay at manufacturer's specification. It's kind of a big deal for me, to have the theoretical capability for reproduction (Theoretical because the 3.75 billion women in the world took a vote and unanimously –minus my mother– decided that for the good of the universe I should not reproduce; who am I to question democracy?)
This explanation is therefore dismissed.
Alternative explanation 3: I'm no longer an 18-year-old kid.
Poppycock and balderdash! Balderdash, I say!
Age is but a number and you're as young as you feel. Besides I'm barely in my early middle age -- just a few months past 30.*
This explanation is dismissed with extreme prejudice and a SEAL Team 6 visit.
Conclusion
The only possible logical conclusion is that, like in the 1990 David Brin scifi novel Earth, there's a naughty micro-black hole oscillating between the space under the squat cages and the lifting platforms, and by enormous coincidence its period matches my powerlifting program.
Obviously the solution is to combine the Westside Barbell approach of growing a big belly with the Testosterone Nation recommendation of synergistic beard growing and head shaving so that, even with increasing gravity, gains will come:
It's Science!
-- -- -- --
* 236 months, to be precise.
It's the only possible explanation.
The data: following my not-very-demanding powerlifting program (which is very low volume, even for powerlifting), I should have gained $5\%$ in both the squat and the deadlift in the last six weeks. This is feasible because I'm recovering strength from the beginning of the year, not creating new strength. (Who said powerlifters have crazy superstitions?)
Clearly, what is happening is that the same mass (bar + weights) is exerting a larger force on my body, which means that there's a micro-black hole under the gym. Since I estimate that there's a 3-meter foundation, this being earthquake territory and all, I postulate that the black hole is below that:
Furthermore, it has to move, since it doesn't affect bench press (where, despite a damaged right rotator cuff, I'm recovering strength well above the program envelope) but it affects the other two lifts. Since it affects both lifts the same percentage, that black hole has to move diagonally, as seen above. It also oscillates back and forth between the squat and deadlift stations.
Two black holes, you say? Don't be ridiculous. Two back holes, indeed! Pah!
So, a little back-of-the-drawing calculation, the kind that drives OCD quants crazy...
(with three or four corrections along the way, including a slight ahem when I used $c = 3\times 10^{9}$ instead of the correct $c = 3\times 10^{8}$ m/s)
... and I have my micro-black hole. As small as the total gains of an entire continent's worth of CrossFitters, at a Schwarzchild radius of $3\times 10^{-16}$ meter and as heavy as a Planet Fitness personal trainer, at a mass of $2\times 10^{11}$ kilogram. That mass means that the black hole won't evaporate anytime soon, so my stalled gains will continue.
(The time to evaporate a black hole with a mass of $10^{11}$kg is in the billions of years, about the time it would take for a CrossFitter to do one good chin-up or a Planet Fitness client to lose five ounces of fat.)
Clearly this is an important discovery. Hello, Nobel Committee? Got a pick for 2017 Physics yet?
Alternative explanation 1: weight gain on my part
First off, to cancel a $5\%$ increase in squat and deadlift, I'd have to have gained close to $15\%$ of my bodyweight over six weeks. That's not impossible (or even unheard of), but in reality I've been losing weight at about 1kg per week, mostly fat, hopefully more than 1.5kg of fat per week (muscle mass increasing at 0.5kg/week during a recovery is reasonable).
Also, weight gain wouldn't affect squat and deadlift in the same way, unless I gained all the weight above my sternum. (I continue to improve my mental skills, but that doesn't significantly increase the mass of the brain...)
In an ass-to-grass squat (my type of squat), the femur goes over a 110-120 degree arc, hence getting to the weakest part of the quads force curve. So, some more weight in the torso may affect the ability to squat heavy. But for the deadlift, the drive with the legs is only an arc of 60-70 degrees, well away from the weak part of the force curve for the quads, therefore the loss of deadlifting power given additional bodyweight should be much lower than the loss for the squat, not the same. But the same it is.
(In the squat my weakness is the quads, in the deadlift, the spinal erectors; never my glutes. Hip thrusts, baby, hip thrusts FTW! I do leg-extensions with the full stack for reps, but only an ass-to-grass squat hits the quads at their full extension...)
This explanation is therefore dismissed.
Alternative explanation 2: poor supplementation
A picture is worth a thousand words (and about two hundred dollars):
Of course, I eschew that marvelous "supplement" family, anabolic steroids, or if one wants to be a little more discreet, TRT, testosterone replacement therapy. I like my reproductive system to stay at manufacturer's specification. It's kind of a big deal for me, to have the theoretical capability for reproduction (Theoretical because the 3.75 billion women in the world took a vote and unanimously –minus my mother– decided that for the good of the universe I should not reproduce; who am I to question democracy?)
This explanation is therefore dismissed.
Alternative explanation 3: I'm no longer an 18-year-old kid.
Poppycock and balderdash! Balderdash, I say!
Age is but a number and you're as young as you feel. Besides I'm barely in my early middle age -- just a few months past 30.*
This explanation is dismissed with extreme prejudice and a SEAL Team 6 visit.
Conclusion
The only possible logical conclusion is that, like in the 1990 David Brin scifi novel Earth, there's a naughty micro-black hole oscillating between the space under the squat cages and the lifting platforms, and by enormous coincidence its period matches my powerlifting program.
Obviously the solution is to combine the Westside Barbell approach of growing a big belly with the Testosterone Nation recommendation of synergistic beard growing and head shaving so that, even with increasing gravity, gains will come:
It's Science!
-- -- -- --
* 236 months, to be precise.
Sunday, August 14, 2016
Working the solution versus solving the problem
Some time ago I tweeted that I was going to row a number of nautical miles on my trusty old Concept IIc machine. As an engineer, I use SI units for everything --- except on the water, where I use traditional units: nautical miles and knots.
A couple of rowers I know asked me how I had hacked the controller on the Concept IIc to change the units. This was my answer:
Many people miss the point, that the others were making a common mistake in problem-solving, a mistake that forecloses most creative solutions:
The mistake is working the solution instead of solving the problem.
Hidden in the question about the hack is an assumption: that the solution has to come from my programming skills (they know what I do, so it's not an unreasonable assumption). That assumption sets a path to a solution, which would include reprogramming the firmware inside the Concept IIc controller.
Having the ability to backtrack from that path into the beginning and to choose another path is the key process in the thinking process here. Too many people start on one path and can't get off it to pursue other possible paths to the solution.
By focussing on the problem, i.e. the question "what is to be achieved?", rather than the solution under consideration, changing the software, the mistake was avoided.
Yes, this is a trivial and obvious (after the fact) example, but often the difference between a non-working "solution" and a working solution is a matter of focus on the problem to be solved.
Alas, changing their focus is too hard for some would-be problem solvers.
A couple of rowers I know asked me how I had hacked the controller on the Concept IIc to change the units. This was my answer:
Many people miss the point, that the others were making a common mistake in problem-solving, a mistake that forecloses most creative solutions:
The mistake is working the solution instead of solving the problem.
Hidden in the question about the hack is an assumption: that the solution has to come from my programming skills (they know what I do, so it's not an unreasonable assumption). That assumption sets a path to a solution, which would include reprogramming the firmware inside the Concept IIc controller.
Having the ability to backtrack from that path into the beginning and to choose another path is the key process in the thinking process here. Too many people start on one path and can't get off it to pursue other possible paths to the solution.
By focussing on the problem, i.e. the question "what is to be achieved?", rather than the solution under consideration, changing the software, the mistake was avoided.
Yes, this is a trivial and obvious (after the fact) example, but often the difference between a non-working "solution" and a working solution is a matter of focus on the problem to be solved.
Alas, changing their focus is too hard for some would-be problem solvers.
Labels:
creativity,
Engineering,
problem-solving,
STEM,
thinking
Subscribe to:
Posts (Atom)

















