## Trying to bridge the gap to mobile-friendly reading of typeset equations, using EPUB3?

One of the sad facts about this blog is, that it’s not very mobile-friendly. The actual WordPress Theme that I use is very mobile-friendly, but I have the habit of inserting links into postings, that open typeset Math, in the form of PDF Files. And the real problem with those PDF Files is, the fact that when people try to view them on, say, smart-phones, the Letter-Sized page format forces them to pinch-zoom the document, and then to drag it around on their phone, not getting a good view of the overall document.

And so eventually I’m going to have to look for a better solution. One solution that works, is just to output a garbled PDF-File. But something better is in order.

A solution that works in principle, is to export my LaTeX -typeset Math to EPUB3-format, with MathML. But, the other EPUB and/or MOBI formats just don’t work. But the main downside after all that work for me is, the fact that although there are many ebook-readers for Android, there are only very few that can do everything which EPUB3 is supposed to be able to do, including MathML. Instead, the format is better-suited for distributing prose.

One ebook-reader that does support EPUB3 fully, is called “Infinity Reader“. But if I did publish my Math using EPUB3 format, then I’d be doing the uncomfortable deed, of practically requiring that my readers install this ebook-reader on their smart-phones, for which they’d next need to pay a small in-app purchase, just to get rid of the ads. I’d be betraying all those people who, like me, prefer open-source software. For many years, some version of ‘FBReader’ has remained sufficient for most users.

Thus, if readers get to read This Typeset Math, just because they installed that one ebook-reader, then the experience could end up becoming very disappointing for them. And, I don’t get any kick-back from ImeonSoft, for having encouraged this.

I suppose that this cloud has a silver lining. There does exist a Desktop-based / Laptop-based ebook-reader, which is capable of displaying all these EPUB3 ebooks, and which is as free as one could wish for: The Calibre Ebook Manager. When users install this either under Linux or under Windows, they will also be able to view the sample document I created and linked to above.

(Updated 1/6/2019, 6h00 … )

## Minor Android Update Tonight

My Samsung Galaxy S6 smart-phone runs Android 7.0, and received a minor system update tonight, which only required that 18MB of software be downloaded. The update completed quickly, but it will require some more, extensive use, before I can know whether the promised stability and security improvements are apparent.

I was never really dissatisfied with the phone’s stability.

Dirk

## The GSam Battery Monitoring App

On my Android smart-phone, I have the third-party “GSam” battery monitoring app installed.

This app can be a useful tool, to determine which other apps are causing the greatest battery drain. It gives very detailed information about the battery and its charging behavior.

Further, this app will state the battery voltage – in addition to the percentage charged – any time it is clicked on. This is where I obtained the numbers I used in this earlier posting.

At lower current-levels of battery-drain (-13mA), this same app showed the battery as 96% charged, but with a voltage of 4.24V . The app continues to run in the background, when the phone is asleep, and when the phone may be drawing much less current than it does with the display on. Then, after we wake up the phone, this app initially displays with its remembered values, until a few seconds later, the app-data updates.

(Edit 12/14/2016 : In the case of a soldered-in battery, it would make perfect sense if the O/S of the device computed the State Of Charge as a linear function with two fixed voltage end-points, as well as to compensate for the amount of current drawn, as if the battery simply had an assumed series-resistance. This is because a soldered-in battery is not assumed to be changed. However, multi-pronged battery-packs also exist, which possess internal chips. Those could be exchanged easily by the user.)

(Edit 12/12/2016 : Actually, this app does not tell the phone, what the State Of Charge of the battery is – the Percentage Charged.

And so there will be a scattering of relationships, between voltages as measured by the device, and percentages. However, one concept which intrigues me, is that if each battery-pack has 4 prongs, there is no way for me to rule out, that 1 prong could be for discharging, while 1 prong could be for charging.

If that were the case, then the charging circuit would detect that the battery suddenly seems to stop drawing current from its charging terminal, and could then immediately measure the voltage on the discharging terminal.)

The advantage this would offer, instead of setting up an arbitrary communications-protocol between a battery and its device, is a simpler internal chip as well.

But If somebody did that, it would still assume a fixed low-endpoint voltage, corresponding to a Sate Of Charge of 0%. This might as well be the voltage, at which Li-Ion Batteries generally start to produce Li2O , which I think is at 2.5V .

(Edit 12/13/2016 : Actually, the battery of the Samsung Galaxy S6 Phone is soldered in. Therefore, it does not need to be an info-battery, and only has 2 terminals.)

## A Note on Sample-Rate Conversion Filters

One type of (low-pass) filter which I had learned about some time ago, is a Sinc Filter. And by now, I have forgiven the audio industry, for placing the cutoff frequencies of various sinc filters, directly equal to a relevant Nyquist Frequency. Apparently, it does not bother them that a sinc filter will pass the cutoff frequency itself, at an amplitude of 1/2, and that therefore a sampled audio stream can result, with signal energy directly at its Nyquist Frequency.

There are more details about sinc filters to know, that are relevant to the Digital Audio Workstation named ‘QTractor‘, as well as to other DAWs. Apparently, if we want to resample an audio stream from 44.1 kHz to 48 kHz, in theory this corresponds to a “Rational” filter of 147:160, which means that if our Low-Pass Filter is supposed to be a sinc filter, it would need to have 160 * (n) coefficients in order to work ideally.

But, since no audio experts are usually serious about devising such a filter, what they will try next in such a case, is just to oversample the original stream by some reasonable factor, such as by a factor of 4 or 8, then to apply the sinc filter to this sample-rate, and after that to achieve a down-sampling, by just picking samples out, the sample-numbers of which have been rounded down. This is also referred to as an “Arbitrary Sample-Rate Conversion”.

Because 1 oversampled interval then corresponds to only 1/4 or 1/8 the real sampling interval of the source, the artifacts can be reduced in this way. Yet, this use of a sinc filter is known to produce some loss of accuracy, due to the oversampling, which sets a limit in quality.

Now, I have read that a type of filter also exists, which is called a “Farrow Filter”. But personally, I know nothing about Farrow Filters.

As an alternative to cherry-picking samples in rounded-down positions, it is possible to perform a polynomial smoothing of the oversampled stream (after applying a sinc filter if set to the highest quality), and then to ‘pick’ points along the (now continuous) polynomial that correspond to the output sampling rate. This can be simplified into a system of linear equations, where the exponents of the input-stream positions conversely become the constants, multipliers of which reflect the input stream. At some computational penalty, it should be possible to reduce output artifacts greatly.