Archive for Feb, 2005

Testing the Difference
Feb 28, 2005

Three of my courses this quarter don’t have midterms or finals. This is a good thing. I actually feel like I absorb more of the information if there isn’t pressure to memorize and synthesize for a bureaucratic piece of paper.

However, I do have one course that has midterms, and I feel like I struggle most with that particular course. I think my test taking abilities have declined after coming to Stanford graduate school. I never feel like I have adequate time to think on an exam. This time pressure is like a feedback loop to my performance: I usually end up thinking about how I can milk the most points from a problem in the least amount of time. Usually, this technique doesn’t work too well, at least for me.

Sigh.

Synesthesic Compression
Feb 25, 2005

I wanted to try compressing audio with JPEG.

Yes, you heard me right. I want to use an image compression on audio. I was little curious about such a synesthesic compression experience. The question is, how well would JPEG do on audio files?

JPEG is a block based transform. Basically, this means it treats images as an array of blocks of pixels (usually 8×8). It then applies a transform (DCT) to each block, and quantizes the heck out of the high frequency information, thereby reducing the amount information in the coefficient domain. After this, some type of lossless entropy coding (Huffman, usually) is applied to coefficients. And voila, you have a compressed image.

Audio compression is similar, but takes advantage of psychoacoustic models of the ear. It also treats the data in blocks and allocates bits to each transform coefficient based on acoustic masking models and the such.


First, I converted my test WAV file (Handel) into a picture (as seen on the right). I simply chose an arbitrary size and normalized the audio data to fit the image specifications. The audio data here is row major. We see some sinusoidal patterns in the image, as expected.

Then, I applied JPEG compression. Afterwards, I decompressed the JPEG and read back the data into a WAV file. The following are the results as WAV files.

The original can be heard here: original.wav [36 kB].

JPEG Quality Size of JPEG Compression Ratio WAV File
99 16 kB 2.25 out99.wav
95 11 kB 3.27 out95.wav
93 10 kB 3.6 out93.wav
90 8 kB 4.5 out90.wav

The audio degrades horribly for qualities 90 and below. This is probably due to the fact that JPEG is not so careful about blocking the data, and discontinuities are more common near block edges. This is unacceptable for audio coding.

However, we do get some reasonable results at higher quality levels. There is slight degradation at 99 quality level, but not too annoying. Of course, the compression ratios are horrible compared to audio centric compression schemes like MP3 or AC3. Just for a reference, a zipped version of the original is about 22kB. So indeed, we are saving more than just entropy coding.

Disrespectful Bus
Feb 20, 2005

Yesterday we went up to San Francisco again, just for kicks. As usual, it was raining and desperately miserable there (okay, not as miserable as Ithaca, but still miserable).

We had free passes to the Aquarium of the Bay. In short, do not waste your money on it if you’re in SF. It’s just a minimized inferior version of the Monterey Bay Aquarium. All the SF aquarium has is two water tubes you can walk through and some shallow pools where you can touch sharks. This, my friend, is a shame to the gauntlet of exhibits at the MB aquarium. Although I did get to touch a shark; it was a bit like squishy sand paper.

But, I digress. We traveled via Caltrain (first time!) to SF, since we ride free as Stanford students. The problem arose when we wanted to try out a pizza place on the south part of the city. We rode the Muni down to Potrero Hill and got some great pizza. We were a little worried about catching the 10PM Caltrain back to Palo Alto, but were fairly certain we would make it on time since we checked the bus schedule.

The rain was coming down hard now.

I calculated that it would take us at most 30 minutes to get back to the Caltrain, if anything didn’t go wrong. A wrong did it go.

The bus came around the corner, but then stopped short of our stop. Since the stop was the last on the route, we assumed that the driver was simply resting. It wasn’t until 15 minutes later did he start up the bus again. However, as it approached our stop the driver didn’t see us at all, and drove past us. We were horrified.

I didn’t even have words to express what happened. I just stood there, shocked. We ended up walking about half a mile in the rain, shouting profanities at the Muni system. Luckily we still made it to the Caltrain on time.

Prosciutto Sandwich
Feb 18, 2005

feb 014 (Medium)

I had a proscuitto sandwich, which was really flavorful. Maybe a little too flavorful.

Equilibrium Sleep
Feb 17, 2005

Today was one of those mornings where you’re just too comfortable to get out of bed. Not every morning is like that: sometimes I wake up in a weird position or freezing cold. On days like that, I tend to wake up easier, since I wasn’t comfortable in the first place.

But today, my body reached its peak equilibrium comfort temperature. The pillow was at the right angle with my head, and the covers were optimally placed over my body. And yet, my MP3 alarm from my computer was calling.

We’ve been trying to get up earlier, usually around 6:00AM. Yes, I know most of you consider that an ungodly hour, but life can actually be quite productive in the morning (without the usual waffling around late at night).

Why?
Feb 14, 2005

Why did I ever choose to take three project courses?! Now I’m spending 24/7 programming. If it’s not programming in C for my MP3 class, it’s programming in assembly for my DSP class.

Currently, it’s not too fun around here.

Burn
Feb 10, 2005

feb 012

Note to self: Do not place arm on edge of the frying pan when it is hot. Let this be a warning to everyone.

Zucchini Zucchini
Feb 10, 2005

feb 013 (Medium)

Zucchini zucchini
mostly water you are
You are nice and toasty when cooked
but even better when roasted
with garlic and fresh herbs.
Zucchini zucchini
You slice so fine and so smooth.

Eating Big
Feb 9, 2005

Tippy and I have always loved to eat. We usually eat pretty healthful things at home. But when it comes time to dine out, we don’t hold anything back.

The best times were at Worcester, MA, where good Italian restaurants are plentiful. I remember going to one of our favorite spots, and shocked the waitress by consuming huge quantities of food. People usually see us as small Asians who probably can’t eat that much. But when we’re hungry, we’re hungry. That night, I ordered the chicken catchatori. The dish was huge, and I couldn’t help but notice a slight grin from the waitress, who was probably thinking, “Let’s see him try to finish that!”

And finish I did.

On top of it all, we ordered dessert. Needless to say I was quite full for the night.

But is it an honor to actually suprise people with our eating abilities? Is this something to be ashamed of? Or is it something to boast about? Apparently, there are people who make a living out of it, like Sonya Thomas, a puny Korean lady who can pack away 65 hard boiled eggs in 6 minutes, and 11 pounds of cheesecake in 9 minutes. Now that is something to boast about.

Google Maps: Instant is Key
Feb 8, 2005

Google unveiled their new Maps tool. I love it.

Mapquest and Yahoo Maps are quite good tools. I admit to using them very often. In my experience, they’ve been about 90% accurate. When I need to get to an unfamiliar place, you’ll see me whip out my sticky notes and jotting down the Mapquest directions.

But my one big complaint against these two tools is that they’re static. The maps are very good at spotting exact street locations, but if you want to peruse around the area, you have to use their maddingly slow recenter and pan tools. This is because Mapquest and Yahoo aren’t using a dynamic design with their display. It’s all just images.

Google Maps is all about dynamic. You can zoom, pan, and center in an instant. Everything is slick and smooth. The data still loads in chunks of images, but the map is still able to respond to requests and display the incoming images. This feedback makes all the difference. I was able to accurately pan and zoom from a full size view of the US to my neighborhood in Palo Alto in under 10 seconds. Try that with Mapquest.

Of course, Google also leverages its maps with Google Local, which allows you to search and pinpoint local businesses on the map. Directions are stylishly portrayed with markers that show you a local view upon clicking.

With just one glimpse, I’ve already made the switch to Google Maps. My only complaint is their current lack of support for unpopular browsers, like Opera. But I’m sure that will go away as it comes out of beta.