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.

So we’re on a boat, in the middle of the ocean…

“Welcome to the planet Earth – a place of blue nitrogen skies, oceans of liquid water, cool forests, and soft meadows, a world positively rippling with life. In the cosmic perspective it is, as I have said, poignantly beautiful and rare; but it is also, for the moment, unique. In all our journeying through space and time, it is, so far, the only world on which we know with certainty that the matter of the Cosmos has become alive and aware.” – Carl Sagan, Cosmos, 1981


This past week, I had the pleasure of diving out at San Miguel Island (the farthest-out of the Channel Islands). This was for a project looking at ocean chemistry and biology along the islands, conducted by Lydia Kapsenberg. During the 2-hour boat ride out to the site, out where the mainland exists as a hazy smear on the horizon, I experienced a realization I’ve had many times before:

“Wow, this is a lot of water.”

I’m a graduate student in marine biology. My job is to think about the ocean. What am I doing, having such asinine epiphanies?

The big issue here is that as humans, our cantaloupe-sized brains simply can’t comprehend things on that scale. I can tell you that the ocean is 1.3 billion cubic kilometers, but that doesn’t do you a whole lot of good. It’s very easy to assume the ocean is massive, too large for us to have any real effects. Unfortunately, in reality this “drop in the bucket” theory doesn’t quite hold.With 8.7 billion tons of CO2 released annually from the oceans (Feely et al 2008), and 26% of it absorbed by the oceans (IPCC 2013), one can see how these can add up since the Industrial Revolution.

The oceans are soaking up an incredible amount of our carbon emissions. This CO2 causes the process of ocean acidification, pulling the pH of the oceans down and making it progressively more difficult for calcifying organisms to make and maintain their shells. This is chemistry on a global scale.

When I first heard about this problem, as a biologist I immediately started wondering about the impact of this on the biology. This concern stems from the fact that global climate change is already expected to hit many organisms hard. If ocean acidification is as deleterious as it seems (all signs currently point to “most likely”), this can be an additional stress on organisms and systems already being impacted by rising temperatures, increased pollution, overfishing, etc…

This “multistressor” problems is very hard to parse out. We don’t quite understand the combined effects of two stressors, but depending on the individual stressors it’s very possible that the result will be more than additive. Heck, considering that many organisms are affected differently by these stressors, we don’t even know how most will respond to just ONE of these many stressors.

In short, it’s a jenga tower situation. We don’t know how much we can poke and prod the system until it all collapses.

Next up: How bad OA is, more specifics about ocean acidification impacts on marine animals, and how we study it, and how we hope to keep studying it… and ultimately how some of our lab’s work shows that it’s not ALL doom/gloom; some organisms have shown a capacity to adapt to shifting ocean conditions.


Feely, R. a, Sabine, C. L., Hernandez-Ayon, J. M., Ianson, D., & Hales, B. (2008). Evidence for upwelling of corrosive “acidified” water onto the continental shelf. Science (New York, N.Y.), 320(5882), 1490–2. doi:10.1126/science.1155676


IPCC, 2013: Climate Change 2013: The Physical Science Basis. Contribution of Working Group I to the Fourth Assessment Report of the Intergovernmental Panel on Climate Change [Solomon, S., D. Qin, M. Manning, Z. Chen, M. Marquis, K.B. Averyt, M.Tignor and H.L. Miller (eds.)]. Cambridge University Press, Cambridge, United Kingdom and New York, NY, USA. In review.

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:



Fuji GW670II

My good friend Gayle let me put a roll of film through her Fujifilm GW670II recently. Several quick thoughts about the camera, followed by some photos of the camera (I’ve yet to develop the roll)…

  • 6×7 is a fun format. The dimensions comfort me after shooting 6×6, as I’m more used to the rectangular format. Having only 10 photos to a roll makes me think long and hard about each shot. I usually carried this around with my DSLR on black/white mode, just to see how the photos should be exposed.
  • I feel like under/overexposing black and white is a lot more resilient than messing with color. It adds a bit more to the art form for me, which is very fun. I wish I could be more confident with a meterless camera, but those days are probably far away.
  • It’s amusing to me that they made a fixed lens camera where you can see the lens in a corner of the viewfinder. It’s outside of the framelines, but still… c’mon fuji…
  • This is my first time playing with a rangefinder and it can be surprisingly easy to focus in the right conditions. I may have to consider looking more into it…
And finally, some quick snaps of the camera before returning it to its owner. I’m trying out a new photo gallery plugin, and it seems to be working pretty well. Apologies about the inappropriately shallow depth of field – it was a dark room and I didn’t have a tripod at the moment.