I hope that my last piece, “Moiré patterns, Nyquist Frequencies, and music cd’s!“, will be the first of many interesting, “stream-of-consciousness”[1] writings I will do in this space. I’m aiming for a worse, in-text version of RadioLab, with some of the whimsical musings brought to you by Randall Munroe’s what-if xckd [2]. That being said, I would like to mention some addendums and corrections I would like to make to my previous post, in hopes that in the next one I’ll know a bit more about what I’m talking about.

  • The term I was “dancing around” in that post was “aliasing“. That more or less should tie everything together. Thanks, Sev!
  • My partner in crime, Greg Klein, insists that square “waves” are not in fact waves, but “waveforms”. To be honest, I’m not 100% sure about this. I believe the argument there is that the square wave(form) is a summation of an infinite number of sine waves. I would contend that this is probably one of the definitiosn of “wave”, brought to you by a variety of different disciplines.
  • I also replaces the asterisks with numbered references. This should let you follow the references (for better or for worse). I hope I did it right… turns out it’s massively confusing to do.

I’ve also started tweeting! Follow that here:


Tweet on,




[1] aka unstructured drivel

[2] Also, let’s face it… socially lubricated in the manner of My Drunk Kitchen. 

Collaborative Projects

  • 2013: co-composed the soundtrack for Asterogue, a postapocalyptic action-roguelike released for free on iOS and Android. Soundtrack won second runner-up in the Sammy Awards (Center for Games and Playable Media, UC Santa Cruz).


  • 2012: co-composed the soundtrack for Puzzle Defenders, a fast-paced puzzle game released for free on the Chrome Web Store. Prototype music for Puzzle Defenders was used in some small games, including Escape from Violence Island.
  • 2011: composed the soundtrack for The Endless Web, a procedurally-generated platformer videogame to be released soon for PC/Mac. I also arranged, performed, and recorded several tracks which can be found here.


I’ve also dabbled in programming and electronics, writing shuttling software for an extended-range custom-made mellotron in construction by Justin Mayer at Bear Creek Recording Studio. The plan is to improve on the J-Tron predecessor by adding more patches and a more sophisticated tape rewind system. I was responsible for the Arduino Uno programming that controls the rewind mechanism, as well as the patch selection.

I also hope to have a project page up for my Max/MSP controller I built off of an Arduino Duemilanove, which can be seen slung in front of the accordion in the photo above.

Moiré patterns, Nyquist Frequencies, and music cd’s!

This site was down for a while due to a bizarre WordPress design flaw, which coincided with a change in servers. This made it fairly difficult to diagnose the problem, but I figured it out and it’s back in its full unbridled glory!   photo   Of the two months I’ve spent at UC Santa Barbara, I’ve spent a good chunk of it writing proposals. This one was for the NSF Graduate Research Fellowship. Instead of boring you with the details of a fellowship writing process, I’d like to point out the moiré pattern I inadvertently captured when I took a photo of a computer screen with a phone camera. I first stumbled upon the concept of a moiré pattern when i saw this beautiful moiré pattern wall clock on the internet about 6-7 years ago. It’s one of those things you keep noticing once you’re cognizant of it… whether it’s from layered screen doors or compressed youtube videos, the effect is caused by similar constraints [1]. However, when photographing a screen like this, the constraints of the moiré are governed by the resolving power of the camera sensor. This is what causes the red, green, and blue stripes – the camera has just the wrong gaps in the sensels (the individual sensors that record each pixel of a digital image) such that the RGB phases in and out of the white it’s all supposed to be. If we had an extremely high-resolution camera, this wouldn’t happen – the effect emerges due to the larger pixels in the low-res image. Interestingly enough, the idea of “sampling error” is one that is pronounced in a lot of different fields. Music files (MP3, etc) are an interesting “goldilocks” scenario. You want enough resolution that the music’s pretty, but small enough files so you can fit more songs onto your iPod. To accomplish this, some very clever people came up with a standard of digitizing music [2].

(wikipedia commons)

The data is converted from an analog (continuous) signal to a digital (discrete) signal using PCM, by means of an Analog Digital Converter (ADC). Since the data can only be stored into a computer as ones and zeroes, the amplitude of the wave is sampled thousands of times a second at a high resolution and these plotted points are recorded in binary. To turn them back into sound, the binary is converted back to amplitudes (DAC!), smoothed out a bit(capacitors!), and sent out to your headphones or speaker amplifiers(…cables!). This is the way music is recorded onto CDs (both .WAV and .AIFF are the same data, just with all the binary in a different order in the file).Well, how do we determine how often we sample the amplitude, and how many bits we allocate to the height? The first question is a lot more interesting, so let’s focus on that…

The answer is presented to us by Swiss mathematician Harry Nyquist in the form of the Nyquist Frequency. Simply put, the highest frequencies that can be encoded as PCM are (0.5  x  sampling frequency). We can set the highest frequencies to the upper range of human hearing – any higher of a sampling frequency would be out of hearing range and therefore unnecessary resolution. The upper range of human hearing is roughly 20kHz, so we must sample at 40kHz. CDs are standardized at 41kHz. There is very little excess resolution – CDs are designed to be (more or less) as precise in audio recreation as we can tell [3].

So how does this sound, and why do we care? Well, in the first photo, you saw the color white being separated out into its component parts (as displayed in RGB colorspace). In music, we hear a similar phenomenon. as you lower the resolution, you start to hear higher, abrasive notes that are amplified out of the music. This is more generally known of as a compression artifact. To hear this equivalent of moiré, I put together a short demo using a clip for a song I am currently writing. I gradually lower the resolution starting at about halfway through. You should start to hear some… distortion, some abrasive robotic crunchiness with odd ringing notes. This is what you DON’T wan’t to have on your music track! (unless you want to, of course, and its actually one of my favorite electronic music effects to use ).


As you can hear, it gets pretty bad near the end. Remember this is only changing the sampling resolution of the x axis, but not the y axis. Changing the resolution of the y axis is far less interesting, and just sounds a bit fuzzier. Just know that every 41,000th of a second, 16 bits of data are played from a CD. We’re not going to bother exploring this further(See [1]).

However, there are ways to offset this effect, to some extent. Turns out that by adding a layer of noise to a music file, we can drown out these patterns(?).[5] This process is called dithering, and can take out compression artifacts in both music and photos. In addition, even more clever people have thought of ways to compress images and audio further – using less memory while retaining resolution. MP3’s and JPGs are both great examples of this, and there are even formats that call themselves lossless (.alac and .flac for music files, .zip can even be thought of one as well!), which let you store the same data as smaller files! Now, as long as the data isn’t Kolmogorov-random, it can by definition be stored losslessly, but these algorithms that have been standardized to certain data types are far superior. Making a .flac version of a music file can compress it far more than a .zip, because the algorithm is designed to find patterns in music and exploit them for compression [6]. If you got this far, congratulations! I hope the above was somewhat coherent, or at least interesting. To tie this all back to my research [5]… part of my lab’s work focuses on doing high-frequency pH samples to understand the finer-scale dynamics of ocean conditions. By sampling every 20 minutes (or 0.0008333 Hz, to keep things consistent), we’re trying to avoid the same kinds of things – compression artifacts. If the compression artifacts are just noise, it’s no big deal, but when they form artificial patterns… it’s a lot more problematic. It’s advisable to be on the safe side and sample as often as possible, because there’s really no way to regain resolution posthoc.




PS I know some of the footnotes got unruly and out of hand. [5] They have been drinking some bourbon.[2]


PPS: addendums and corrections added. 



[1] We normally think of low-res photos as just being “fuzzy”, “unresolved”, “grainy”. However, this is particularly interesting because by imparting a pattern of fuzzy onto a pattern of lines, we get a superimposed pattern. That’s more or less the focus of this whole thing. Wibbly, wobbly, timey wimey… stuff. 

[2] I hope they aren’t too confusing {4].

[3]In reality, this thought process is flawed. Nyquist frequency in the digital domain can only be expressed as a square wave (think 1-0-1-0-1-0…). As you start to get to higher frequencies, you start losing the resolution in a wavelength (since higher frequency = shorter wavelength = fewer samples). I guess the idea is that it really doesn’t matter if you play a square wave or a sine wave at 20.5 kHz… or does it? If you do a Fourier transform of said square wave you’ll find that it’s made up of members of the odd harmonic series in an infinite sequence. Presumably, all of these other than the fundamental would be out of hearing range, but if they didn’t quite line up with the sampling rate, it could very easily cause distortion if you continued converting between analog and digital. But with 8 samples per wavelength at 5 kHz, which is easily getting you into higher normal hearing range, I’d expect a pretty defined difference. Some CDs have been rereleased at higher bit rates and sample rates (24bit, 48kHz compared to 16 bit, 41kHz) [5] This is where my understanding clearly fades out.

[4] I’m also having a fun time doing these footnotes and see why people like David Foster Wallace and Terry Pratchett insist on it [2].

[5] Just roll with it, alright?

[6] There are some audiophiles that consider .aiff far superior to lossless formats, even though the bits are fundamentally the same. I think it’s the same magic that governs gold-plated HDMI cables and velostat hats.

Diving in Big Sur

I haven’t done this in a while, so here goes…

This weekend, I had the distinct privilege to dive at one of the most untouched dive sites in the area – at the mouth of Big Creek in Big Sur.

Big Creek Bridge

Our dive site was at the beach just under the bridge. The coast forms a nice bay where the creek meets the ocean, which meant a relatively calm entry and exit.

Unfortunately, I do not have any underwater photographs or video from this dive. I hope to purchase a GoPro camera soon to take with me diving, but in the meantime, you’ll have to take my word for it that the diving was incredible here. With 25 feet visibility, one could see clearly through the groves of Macrosystis, Pterygophyra, and Nereocystis (giant kelp, stalked kelp, and bull kelp). Another pair of divers ran into a harbor seal that played with their scuba fins. The diversity of fish was remarkable, and I hope to improve on my classification of the various rockfish that reside in northern California.

We spent two nights at the campsite, but were only able to dive for a single morning. We spent a lot of the other time hiking…

Observing the beautiful flora of the area…

forming awesome but somewhat impractical bonfires…

and having a great time overall!


Coming back to school after an amazing outdoor weekend is always tough, but I have to get right back to the grind…

Algae, Friends, Thanksgiving…

…in that order.

I’ve been very busy here working on blending up algae. Unfortunately, the going has been a bit slow because my project is rather dependent on the tides. I can only get certain samples at very low tides, which occur for 1-2 days every 2 weeks. Unfortunately, these are the species that show the largest efflux (yes, what an awesome word) of acidic compounds. Since they’re so low in the intertidal, even when they are exposed they don’t tend to dry out too much. It’s been difficult trying to see a pH drop around them in the field. On top of that, these species aren’t too common here, so it’s hard to find a large patch of them. I don’t know whether this portion of my  experiment will be successful at all, but we’ll see…


Even the more common species of algae can be very hard to work with. For example, two different species, Ulvaria and Ulva, are shown below:

Do you notice the difference? I don’t either. In fact, it’s impossible to tell between these two with the naked eye. Ulva lactuca is two cells thick, whereas Ulvaria obscura is one cell thick. In order to tell for sure, you have to slice off a one cell cross-section of a leaf and look at it under a microscope. I hope to get some microscope pictures while I’m up here, but I haven’t booked the room and don’t know if I have time.

I’ve also recently gotten rather excited by the cool gizmos in the lab. Being a bit of a nerd, I can’t help but appreciate the design of some of these 70’s designs. This machine to the right is a GC, or Gas Chromatograph, and I’ve bizarrely fallen in love with its boxy design. The lights on the front flash green and red, making it resemble a horrible science fiction prop.  Fellow undergraduate intern Jenna is using te GC to look at DMS production in algae.


My friends here decided to do “thanksgiving in July” several weeks ago. We cooked up a turkey, and all made different dishes. Here’s a couple cool pictures from that…












I’m a bit backed up on this blog, so more to come soon!


My summer plans

I’ve been neglecting this blog for a while, so I decided it was about time to start again. I am currently hanging out in Anacortes, Washington at the Shannon Point Marine Center, which is affiliated with Western Washington University. I am conducting research under an NSF/REU grant with one of the few labs on the west coast working on activated defenses of marine algae. More specifically, I am working under the researcher Kathy van Alstyne, observing pH changes in kelp as they undergo environmental stressors.

Several species of algae have been known to activate chemical defenses when dessicated and rehydrated. This cycle is meant to simulate the low tide, and in the lab is quantified as an 80% water mass loss. Dessication is deemed an appropriate stressor for testing these secondary metabolites, and the easiest to conduct in a lab.


Demarestiaa common brown algae, has been found to synthesize sulfuric acid in itsvacuoles. This is released into the surrounding water when Desmarestia is rehydrated. This sulfuric acid may drop the pH of the vacuoles as low as 0.5 pH units! (Pelletreau and Muller-Parker 2002)

Arguable one of the most well-researched, and interesting chemical compounds in algae is DMSP. Dimethylsulfiopropionate (phew!) is a useful osmolyte that can stabilize against slow changes in salinity. Under stress, DMSP lyase cleaves this compound into DMS and acrylic acid. Although DMSP has been shown to attract grazers, acrylic acid deters them, which puts it on the map as a potential activated defense system. (Alstyne et al 2001)

One of the more recently discovered defense systems is the synthesis of dopamine in Ulvaria, a green algae. Dopamine is a common neurotransmitter in many organisms (including humans!) and actively deters feeding by sea urchins in this algae. Dopamine also lowers the pH of the water around it.

As mentioned before, the study of secondary metabolites in temperate algae is not very extensive at this point. Some preliminary research at Dr van Alstyne’s lab suggests that there may be pH drops (a possible sign of activated defenses?) in previously unresearched local species. My job over the summer is to attempt to observe pH drops, ex situ (in the lab) and in situ (in the field). I will be bringing pH probes into algae beds as the tide rises, looking for a drop in pH from the exuded defenses. I will also be rehydrating species of algae in the lab, looking for pH drops not only in the cells but in the water surrounding them.

Pictures to come! hopefully this is a comprehensive introduction to my life here at Shannon Point for the summer.


I went out sunrise shooting with several friends. Got to use his sigma 24-70 f/2.8 and his canon 16-35L… both wonderful lenses. I’m trying my hand at exposure blending. Here’s a teaser: