Musical sunbursts

We often wonder what songs would look like. Here’s our take on what Bobby McFerrin’s Don’t Worry Be Happy looks like.


This picture is a spectrogram of the song. It starts at the 12 o’clock position, and moves clockwise, ending at about 4:00 minutes. The intensity of colour indicates the volume at different frequencies – blue for high volume, red for medium, yellow for low and white for zero. The outer radius represents the lower frequencies and the inner radius the higher frequencies.

This sort of picture almost gives you a “fingerprint” of the song, and a feel for the kinds of ups-and-downs. For example, if you look at Bryan Adam’s Everything I Do, you can clearly see the light beginning, the somewhat stronger middle; then a pause before the 3:00 mark, strong again, and then fading out.

Bryan Adams.Everything I Do (I Do It For You).mp3

For your amusement, here are what a few more songs would look like – a mix of Bollywood, old and new.


Visualising securities correlation

If you were wondering how the securities in the world move against each other, the picture below is the answer.


This picture shows the correlation various currencies, indices and commodity prices by linking together three powerful types of visualisations.


The first is a coloured correlation matrix. In this picture, we have three securities: the British Pound (GBP), Gold Price (XAU) and the Dow Jones Index (^DJI). The price of GBP and Gold tend to move slightly together, and have a correlation of 0.36 (36%). So the cell that’s between GBP and XAU is marked with 36. Similarly, the cell that’s between XAU and ^DJI has a –64 because Gold and the Dow Jones index are slightly negatively correlated.

The colour coding is based on the correlation. Red is -1, Green is +1 and Yellow is 0.

securities-correlation-scatterplotThe second is a scatterplot matrix. The cells that mirror the correlations have a series of dots. Each dot represents the price on a particular day.

For example, compare Gold and the Dow Jones. It isn’t a straight-forward negative correlation. In fact, it almost looks like there were two periods: one in which gold was high when the Dow Jones was low, and vice versa. But within those periods, there appears to have been a mild positive correlation.


The third is the hierarchical cluster. The securities is grouped into similar ones based on their correlation. For example, GBP and Silver (XAG) and reasonably close to each other, and form one group. This group is most closely related to the Euro (EUR), and the three of them are closest to the Australian Dollar.

Arranging the securities by the hierarchy makes it easy to spot groups of securities that tend to move together.

For example, in the original visualisation, there appear to be a set of logical blocks


At the centre, four securities – the Pakistani Rupee (PKR), the Sensex (^BSES), the FTSE (^FTSE) and the S&P (^GSPC) – tend to move together, with each other; but move in the opposite direction to the next group of securities – the Singapore Dollar (SGD), the Japanese Yen (JPY), Gold (XAU), the Swiss Franc (CHF) and the Chinese Yuan (CNY).

Similarly, the Swedish Krona, Canadian Dollar, Indian Rupee, Hong Kong Dollar and Mexican Peso form yet another group that moves together, but in the opposite direction from the strong Asian currencies in the block above.

We at Gramener have named this visualisation a clusterplot. It’s a powerful technique when applied to time series of multiple (typically 5 – 50) variables.

Here are some cases you might consider using them:

  • Group your products based on consumer behaviour. Which products tend to sell together? Which ones cannibalise the sale of the other? Is there a way of rationalising the product base to reduce complexity – without losing customers?
  • Group retailers based on sales. Which retailers tend to cannibalise the sales across each other? Which ones complement each other? Where would you need to rationalise to avoid duplication or overlap?
  • Analyse process quality drivers. For example, if temperature, pressure and salinity affect your product quality, what impact will increasing one parameter have on the other?