Creating Bandpass Bessel Filter with MATLAB

Bessel filters are incredibly useful in numerical analysis, especially for acoustic-type waveforms. This is because analog Bessel filters are characterized by almost constant group delay over any frequency band, and this means that the shape of waves does not change when passed through such a filter.

Well, MATLAB provides some of the building blocks required to create a bandpass analog filter, but does not actually combine the pieces to make a usable filter function.

I created a function for my own research (sourced from pieces I found elsewhere, but it’s been too long—I don’t remember where I found each piece, sorry!), and can be found at my MATLAB repository, specifically, here.

Here’s the documentation that I included with the function:

besselfilter. Function to implement a bandpass Bessel Filter.

[filtData, b, a] = besselfilter(order,low,high,sampling,data)

Inputs:

    - order:      Number of poles in the filter. Scalar numeric value.
                    Eg.: 4  
    - low:        Lower frequency bound (Hz). Scalar numeric value.
                    Eg.: 50000 (= 50kHz)
    - high:       Upper frequency bound (Hz). Scalar numeric value.
                    Eg.: 1000000 (= 1MHz)
    - sampling:   Sampling frequency (Hz). Scalar numeric value.
                    Eg.: 25000000 (= 25MHz)
    - data:       Input data. Numeric vector.
                    Eg.: data vector of size (n x 1)

Output:

    - filtData:   Output filtered data. Numeric vector. 
                    Eg.: data vector of size (n x 1)
    - b, a:       Transfer function values for the filter. Scalar numeric.

Apple’s Curse

Last Fall, Apple included a fingerprint sensor in its latest iPhone, and called the technology ‘TouchID’. A few days ago, Samsung did the same, including its own fingerprint sensing technology in its latest Galaxy S5 phone.

The blogosphere has been aflutter about one small difference between the two launches: when Apple launched their technology, there was a huge uproar about the implications of using fingerprints as an authentication tool. As everyone has been pointing out, even a US Senator, Al Franken, issued a public email (PDF) addressed to Apple asking for clarifications and explanations regarding the technology and its implications. In contrast, Samsung’s new technology has received no such attention.

Apple: Think Different

Apple: Think Different.

Here are my two cents on the reasons:

First, Samsung’s technology has followed Apple’s by almost half a year. In this time, users have had the chance to use the technology first hand, and have realized that the world has not, in fact, turned on its head. Thus, a similar technology from Samsung, even though its implementation is way more far reaching, has not brought any new questions or paranoia.

Second, and more importantly, Apple is a modern cultural and technological icon. There’s no way around it—anything that Apple does is subject to way more scrutiny than any of its competitors. And this is because—even if subconsciously—we have come to expect greatness, caution and prudence from this company and its products. Hence, for example, the attention to Apple’s Chinese production lines, even though every other technology company uses the same companies, and the attention to Apple’s tax schemes, even though every other company does the same—perfectly legal—thing.

This is how it should be.

Apple has shown itself to be the leader of the pack, the pioneer of modern technology; the company to follow, imitate and plagiarize from. Apple has similarly shown leadership and candor in other matters: when scrutinized about their tax practices, they actually suggested tax reforms; when a bill to solidify employee non-discrimination was on the table, Apple endorsed it, and their CEO Tim Cook personally talked about it. And, oh, even without a law being present, Apple of course already had in-house rules of similar effect, as a matter of principle; it simply would not do for it to be otherwise.

With great power, as they say, comes great responsibility, and this extra scrutiny, the extra attenion and paranoia, is the flip side to their influence and strength—their curse along with their blessing, if you will.

May Apple carry this curse with pride and with distinction, for times to come.



MATLAB repository

I’ve been using MATLAB for quite a few years now, using it both for my own research as well for work at VTTI. Well, I decided to share some of the code that I’ve been writing, which may come in handy to others in the same field. I’ve long appreciated the help I’ve received from the larger MATLAB community, and I thought I should start contributing as well. :)

Here’s the link: https://bitbucket.org/arnabocean/public-matlab/

Update in 2020: Well, my Bitbucket repository was Mercurial based, as you will read below. Bitbucket has since moved away from Mercurial and became Git-only. So I moved to the more popular Git repo: Github. Here’s where the repository resides now: https://github.com/arnabocean/public-matlab

I’ve been using bitbucket as my code repository. I know, GitHub seems to be more popular in the tech and programming community, but by coincidence I happened to learn Mercurial (Hg) first, and Mercurial it has been for me since. Bitbucket supports both Hg and Git, so you may use either based on your preference.

To be sure, these are and will be scripts that I can share, and in some cases may be snippets of code that I think may be useful in implementing certain logic scenarios. They will almost certainly not be pathbreaking new pieces of programming. :) I’ll be glad if you find them useful in any way.


Music: lyrics for Bnaador, from Fossils 4

More music lyrics… but this time with some reservations. There could some errors in the lyrics (this is true for everything else that I write, of course, but more so for this one). That being said, I’m quite certain the vast majority of the lines are accurate. Please let me know if you find errors, though. :)

This is Bnaador, from Fossils 4.

As always, you can listen to the album on Saavn or Dhingana.

Song: Bnaador
Album: Fossils 4

bolte chaina, bolte chaina ashole
bhabte chaina ki hoto ki hole
khelte chaina, chharte chaichhi e-khela
badore merechhe thhela!

Oore baba re!

below-the-belt but oh-so-natural blame-e
Kishkindha policy’r porechi preme
sensitive tok norom, mone jhamela
sojore kheyechi thhela

laal bador, neel bador
bol na bhara koto tor
tor thhomoke chomoke
laage komorer jor

jaani roji laage taan
ke tepe romosh koti
kon kothi te naache tor
makaan kapda aur-roti

uunki mere dekhun go
key-hole-e ki hota hai
kar dugdugi te neche
kar paposhe sota hai
morkot nijer morji te naki boro bador has
thik kar ushkani te tor e-itna bara lyaj

bhul porishonkhan er
nei oitihashik daye
myth ullashe hashe
tai mithye jitte chaye

mukh bhengchabar sujog
tai juuge juuge tor
nitiheen er adore
tui hoyechish bador

uff ki jaala hayere kala jacchole
poro drobbo khamchiyo-na, na bole
sohobote sudha brithaye apatre dhala
badore chhireche kola

bador nachte koto nish?
payment cash-e na cheque-e?
bador kar jonno nachish?
supari nish ki dekhe?

bador pay korbo kaake–
toke na tor dalaal ke?
bachaal badraami ke daye
bureaucratic samal je?

jaat-chor, laath-khor
bandro-laal, bandro-neel
rock’n’roll, jack’n’jill
rondhro koto ta pichhil

kon khape dhyamon size,
kon paaper kemon prize,
kemon lagche limelight
dear monkey worldly-wise

laal bador koto jacche bajar-dor?
shithil tholthole sarir
sfito ghush kheko udar
jollader ki ahlade
bajar choshe tor o-ti
chushe chhibre kore daye
somman kapda aur-roti

uunki mere dekhun go
key-hole-e ki hota hai
kar dugdugi te neche
kar paposhe sota hai
morkot nijer morji te naki boro bador has
thik kon chulkani te tor e-itna bara lyaj

e-itna bara lyaj!

laal bador, bador neel
bandro laal, bandro neel
rock’n’roll, jack’n’jill
rondhro koto ta pichhil

baal bador, bador neel
bandro baal, bandro neel
rock’n’roll, jack’n’jill
rondhro koto ta pichhil