Archive

Archive for January, 2005

The Inqualified Scientist: Digital Music

January 28th, 2005 3 comments

So did you hear the news? By “hear”, of course, I’m referring to the conversion of vibrations in the air or other conducting medium to electrical impulses in your brain. Outside of your ear (an appropriate sensor responsible for the conversion), this sound travels as waves of vibrations.

Imagine one of those humidity and temperature detectors in museums, where a needle records the current temperature on a moving strip of paper. Instead of measuring temperature, our device will measure the vibrations of the air — the needle will draw the movement of the air particles on very fast moving paper.

If I were to play a very pure tone, the paper would show a smooth wave — the needle would move up and down smoothly, faster for higher tones and larger waves for louder tones. If (more likely) I were to belch at the device, the sound wave I produce would look a lot more random and jagged. It would be relatively flat, or gently waving while I inhaled quietly, then a sharp burst with the attack of my belch decaying into a long and regular afterburp.

The shape the needle draws on the paper (often called a wave even if it isn’t smooth and regular like a pure tone) captures the sound I made. This is called a time-domain representation because the moving paper shows the intensity of the sound as time passes.

All I need to do to play back the sound is to build a machine that scrolls through my belch paper and emits vibrations according to the intensity shown by the wave. This is the same principle behind the speaker on a record player, where the sound is stored in jagged grooves on a vinyl disc.

Going back to the device in the museum that stores daily temperature on a strip of paper, imagine that all the museums in the world want to share their results as part of ongoing research into the effects of temperature variation on their oldest works. Given that they are only connected by voice phone lines, how can they share the precise shape of the temperature waves?

A good answer is that they decide what precision is important to their research, then they read the results over the phone party line — at noon, it was 19.5 degrees, at one o’clock it was 19.6 degrees, at two it was 19.8 degrees, etc. The researchers at the other end can write the numbers down and sketch the approximate shape. The more precise the temperature readings (19.821 vs 19.8) and the more frequently they’re read (every minute instead of every hour), the more precise the sketch at the other end. The sketch can never exceed the original in accuracy, but using the same numbers, all of the museums can approximate the original wave sufficiently for their needs.

This is the difference between analog and digital. At one point, all of the data is coverted to numbers.

If someone were to convert my belch wave into numbers, they could get a reasonable accuracy by dividing the intensity (equivalent to the temperature) into 256 different levels, and taking readings 8000 times a second. BRAAP. This is equivalent to telephone quality sound.

A higher quality specification is to divide the height of the wave into 65 thousand levels (16 bits bits) and take readings 44100 times a second. Drop those numbers onto a laser-etchable substrate, and you have an audio CD.

Hooray for audio CDs! They’re a great source of high quality, raw audio data. Let’s do some calculations — 16 bits per sample, 44.1 thousand samples per second and 2 channels (don’t forget that stereo music is delivered to each ear) is about 1,411 thousand bits per second, or kbps (kilobits per second). This is the bitrate.

Note that 74 minutes (4440 seconds) at that rates is about 6.2 billion bits — or about 750 megabytes, which is about the amount of data we expect a standard CD to hold. The difference comes from error correcting codes and filesystem information on a data CD.

There you have it. Are you interested in learning why your MP3 files approach CD quality using one tenth the bitrate?

Categories: Technology Tags:

Get off my back!

January 26th, 2005 4 comments

For crying out loud, I don’t see any of YOU posting your compilation CDs. I’m doing the best I can!

Why can’t we all just get along?

Categories: BlahBlahBlah Tags:

Break and Enter

January 19th, 2005 4 comments

During the day on Monday, someone broke into the apartments on the floor beneath mine. At noon, one of the tenants left to go do his shopping, and another tenant left with her two children for lunch.

About a half hour later, one of them returned to find three apartments with their doors removed. The deadbolts had been cut professionally and quickly, and the apartments had been effectively looted. Another apartment had been forced, but since the deadbolt wasn’t cut, the door was still intact.

The police say it looks like a “professional job”. Which just sucks.

Gned, Muppet and A.K. were visiting this day, and left (some would say ‘fled’) the country that evening. I’m not saying they did it, and I’m not saying they didn’t. They did fold their sheets before leaving, which is way up there on the nice scale, but can you ever really know someone?

I haven’t been locking my deadbolt for weeks now, including the three weeks I was in Canada. Do you think I’m an idiot, or given the circumstances — am I just protecting the door?

I hate burglers.

Categories: BlahBlahBlah Tags:

Your Sidebar, Your Friend

January 18th, 2005 7 comments

Apparently some of the mensch have been wondering how to add delicious content to their blog sidebar. The sidebar is that thing at the side of your blog, where you can put things that you want to be visible on all of your pages.

I’m going to describe how to put your New Years Resolutions into your sidebar. I broke it down into many steps, but it’s really quite simple.

1. Log into blogger. Normally you go straight to “Posting/Create” in order to serve us up some of your fascinating observations on life. This time, however…

2. Click on the Template tag. Hooray! There’s a whole page of Blogger code there, similar to HTML. You can just look at it as unintelligible crap if you like.

3. Copy and past the entire contents of unintelligible crap somewhere safe, such as a text document on your desktop. That way, you can always undo whatever you changed.

4. Back in your browser, open to the Template tag, look for some text similar the following:

<!– Begin #sidebar –>
<!– Sidebar –>
<div id=”sidebar”>

The code following this bit determines what goes in the sidebar.

5. Find something that already exists in your sidebar. For me, it was:

<h2 class=”sidebar-title”>Previous Posts</h2>

Even if you don’t know HTML, you can imagine how this corresponds to the header Previous Posts that is already in your sidebar. Your text may not be the same as mine.

For the HTML-interested, the <h2> tag says to treat the following text as a secondary header and </h2> indicates the end of this text. The class=”XXX” is there to give the web browser hints about the font and colour. Since this is header text, it is automatically given a line to itself.

5. Now here’s one of the best secrets of a software developer: find code that works and copy it. I suggest copy and pasting the text that you found earlier, changing “Previous Posts” to “New Years Resolutions!”.

6. Click on the Preview button. A new window pops up with your changes. Do you see the new header? Hooray for you! But I bet you’d like to see some stuff under the header as well.

7. Back in the template window, put the following text underneath the New Years Resolutions:

<ul><li>Eat more fast food.</li>
<li>Use a daily moisturizer.</li>
<li>Read more books.</li></ul>

Changing the text, of course.

For the HTML-interested, everything between <ul> and </ul> is considered part of an unordered list. The individual items in the list are separated using the <li> tags. Try changing the two ul to ol to get an ORDERED (i.e. numbered) list.

8. Click Preview and verify that everything is in order — I wasn’t too careful to specify exactly where to place these statements. You can figure it out by changing in the Template window and watching the results in Preview.

9. When everything is to your satisfaction, click on the “Save Template Changes” and “Republish”. Everyone wins!

Categories: Technology Tags:

A Thousand Words

January 14th, 2005 6 comments

Hey, suckers — apparently I type thousands of words a minute. When I put up the memorial pictures of Kerri dog, I used an interesting and exciting tool for putting images up on your blog.

The scenario is: I have a photo, and I want to touch it up, rotate it and put it on my blog.

1. Given that I’m a super hero, I have my own domain, so zap — I can photoshop it at home, upload it using FTP to my site and use the <IMG> tag to refer to it.

2. Alternately, I can photoshop it at home, use hello (an image-sharing program that automatically integrate with Blogger) and post it with a single click. Hooray!

The first alternative is probably the most flexible and stable. Unfortunately, it has many complicated steps and requires you to have photo editing software, and know how to use it. It also requires that you have access to a web host to hold your image.

The second alternative is fast, but still requires photo editing software, and it involves having the Hello client installed on your computer. And then the post it generates isn’t entirely to my satisfaction. See the post of me and Glenn for further study.

There’s one more alternative: Flickr. This is a website that stores and organizes all of your photos. Their free service should satisfy your needs, although it limits you to uploading 10 megabytes of photos a month.

3. I log into my free account at Flickr and upload my photo at full size. I use their web interface to rotate it appropriately. I click on the “all sizes” button, which lets me pick a size to publish and even gives me the HTML code to insert into my blog. I do so, and it works SO magically.

What are the hitches? Until you upgrade to a paying account, they will only let you organize your last 100 photos. Your other photos still exist, and you can view the links to them on existing blog entries, but you can’t change them.

What are the other benefits? Well, you can tag your photos with words to make looking for them easier. You can also associate a full description. You can mark your photos as private or public, and you can even publish a photostream, which is like blog syndication, but with your photos.

If you’re looking to share your recent photos with other people, this is a great way to automatically do it.

A neat feature is that they make all the most popular tags available with a neat interface.

Try it for photos on your blog today! It’s simple and fun for the whole family.

Categories: Technology Tags:

Puppy Puppy

January 14th, 2005 No comments

I just got some photos of Kerri dog. I think they say it all.

parkdog2

couch-18

imga0004

img_1692

img_1681

ballhogs

badhair

My condolences to the family.

Categories: BlahBlahBlah Tags:

Kerri Dog (1994-2005)

January 12th, 2005 5 comments

My sister’s beloved dog, Kerri, passed away January 11, 2005 at the advanced age of 11, from an advanced case of cancer on her spleen.

Kerri was a border collie, one of the smartest and affectionate dogs ever. My sister got her as a puppy, with an insane smile and unlimited energy — sometimes appearing to pass directly through the furniture as she raced around the living room. She spent hours chasing tennis balls, although she preferred to ‘herd’ them rather than fetch and retrieve them.

As an adult dog, Kerri was calm and gentle. She was good with children, suffering ear and tail pulling with good humour. She was well-trained and well-behaved, although she never really did get the hang of giving the tennis ball back.

When my sister bought two more dogs (Chloe and Shelby, another border collie and lab), Kerri watched their antics with the dignity of age and wisdom, but wasn’t above occasionally joining in. When things got too heated or rough, she would settle everyone down with her authoritative and proper bark.

I was lucky enough to be there for her last days. She was looking pretty skinny. On one of those days, she had her brilliant smile.

She was a good dog, and will be missed.

Categories: BlahBlahBlah Tags:

Stay or Go

January 11th, 2005 7 comments

I get news that I can stay at my current apartment if I want. The landlord’s daughter has found a better place that she can afford.

So here’s the situation: there’s no way that my next apartment will be as large as my current apartment. Right now, I have two bedrooms and a large living room, which is ideal for guests. My next apartment would likely have a single room, smaller than my current bedroom and a smaller living room. I would have to buy a futon for my next apartment.

I currently have sufficient shelving space for all my worldly goods. I will likely have to find/make/buy storage solutions for my next apartment. French apartments do NOT have closets.

I currently have a washing machine in my apartment. I would have to buy one for the next apartment, or visit the laundromat. Depending on the location, this actually might be an advantage (given access to a dryer).

I would also have to buy plates for when I have guests. And I would have to hand wash my dishes, which may result in dry or chapped hands.

The current apartment is a great price for the size, but I could get a better, smaller place for less. Since I’m losing my apartment subsidy from work, it’s kind of the ideal time to do so. Keep in mind that I pay a metric shitload of rent — and the last (smallish) apartment I looked at was 300€ cheaper a month. I could buy a lot of washers, dishwashers and shelving units at that rate, even in France.

Most importantly, I have psychological issues with my apartment now. It doesn’t feel like home any more, thanks to the capriciousness and invasiveness of the landlords. I don’t really feel the need to punish them by leaving (they’ll never find a tenant as great as I am), but I’d be more comfortable putting this irregular mess behind me. Also, it would be great to have a definite lease.

I hate moving. I hate packing. I like having moved, and getting rid of all the unnecessary crap that barnacles to you after living in the same place too long.

Welcome to my life as a democracy — what should I do, my friends? New life in a new apartment, or what? My current plan is to stay until March or April.

Categories: BlahBlahBlah Tags: