About the Amplitudes of a Discrete Differential

One of the concepts which exist in digital signal processing, is that the difference between two consecutive input samples (in the time-domain) can simply be output, thus resulting in a differential of some sort, even though the samples of data do not represent a continuous function. There is a fact which must be observed to occur at (F = N / 2) – i.e. when the frequency is half the Nyquist Frequency, of (h / 2) , if (h) is the sampling frequency.

The input signal could be aligned with the samples, to give a sequence of [s0 … s3] equal to

0, +1, 0, -1

This set of (s) is equivalent to a sine-wave at (F = N / 2) . Its discrete differentiation [h0 … h3] would be

+1, +1, -1, -1

At first glance we might think, that this output stream has the same amplitude as the input stream. But the problem becomes that the output stream is by same token, not aligned with the samples. There is an implicit peak in amplitudes between (h0) and (h1) which is greater than (+1) , and an implicit peak between (h2) and (h3) more negative than (-1) . Any adequate filtering of this stream, belonging to a D/A conversion, will reproduce a sine-wave with a peak amplitude greater than (1).

(Edit 03/23/2017 :

In this case we can see, that samples h0 and h1 of the output stream, would be phase-shifted 45⁰ with respect to the zero crossings and to the peak amplitude, that would exist exactly between h0 and h1. Therefore, the amplitude of h0 and h1 will be the sine-function of 45⁰ with respect to this peak value, and the actual peak would be (the square root of 2) times the values of h0 and h1. )

And so a logical question which anybody might want an answer to would be, ‘Below what frequency does the gain cross unity gain?’ And the answer to that question is revealed by Differential Calculus. If a sine-wave has a peak amplitude of (1), then its instantaneous differential equals (2 π F) , which is also known as (ω) , at zero-crossing. It follows that unit gain will only take place at (F = N / π) . This is a darned low frequency in practice. If the sampling rate was 44.1kHz, this is achieved somewhere around 7 kHz, and music, for which that sampling rate was devised, easily contains sound energy above that frequency.

What follows is also a reason for which by itself, offers poor performance in compressing signals. It usually needs to be combined with other methods of data-reduction, thus possibly resulting in the lossy . And another approach which uses , is , the last of which is a proprietary codec, which minimizes the loss of quality that might otherwise stem from using .

I believe this observation is also relevant to This Earlier Posting of mine, which implied a High-Pass Filter with a cutoff frequency of 1 kHz, that would be part of a Band-Pass Filter. My goal was to obtain a gain of at least 0.5 , over the entire interval, and to simplify the Math.

(Edited 03/21/2017 . )

Continue reading About the Amplitudes of a Discrete Differential

aptX Handles Polyphonic Sound Surprisingly Well.

Right now, as I am typing this, I am listening to Beethovens 9th Symphony on my real “LG Tone Pro HBS-750″ Bluetooth Headphones. The quality of sound is dramatically better, than what the fake HBS-730s had produced, simply because those were fake.

This recording of Beethoven is stored on my phone, as a series of FLAC files, and Android Lollipop devices are well-able to play back FLAC files. I did this, in order to test the fake headphones at first, because I was not sure whether their poor performance then was due to some interaction of aptX, with MP3 or OGG compression, rather than due to the implementation of aptX I was getting. Playing back a FLAC file is equivalent to playing back a raw audio file.

From what I read, aptX not only splits the uncompressed spectrum into 4 sub-bands, but then quantizes each sub-band. The 4 sub-bands are approximately from 0 to 5.5 kHz, from 5.5 to 11 kHz, from 11 kHz to 16.5 kHz, and finally from 16.5 kHz to 22 kHz. These sub-bands are then compressed using ADPCM, which allocates 8,4,2,2 bits to each.

This implies, that the first sub-band contains the bass and the mid-range, and that what I would call ‘melodic treble’ sounds, do not extend beyond sub-band 2, since treble notes with fundamental frequencies higher than 11 kHz are not usually played. And sub-bands 3 and 4 simply add texture to the sound. This means, that to allocate fewer bits of precision to sub-bands 3 and 4 ‘makes sense’, since our natural way of interpreting sound, already sees less detail at those frequencies.

A question which I had raised earlier, was if the act of quantizing the sub-bands 3 and 4 greatly – down to 2 bits in fact – will damage the degree of polyphony that can be achieved.

And now that I possess true headphones I am finding, that the answer is No. The sub-bands 3 and 4, are still capable of being played back in a multi-spectral way, even though their differentials have been quantized that much.

(Edit 06/25/2016 : ) Instead of receiving a regular sequence of +1, 0 and -1 data-points, it is possible to receive an atactic sequence of them. The first thing that happens when decoding that, is an integration, which will already emphasize lower, original frequency components that have been deemphasized. After that, the degree with which the analog signal can be reconstructed is only as good, as the interpolation. And in practice, interpolation is often provided by means of a linear filter which has more than two coefficients. Having a longer sequence of coefficients, such as maybe 6 or 8, provides better interpolation, even in sub-bands 3 and 4, which we supposedly hear less-well.

 

I do find though, now that the entire signal is much more clear, that when I listen closely, the highest frequencies belonging to Beethovens 9th, seem to have slightly less resolution than they are truly supposed to have. But not as much less resolution, than I am used to hearing, due to poor headphones, or due to MP3 compression.

It is already a dramatic improvement over what my past told me, that today, Some Bluetooth Headphones can play back high-quality music, in addition to being usable for telephony.

Now, Beethoven died before he finished his 9th symphony, and later artists officially completed it, by adding the 5th movement, which is actually “Shiller’s Ode To Joy”. According to what I am hearing, that 5th movement is compromised more by the aptX compression than the first 4 were, that were actually written by Beethoven.

The reason seems to be the fact, that Shiller’s work is more operatic, and has choruses singing very high notes, which results in a lot of the signal energy being in the 2nd, 3rd and 4th sub-bands. So when I hear that movement, I can hear the quantization quite clearly.

It is usually not a preference of mine, to listen to this 5th movement, because I don’t find it to be authentic Beethoven. Right now I am listening to it, and observing this effect with some fascination.

Dirk

 

How Low-Latency CODECs can have a Time-Delay on PCs and Mobile Devices.

aptX is a CODEC, which uses two stages of “Linear Filters”, which are also known as “Convolutions”. And aptX gets used by some of the Bluetooth Headphones, that have it as a special feature, to be able to play HiFi music.

If we could just assume for the moment that each of the filters used by aptX is a 6-tap filter, meaning a filter with 6 coefficients, which is a realistic assumption, it would seem that ‘low latency’ is implied.

aptX subdivides the uncompressed spectrum into 4 sub-bands, about 5 kHz wide each, and each of which has been converted into a parallel 11.025 kHz stream of samples, for further processing. At first glance, one would assume that the latency of such a filter is the amount of time it takes, for an input sample of sound to make it past 6 coefficients then. This would mean that the latency of one filter stage is less than 1 millisecond. And so the next question which a casual observer might ask would be, ‘Why then, is there a noticeable time-delay when I listen to my Bluetooth Media?’

In this case, this time-delay has nothing to do with the Wavelets used, or the low-pass and band-pass filters themselves. When we listen to a stream on a PC, a Laptop, or a consumer Mobile Device such as a smart-phone, there are stages involved, which most users do not see, and which have nothing to do with these individual 6-tap filters.

aptX is actually implemented on the hardware side, within the Bluetooth chip-set of the source of the stream. It does not even rely on the CPU for the processing.

But what happens to any audio streamed on a consumer PC / Laptop / Mobile Device, is that first a user-space application needs to transfer the audio into kernel space, that next a kernel module needs to transfer the stream, essentially, to the hardware interface, and that then, firmware for the chip-set allows the latter to compress the stream on its way out via the Bluetooth antenna.

In consumer computing, every time an audio stream needs to be transferred from one process to another, there is a buffer that stores a minimum interval of sound. And the number of buffered samples can be higher than what we imagine, because software specialists try to make up for possible multi-tasking here, that could cause the stream to skip or drop, because the actual CPU has been called to do some background processing, outside of playing back the audio stream. Such a condition is called a “Buffer Underflow” when it happens. So the delay of each of these buffers is commonly kept high, so that all the audio we are hearing, has been delayed as a unit, and so that the CPU can still perform additional tasks, without necessarily causing the audio to skip.

Such buffering does not just happen once, in consumer electronics, but several times.

The situation is different, when aptX is built-in to professional equipment, that gets used in concerts etc.. Here, the chips are not embedded in all-purpose computing devices, but rather into dedicated devices. And here, the buffering has essentially been eliminated, so that the technology can be used live.

Dirk

 

I now have LG Tone Pro HBS-750 Bluetooth Headphones.

And unlike how it went with the previous set, I paid the full price for these, and know that they are genuine.

I can now comment accurately for the first time, about the “aptX” sound compression they use.

I understand that most of the music that I will be playing, has already been MP3 or OGG compressed. But with my simple headphones, that were wired to the stereo mini-jack on my phone, there was a loss in quality, just in getting the sound to my ears, after MP3 or OGG decoding. With aptX, it could be argued that there is also some small loss of quality in getting the sound to my ears.

aptX, and the HBS-750 headphones, are able to get the sound to my ears, after lossy decompression, better than the wired headphones could. So the only sound artifacts that I will ever hear with these, will be those due to MP3 or OGG, and the OGG files will play better again than the MP3 files did, as the OGG files are supposed to do.

The sound of these headphones is truly superb.

Further, the reason for which the suggested app ‘Tone And Talk’ was not recognizing the supposed HBS-730 headphones, was the mere fact that this app was able to read the meta-data of those, and was able to determine, that those were just not on the list of supported headphones, even though I was fooled into believing that they were.

Tone And Talk works properly, with the HBS-750 headphones, that are genuine LG headphones. That is, unless I am to do a detailed test of this app, which may come later. But the app does not just sit there and stay lame, as it did with the counterfeit headphones.

Dirk