Blog

  • Generational loss in MP3 re-encoding

    Okay, name this tune:

    madplay / lame – 1000 iterations

    (You’ll have to scroll about half way in before anything starts)

    Didn’t get it? Try this:

    madplay 24-bit / lame – 1000 iterations

    (Again, you’ll have to scroll about half way in before anything starts)

    Missed that one? Okay then, how about:

    lame / lame – 1000 iterations

    (no need to scroll here.)

    Unless you’ve been living under a rock, it’s a clip from Adele‘s Someone Like You. Sure, you can’t make out the words too well in the last one, but at least they don’t sound like some dire paen to Cthulhu, like the first two do.

    All of the above samples are the same source file re-encoded 1000 times. I’d heard that there was some loss to encoding MP3s, but thought that if you kept about the same bitrate, there wouldn’t be too much loss. I wanted to test out my theory, so I took:

    • LAME — a quality mp3 encoder (that can also decode to WAV)
    • madplay — a decent mp3 decoder that uses fixed point for speed
    • a shell script (see below) that encodes an MP3 1000 times, feeding the output of the last run as the input of the next.
    • a sample clip; in this case, ganked from Amazon.com: 21: Adele: Music using Audio Hijack Pro.

    The original sample looks pretty clean; it’s not the highest quality, but it’s clear:

    The first thing that strikes about the multiply-reencoded file is that it’s much longer:

    This is because LAME adds padding to the beginning and end of each song. All this padding adds up over 1000 runs.

    I’d used madplay extensively before, so I knew it worked reliably. First, I tried it using an intermediate sample size of 16 bits (same as the source) and no dithering. Just after 100 runs, Ms Adkins’ plaintive voice becomes hard to understand:
    madplay / lame – 100 iterations

    I’d turned dithering off in the first test, as I thought it would overcome the signal. As the signal was pretty much gone, I didn’t think I had much to lose, so I tried it at madplay’s full capability of 24 bit internal processing. Again, 100 runs was where things started to go really sideways:
    madplay 24-bit / lame – 100 iterations

    LAME can also decode MP3s, and remarkably, the lyrics remained discernable after 1000 interations (so go and see the third sample up top). Sure, it sounds scratchy, but the piano sounds like a piano and not like some underwater harp. LAME is clearly able to recognize its own input, and decode it accordingly. madplay, on the other hand, just treats an MP3 as a generic MP3, hence the over-compression and extra silences.

    So really, if you’re going to re-encode music, it matters more what you use to decode your MP3s. If you can use the same tool for both, all the better.

    (more…)

  • First of the year!

    First of the year!

    Instagram filter used: X-Pro II

    Photo taken at: Tim Hortons

    View in Instagram ⇒

  • All Day Long In Bliss

    Call me a twee-hugger, but I love Trixie’s Big Red Motorbike. They sound like a brother and sister making up silly sweet songs and recording them on a shoebox tape recorder — which is (pretty much) what they were. Siblings Mark and Melanie Litten, along with some occasional help on backing vocals and saxophone, caught the ear of John Peel, and for a while they were the soundtrack of everyone’s anorak life.

    http://www.youtube.com/watch?v=zHNIMCx3R14

    Mark recently scraped together everything of TBRM and so Lobby Lud Records lives again on Bandcamp. There’s not much else out there, except the John Peel Session. This is good.

  • rebooting the handwriting

    My handwriting is atrocious. It’s scrawly, uneven, with malformed letters (r never recovered from Miss MacFarlane’s ligatures, t usually left unstroked) meandering up and down the line. It’s got blotchy, affected borrowings, too: tailed and stroked 1s and 7s in the European style, and a d that was least seen in a partial differential: 𝛿. In short, a style all my own, wanted by none.

    I’d prefer to have my handwriting legible to others, and even by me. I don’t want my notebooks to look like a spider’s hauled its bedraggled carapace out of the inkwell onto the page. Unfortunately, cursive is right out to learn. I can’t read it, in any style. In fact, I find the German Sütterlin to be as logical to learn, as I can’t read that either, but at least it looks badass.

    The style I’m trying is pre-cursive. Yes, it’s meant as a transition from printing to cursive, but I like its simple clean italic lines. I imagine I’ll join it up a deal more when I’m writing quickly. The hardest part for me is sticking to the line and stopping my writing wandering off up the page.

    We’ll see how this goes …

    (and thanks to I want to write right! | Ask MetaFilter for the suggestions.)

  • Awk day of the week function

    Yet another in my series of awk functions no-one but me will ever use:

    function dow(year, month, day) {
    # Modified from C Snippets "calsupp.c" public domain by Ray McVay 
    # http://www8.cs.umu.se/~isak/snippets/calsupp.c
    # returns 0-6 where 0 == sunday
    # tested over 24000 days in range of unix timestamp, 1970-2035
    
        day_of_week = 0;
    
        if (month <= 2) {
            month += 12;
            year--;
        }
        day_of_week = (day + month * 2 + int(((month + 1) * 6) / 10) + year + int(year / 4) - int(year / 100) + int(year / 400) + 2);
        day_of_week = day_of_week % 7;
        return ((day_of_week ? day_of_week : 7) - 1);
    }

    Basically, all this does is calculate a Julian day number, then take its remainder modulo 7. I’d seen an example that parsed the output of ‘cal’. That’s one way of doing it; not necessarily mine.

  • Bear and construction sign

    Bear and construction sign

    Instagram filter used: Nashville

    Photo taken at: EPCOR Tower

    View in Instagram ⇒

  • Here is a nice boundary layer

    Here is a nice boundary layer

    Instagram filter used: Hudson

    Photo taken at: EPCOR Tower

    View in Instagram ⇒

  • Worked All States – by my standards, at least

    So I’ve managed to talk to at least one person in every US state. This is Quite A Big Deal for a new(ish) ham. To be more specific, I’ve done this using one mode – PSK31 – which makes it slightly better nerd-tuned.

    But you’re going to just have to take my word for it now. In order to get a certificate, I have to get the 50-ish responds to log their details either on eQSL or ARRL’s Logbook of the World. And this is a bit more difficult.

    On eQSL, I’m at 49/50. My lone North Dakotan QSO was from someone mobile from out of state, and eQSL doesn’t handle that well. North Dakota is very sparsely populated, and there’s very seldom anyone on the air from there. Every time I look on PSK Reporter, the emptiness of the state glares at me …

    LotW is more of a problem. It says I still have ten more states to go. While it’s a very elegant system, the setup process for LotW is just a bit too complex for most people.

    So here are my maps:

    VA3PID Worked All States
    VA3PID Worked All States: West
    VA3PID Worked All States: Central
    VA3PID Worked All States: East

    I’d like to apologise to Vermont, whose presence is rather noted by its absence from the map. I’m actually surprised that more states ended up with all of their QSOs appearing inside, as:

    • Towns tend to be by rivers, so that’s where you’ll find more hams
    • Rivers often mark state boundaries
    • Ham locations are given as grid squares, which are a few kilometres across
    • Rivers are wiggly, and don’t respect arbitrary boundaries.

    Absent making a blocky, 8-bit like political map, we’ll have to make do with these failings sometimes.

  • best fail whale

    ▄██████████████▄▐█▄▄▄▄█▌
    ██████▌▄▌▄▐▐▌███▌▀▀██▀▀
    ████▄█▌▄▌▄▐▐▌▀███▄▄█▌
    ▄▄▄▄▄██████████████▀

    (nicked from)

  • help help I’m being harassed by the New Democratic Party

    You’d think that Canada’s New Democrats would be a bit more respectful and techno-savvy, but for the life of me, I can’t get them to stop sending me e-mail. I donated last year, but I don’t want to get updates any more.

    I’ve hit the unsubscribe page five times, and received confirmation each time:

    • on Fri, 12 Aug 2011 17:18:04
    • on Fri, 11 Nov 2011 11:57:58
    • on Thu, 26 Jan 2012 08:07:21
    • on Sat, 28 Jan 2012 14:25:09
    • on Sun, 29 Jan 2012 11:35:33

    I’ve now sent something via the contact form. Do I have to fax them, too?

  • i liek this alot

    Back when I was paid to really care about spelling, I made a crude little UK-US spelling equivalency dictionary. Typeset it in LaTeX, too:

    I found the source files last night (including the entire database for the long out-of-print source book, in its own odd little text format) and I’m amazed how little of it I still understand. This is a shame, as I’m about to embark on another little typesetting project of my own …

  • keep it short, keep me sweet

    Most of my radio communications use a text mode called PSK-31. It’s popular and survives a lot of interference, but fast it isn’t. I tested sending 1000 random characters, and it took 5′ 33″. That’s about this speed:

    Because the mode is so slow, I prefer to keep my transmissions and macros short, stopping just shy of Morse’s telegraphically incomprehensible VY FB CPY OM. My heart sinks when I’m in a QSO, and I see the beginning of a huge piece of macro text being fired at me. A one-way long conversation (like the dude who sent the entire wikipedia article about his hometown) isn’t a ragchew, it’s a barrage. If someone started wittering on at you for 15 minutes without a chance for you to say anything, no-one would want to talk to them. So please, check your macros, think before you type, and we’ll have more and more pleasant contacts.

  • S100 things

    I think I like the S100. It’s small, fast, handles well, and has a bunch of goofy features (like lomofy, fisheye, pseudo-tilt-shift, ultravivid). It also has a semi-useful HDR mode, and best of all, a built in GPS for photo-tagging. This does kind of eat batteries, though, so I’ll have to remember to keep it turned off unless I need it.

  • fun trick noisemaker

    I just built my first Atari Punk Console, a simple LM556-based noisemaker beloved of the circuit-bending crowd (and pretty much avoided by everyone else). Jimmie P Rodgers sells a nice board (or kit), and I bought a few boards a while back, and only just built one up now.

    The board’s a nicely finished little thing:

    … and yes, it really only needs three resistors, three capacitors, and the 556, plus the control pots, power, speaker and all-important on/off button. The APC sounds a little like a drunken, flatulent bee banging around in a lager can, so you really want to be able to turn this thing off.

    Jimmie designed this to fit in an Altoids tin, but Catherine had discarded a LUSH Massage Bar Tin which looked just about the right size. The tin is made of butter-soft aluminium, so it’s easy to start holes in it with the awl on my Dutch Army knife. It’s bigger than an Altoids tin, so you don’t have to fight to get things in. Lastly, the LUSH tin is nicely curved, and fits in your hands well.

    Wit the lid closed, it looks like this:

    And the sound? Well …