*City Rhythm* amplifies the rhythm metaphor by mapping *beats*, *base rhythms* and *street rhythms *across 6 cities in The Netherlands.

I think by “beats” the authors mean the dominant rhythms of a region, exemplified by the ebb and flow of the volume of road traffic. Base and street rhythms “show significant transitions over time for the specific area” (iii). I’m most interested in the authors’ claim that this kind of analysis can bring out similarities and differences between regions.

According to the book, rhythms influence how people feel in each other’s company: “When sharing rhythm, people feel more at ease with each other.” [3] Rhythms engender trust: “When recognizing each other, people synchronize and tune their rhythm to each other” (4).

The rhythm concept helps explain the mismatch between citizens and the systems of the city, in particular the road system.

“The roads are too wide and busy, and the traffic lights are too short to cross the streets. This situation is reflected on the mismatch in the rhythms between the elderly and the rather fast rhythms that the neighbourhood presents.” [44]

Such rhythmanalysis helps explain conflicts between city inhabitants, as in the case of the insecurities felt by some older people when in proximity to exuberant youths. One image in the book shows a series of frequency curves, nearly cosine curves, of the intensities of different activities across a typical week in the Keizerswaard shopping centre. The caption reads

“Rotterdam Image 5: Diagram showing the comparison of different rhythms [in] Keizerswaard, which is achieved through bringing together the rhythms of a fictional elderly persona (yellow), rhythms of a young fictional persona (red) and rhythms of the shopping centre (green).” (47)

Echoing some of the ideas I explored in *The Tuning of Place*, and drawing on Deleuze, they show how: “A territory happens when different rhythms come together and they create their own expressive language” (74).

I’m interested that the researchers were able to map the presence of different rhythms across city regions on grids of 500×500 metre cells. That reminds me of some of the 2D techniques for exploring the gross frequencies of parameters that vary across a surface, e.g. in Discrete Cosine Transform (DCT) analysis, though they adopt different numerical techniques, notably a Mixed Hidden Markov Model (iii).

The term “hidden” is alluring to anyone interested in the hidden dimensions of city living, en route to the cryptographic city.

- Coyne, Richard. 2010.
*The Tuning of Place: Sociable Spaces and Pervasive Digital Media*. Cambridge, MA: MIT Press - Nevejan, Caroline, Pinar Sefkatli, and Scott Cunningham. 2018.
*City Rhythm*. Delft: TU https://oro-oro.s3.amazonaws.com/other-files/Rhythm%20book%2016.04v2.pdf

]]>

I’ve been doing this for 10 years now. So it’s time to reflect.

Video blogs (vlogs) and audio podcasts have taken over from text-based academic blogs in many cases. Where blogs are popular, a plethora of genres compete for attention, delivering popular interest, and providing political, newsy and promotional content.

Most online advice now about blog writing focusses on maximising the number of visits to the site, how to gain revenue through advertising delivered via the blog platform, how to grow product sales, and how to keep in touch with potential customers.

Contrary to that approach, my site and many others operate within an academic model unencumbered by the need to maximize hits or sell product, though a blog does serve as a means of disseminating research and promoting research outputs.

For me, the main value of this blog is to keep up the regular practice of research writing and in manageable theme-based chunks. All content is indexed automatically which overcomes the difficulty of recalling every thought — from an archive of over 523 short essays, each averaging about 700 words.

Blogging provides a way of searching and recalling my own thought space. URL links to individual posts also provide a shorthand means of communicating with students. Blog posts refer to academic and popular literature sources. They also provides a medium for experimentation with video, audio and graphic content.

This blog is a public archive of my research findings and reflections drawn from philosophy, cultural theory and popular literature. I’ve tried to develop and trial new understandings of current affairs, architecture and digital technology.

Generating regular blog content has helped me develop material for 3 books since 2010, and provided a channel to revisit, review and update the content of previous publications. My recent books also refer to individual blog posts providing the reader with more detailed explanation and access to experiments.

The last few blogs have helped me develop ideas about cryptography and the city, and to experiment as I learn new techniques for processing information, and to keep intellectually alert during periods of government mandated social isolation.

See posts: Academic writing and publishing online; Written any good books lately?; Developing a publication strategy in the internet age; A word in your ear: Podcasting for introverts.

]]>WordPress provides helpful visitor statistics that indicate topics that have most attracted readers — or that people are most likely to stumble across. My most viewed post by far is called “Structuralism in architecture: not a style but a tool for critique,” followed by “What’s wrong with parametricism,” “Why cartoons have animals,” and “The opposite of architecture.”

To further test the DCT (discrete cosine transform) method as a kind of rhythmanalysis I thought I would run some of the WordPress stats through a DCT process, to see if visits to particular posts follow significant cycles. I analysed the monthly visitor frequency figures for “Structuralism in architecture: not a style but a tool for critique” for the period Jan 2018 to May 2020, i.e. 29 months.

Looking at the visitor frequency chart provided by WordPress, the data does look cyclical, perhaps under the influence of university and college assignment submission dates in different institutions in different parts of the world. I’m not going to prove that is the case — just that cycles are present, or at least that the data can be filtered through a cyclical model.

I also wanted to see how sensitive the DCT method is to shifts in the start of the temporal data sequence, whatever the source of data. In the DCT method, the data sequence is matched against a standard set of cosine curves of different frequencies (the “basis function” curves) to produce similarity coefficients. As shown in a previous post (DCT), these standard constituent curves are generated to be symmetrical about the midpoint of the data sequence.

Does this bias towards the centre give different results if the data sequence is shifted right or left by one or more data points?

Here’s the original blog visitor data as a smoothed curve (in blue) and moved down to the 0 axis (which is the axis along which cosine curves move). I ran the data through the DCT method as described in COVID-19 Rhythmanalysis to produce a series of coefficients. The coefficients were then run through the reverse DCT process to reconstruct the original data curve. That’s the red curve below, which looks to me like a reasonable approximation of the blue curve. That verifies to me that the DCT method works. I could translate a sequence of data points to a series of coefficients indexed to some standard cosine curves and back again to recreate the original data.

Of greater interest however is the set of constituent cosine curves and their amplitudes as identified by the procedure and that capture the cyclical nature of the data.

In this exercise the procedure revealed some high frequency cosine data that was hard to graph due to the limits of the Excel curve smoothing algorithm. I treated that as random noise and filtered it out. I also filtered out low frequency curves. They may hint of longer term cycles beyond the 29 months, but I wanted to keep the graphs simple. Here are the cosine curves that most strongly match the data when combined.

They average out to the following gross approximation of the original data curve:

Do these curves look substantially different if I start the data sequence a month earlier? Here are the same graphs for data across 29 months, but including data from one month earlier. That’s a phase shift of one month, i.e. a single data point.

These average out to something a bit different than the previous gross average graph.

Here’s the same data sequence starting two months earlier instead of one month.

It seems to me that the DTC method, at least as I have implemented it, is not particularly sensitive to slight differences in where you start measuring the data in a time sequence. That’s the case at least without filtering.

The differences between the gross average graphs (the smooth curves in red) could be due to (i) the high and low points in the original data being out of step with the basis functions to differing degrees, and (ii) the bias (tendency) in the method towards reflective symmetry in a data sequence.

I won’t take this any further here. There’s a lot of human intervention in selecting and filtering curve data. That could presumably be automated with some “if … then” rules. There are other methods, including the more general Discrete Fourier Transform (DFT) approach, and more statistical approaches for detecting cycles, periods, and rhythms in data. E.g. Satinder Gill alerted me recently to an interesting online book called City Rhythms that I’ll look into.

- Nevejan, Caroline, Pinar Sefkatli, and Scott Cunningham. 2018.
*City Rhythm*. Delft: TU http://www.nevejan.org/caroline-nevejan/2018/4/17/city-rhythm-logbook-of-an-exploration

He contrasts rhythm with *repetition*. Repetition is a “linear,” mechanical phenomenon best represented by the incessant movement of clock time. For Lefebvre, daily life involves the interaction between rhythm and linearity. See my post: Tide and tide wait for no one.

Lefebvre’s book *Rhythmanalysis* contains no reference to cosine waves or Discrete Cosine Transforms (DCTs) (see last few posts on DCT). However, some researchers have attempted to extract regular rhythmical cycles from everyday events to explore the interaction between rhythm and repetition. Interesting research by He and Agu analyses data about a person’s patterns of movement as detected by motion sensors (accelerometers) in smartphones or fitbits. They break the one-dimensional activity pattern signal into constituent regular cosine curves and correlate these with data about daily events. Their research was to detect and predict when people are likely to be inactive in front of a television or otherwise miss out on healthier pursuits.

If we need any reminding, here are some rhythms in daily life: periods rest and activity, of being sleep and awake; daily and weekly routines of eating, ablution, grooming, work, leisure and chores; the so-called media news cycles; collections and deliveries; income and debits on our accounts; festivals and holidays; the school and academic cycles; religious calendars; gig work patterns. In many cases, apparently random perturbations in any of these cycles may be due to interactions between them, and from interacting with external agents (other people, systems, processes, devices).

As I’m investigating the cryptographic aspects of city living I’m interested in what everyday rhythms conceal, and how rhythms feature in evasion and deception. The analyses in my last two posts assume that seemingly random sequences of events can be decomposed into a series of overlapping rhythms of different frequencies. I’ll refer to *cycles* here rather than *rhythms*, as *cycles* suit better the idea of regular constituent patterns of repetition.

Some cycles may go unnoticed as they appear as variations in a conspicuously regular pattern. We are aware of seasons and regular variations in the length of the days throughout the year, but the earth’s rotational axis also drifts slightly according to a much lower frequency cycle. In a more human context, a supplier sends deliveries every month, but falls behind and catches up according to slower cycle that is under the influence of the seasons, absenteeism, traffic, etc.

High frequency cycles of low intensity may also go undetected or ignored. I think of this phenomenon as analogous to the JPEG compression method described in the previous posts. We are less sensitive to small scale but rapid perturbations in colour value across a pixel image. In a different domain, the rate at which a dancer blinks is all but concealed by the overwhelming intensity of the rhythmical movement of limbs and torso. Experts in “body language” identify and study tremors and “hidden cycles” in human behaviour. Under this rhythm-analytic model, the conspicuously everyday, the quotidian, conceals certain activities and influences.

In some cases a cycle may be offset so that its maximum and minimum are reversed: night becomes day and day becomes night (a 12 hour phase shift). Such phase shifting provides a common method of hiding activities and detecting others. Presumably its safer to break into an office when there’s no one there. I think of the “stake out” when police, or criminals, observe some location around the clock to detect or evade the target’s cycles of activity. Geoff Manaugh’s book on burglary is helpful in this respect. Digital systems introduce other opportunities for revealing, concealing and exploiting “hidden cycles.”

- He, Q., and E. O. Agu. 2017. A rhythm analysis-based model to predict sedentary behaviors.
*International Conference on Connected Health: Applications, Systems and Engineering Technologies (CHASE)*383-391. Philadelphia, PA: IEEE/ACM. - Henri Lefebvre,
*Rhythmanalysis: Space, Time and Everyday Life*(London: Continuum, 2004), 79. - Manaugh, Geoff. 2016.
*A Burglar’s Guide to the City*. New York, NY: Farrar, Straus and Giroux (Macmillan)

I’ve implemented the DCT method on an Excel spreadsheet. The image below is an 8×8 grid of pixel values, in grey ranging from 0 = black to 255 = white. You could think of this as a small fragment of a much larger image. The shades of grey in this demonstration are generated automatically by a formatting feature in Excel. I’ll call this the “target image” as I want to see if I can transform it to a series of coefficients using the the DCT method, which I can then transform back to this image.

The values on the grid squares could also be elevation information on a block of land, or any other mapped digital data. Researchers have used DCT to identify features of a landscape, to classify digital models, and in automated image recognition.

I used DCT to calculate how much of each of a set of 64 grey patterns is present in the target image. These 64 “basis arrays” are grey-scale patterns generated by a cosine formula at successively increasing frequencies from left to right and top to bottom. So the patchwork squares show possible gradations or undulations of 8×8 pixel arrangements. This is analogous to the one-dimensional pixel arrangement I showed in the previous post.

I generated this array of arrays for each cell in Excel where the formulas in the cells look looking something like this

=COS((2***$A16**+1)*PI()***$K$16**/16)*COS((2***$B$15**+1)*PI()***$M$15**/16)

The elements in bold are variables. **$K$16** and**$M$15 **are the frequencies of undulations in the horizontal and vertical directions in an 8×8 image; **$A16 **and **$B$15** are the coordinates of each pixel in the image.

DCT experts call the 64 patterned squares “basis functions.” The 8 columns and 8 rows of this basis function matrix are labelled 0-7. The values in the pixels range from -1 to +1 and the spreadsheet calculates these to several decimal places. I multiplied these by 10 in this diagram so the range is -10 to +10 and I rounded out the decimal places. That way the values could fit into the crowded cells of the spreadsheet.

The DCT procedure generates an array of multiplication factors (coefficients) that indicate the strength of each basis function in the target image. I calculated the coefficients by multiplying each of the basis function array pixel values by the corresponding value in the target array. The coefficient for each of the basis arrays is simply the sum (or average) of all those new values for each basis array.

Here’s what the basis arrays look like as a result of these multiplications. Too small to see on this screen shot, the coefficient values are written next to each basis function matrix.

Here are the coefficients on a table. So the target 8×8 array of pixels is converted to an 8×8 array of coefficients, one for each basis function.

These are not grey scale values, but show the strength of each of the basis functions in the target 8×8 image.

From those 64 coefficients it should be possible to reconstruct an image close to the target image. As long as the algorithm for reconstructing the target image has access to the basis functions.

To test that I could reconstruct the target image I multiplied each of the coefficients by the values in the basis functions. That produced the following modifications to the arrays of the basis functions.

Overlaying each of these 64 ghostly images should then reconstruct the target. That is accomplished by adding the pixel values for each of these adjusted basis functions. The more pronounced the basis array, the stronger its contribution to the target image. Negative coefficients invert the effect of a basis array. Grey arrays have less effect on the reconstruction of the target image.

Sure enough, the process does re-generate a shaded image very close to the target. For simplicity, I’ve left out the constants that bring the values back to positive numbers within the 0-255 colour space, but the relationships are correct. The Excel shading function generates the white to black grey range automatically, taking the lowest number as black and the highest number as white.

Of note, here the higher frequency basis functions make little contribution to the reconstruction process as the values are so low. In the next calculation I’ve eliminated the effect of the 28 coefficients in the higher frequency part (lower left) of the coefficient array by reducing them to zero.

That’s the major part of the data compression process used in JPEG compression. The JPEG algorithm strings together all these coefficients for each 8×8 parcel of the original image. It does this in a diagonal manner starting at the top left corner of each 8×8 array. That produces a series of trailing zeros, and each list of 64 coefficients can be compressed using run length encoding, i.e. if there are 28 zeros in a row then indicate that in the file as 28 zeros rather than list all the zeros.

I thought that DCT is a roundabout way of freeing up space in the file that contains the target image for other, hidden information, but a steganalysis algorithm (for detecting hidden content) would notice noise in the compressed JPEG file. Any data in the lower right sectors of the coefficient table would also get washed away by adjustments to the JPEG compression parameters.

According to a helpful online slide presentation by Ryan Gibson, the usual method of hiding information in the coefficients is to insert data in the least significant bits (LSBs) of the coefficients. It would leave any 0s or 1s untouched. Presumably the coefficients of another, hidden image could be concealed in that way. There are many articles on improved steganography using DCT, and a plethora of methods.

- Gibson, Ryan. 2015. Steganography: Hiding Data In Plain Sight
*Department of Computer Science, College of Arts and Sciences, The University of North Carolina at Chapel Hill*. Available online: http://www.cs.unc.edu/~lin/COMP089H/LEC/steganography.pdf (accessed 18 August 2020).

Data that looks random often harbours regular patterns. As an example I examined the online data for COVID-19 cases picked up by testing in Scotland over the past 29 days. The data is available in spreadsheet format at https://www.gov.scot/publications/coronavirus-covid-19-trends-in-daily-data/ and looks like this

18 7 19 6 3 5 11 17 21 23 7 22 10 16 20 27 4 3 4 22 17 30 18 31 18 23 64 66 43

That’s the number of people shown up by tests each day. Here I graphed the numbers over the 29 days using the chart function on a spreadsheet.

It already looks as though there are cycles in play. Here’s the same data plotted as a smooth wavy line. I’ve moved the plot so that the midpoint between the maximum and minimum values lies on the horizontal axis. Oscillating graphs usually move about an axis. So this translation helps the calculation.

The objective of this exercise is to find a series of cosine curves that average out to produce the same wavy line as the one above. Cosine curves are always uniform, and repeat in a regular manner. The wavy line above connecting the data points isn’t a cosine curve.

My previous post was about image compression and demonstrated the DCT (Discrete Cosine Transform) method with a line of up just 8 grey-scale pixels. The method derived the proportions of each of a sequence of standard cosine curves. In the 8-pixel exercise there were 8 candidate cosine curves. The more cosine curves the more likely you are to capture all the bumps and dips of the original data curve.

I extended the spreadsheet algorithm I used in my last post from 8 to 29 data points, and from 8 to 29 candidate cosine curves. The candidate cosine curves range from 0 to 15 cycles across the 29-day time span. Just so you know, those standard 29 unweighted cosine curves look something like this when placed on top of one another.

Excel’s graph algorithms don’t use cosine smoothing, so the higher frequencies look a bit ragged in this chart. Here’s the spreadsheet showing the calculations using the DCT formula shown in my previous post. The result of this calculation is the column of coefficients second on the left showing the contribution of each frequency curve to the initial wavy line connecting the data points. The second row of the table heads each of the 1-29 days. To remind myself that this is real data, I coloured the days that fell on a Sunday in grey.

When those coefficients are run through an inverse DCT algorithm the spreadsheet recomputes a plausible approximation of the original curvy line.

That visualisation provides a good way of testing that the method of deriving the coefficients is working. To keep the calculation simple, I’ve left out various translation factors that would restore the original range of numbers in the data and that would move the new curve relative to the horizontal axis. Those factors are less important, as I really want to identify the most important cycles within the original data. The chart showing the contribution of each of the 29 cosine curves is a glorious mess, especially considering the limits of the spreadsheet chart smoothing algorithm. The black wavy line is the average of all those curves.

To extract anything useful from this tangle it’s necessary to filter out those cosine curves that make little contribution to the final curvy line. I set up an adjustable filter mechanism on the spreadsheet so that I could eliminate cosine curves that fell below a certain coefficient value. By trial and error I found that eliminating cosine curves with a coefficient less than 50 (plus or minus) gave the following simplified pattern.

The contributing cosine curves (unweighted) are as follows.

So a data analyst might decide from this data manipulation that there was a drop in cases in the middle section of the month; the rises in data follow a regular cycle (perhaps weekly), and there’s a general increase over that period. Lowering the coefficient threshold to 40 revealed two more cycles.

This filtering process is analogous to what happens when DCT is used to filter out the high frequency components of a data sequence. I started to to carry out the same DCT analysis for a period longer than 29 days, but that required sampling the data every second day, or adding more coefficient calculations and the process started to get out of hand.

It’s even more interesting to speculate on what contributes to the various bumps on the graph. It’s possible that parts of the data are random, or noisy due to the reporting mechanism or the nature of the phenomenon being recorded. Singular events may also defy any fit with a regular pattern.

Cyclical models are helpful however. You can think of singular, non-recurring events as occurring at an extremely low frequency over years, decades and centuries. Here are some possible contributors to the cycles.

- Organisational: testing and reporting on a weekly cycle; availability of testing: supply and delivery patterns, lab availability
- Human behavioural: effects of news cycles, public information campaigns, lockdowns, openings and other adjustments to human practices affecting people’s ability to present for a test or their susceptibility to the disease, including cyclical changes in diets, medication, drugs, holidays and travel.
- The overall upward trajectory probably indicates an increase in infections, as per the rate of transmission, i.e. the R number.
- Biological: alterations in the virus, waves of resistance, immunity, other diseases, other environmental responses of the organisms/virions, or the introduction of new vectors for transmission. I would expect that to require more than 29 days to show up.
- External: weather, tides, seasons, sun activity, etc. There are cycles here, but are they likely to show up?

I am just using the COVID data as an example to illustrate the DCT method of analysing urban data. I can’t claim any validity in the processing or outputs in social medical or epidemiological terms. I could have conducted this demonstration with the FTSE 100 index, or any other data that exhibits cyclical trends.

- Ahmed, Nasir, T. Natarajan, and K. R. Rao. 1974. Discrete Cosine Transform.
*IEEE Transactions on Computers*, (C-23)90–93. - Lefebvre, Henri. 2004.
*Rhythmanalysis: Space, Time and Everyday Life*. Trans. Stuart Elden, and Gerald Moore. London: Continuum

Notes

- The DCT method derives a coefficient value for any particular frequency by calculating the expected or idealised cosine value at that particular point on the horizontal axis (time in this case) multiplied by the actual data value. The results of these multiplications are then added together to give the coefficient for that cosine frequency. A higher value (plus or minus) coefficient indicates which frequencies contribute more to the original data sequence.
- If the numbers of cases are sampled, (e.g. once a week but not averaged) then the CDT method could be used to predict (i.e. interpolate the missing values). Prediction (i.e. extrapolation)
*beyond*the range (in this case 29 days) is much less reliable as the method assumes the data values will oscillate, i.e. exhibit*periodicity*. Extrapolating the cosine curves above would miss out on growth in the data values beyond the range of the horizontal axis. For that kind of prediction, something like the exponential curve generated from a rate of infection would be more useful. See post Living with virions [and R0]. - Google searches foreground DCT as a filtering mechanism for image compression, but the original paper by Ahmed et al presents it as a means to recognising patterns in data: “the DCT can be used in the area of image processing for the purposes of feature selection in pattern recognition; and scalar-type Wiener filtering” (93)
- I tested my proposition above that the more cosine curves of increasing frequency you test against the original data, the more likely you are to capture all the bumps and dips of the original data curve. I tried this and it seemed not to add greater accuracy. The method seems to work best across a set of relatively smooth data, as seen across 8 pixels on a digital photo image. Hence, the applicability of DCT to image compression.

Here is a random row of 8 adjacent pixels taken from a much larger grey scale picture. A value of 0 is black, 255 is white, with numbers between indicating shades of grey. Beneath that is a graph showing these values plotted and joined by a curve. The darker pixels are presented as a dip in the graph. The higher part of the graph corresponds to the brighter pixels.

When averaged, wavy lines produce other wavy lines. The line above looks in part a bit like a regular cosine curve, but not quite. Cosine curves repeat as a regular up and down curve with the high and low parts of the curve repeating at regular intervals.

My curve can in fact be reconstructed from a set of cosine curves of varying frequencies across the span of pixels, e.g. zero cycles across 8 pixels; half a cycle across 8 pixels; a full cycle across 8 pixels, etc increasing in units of half a cycle. Our original blue curve above can be redrawn as the weighted average of a series of cosine curves. Those cosine curves have amplitudes (values on the vertical axis) represented by the formula

where ** x** is the value on the horizontal axis, and

Here are some curves generated by this method. I’ve shifted and multiplied the amplitude to correspond to the 0-255 grey-scale range to bring the process into 8-bit pixel space. To keep the formula simple, I’ve not shown that adjustment in the formula. Here are the values for the curves plotted as a graph.

I’ve only shown 7 frequency curves. An* i* of 0 gives a horizontal straight line at 255. I left that out so I could enjoy the symmetry of the curves.

Here are the grey-scale equivalents across 8 horizontal increments. The rows have 8 values sitting on the curves of each of the frequencies. They have grey-scale values 0-255.

Here are all the curves again, this time with the *i*=0 value drawn in and the average of all the curves drawn as a dashed black line.

Adjusting the amplitudes of the constituent waves results in a very close approximation of any wavy (sinusoidal) line. Each constituent curve can be multiplied by a coefficient (positive or negative) to construct a new curve.

Here I have plotted how each of the constituent waves would have to be adjusted, so that when averaged, they produce the original curve. If you are interested, the coefficients that I used to multiply each of the constituent curves are 2.0380, -1.1004, -0.3748, 2.7690, 2.5144, 0.2742, -0.0724, and 0.0031.

In preparing this example I worked backwards from the standard curves and made up some coefficients to produce the series of 8 pixel values that I claimed above as my starting point. It turns out that the algorithm that derives the multiplication coefficients for those standard constituent cosine curves is similar to the cos formula shown above. The formulas for deriving the coefficients and for reconstructing the original curve are known as the Discrete Cosine Transformation (DCT) function and the inverse DCT function.

In this example, a series of 8 pixel values is converted to 8 coefficient values, which in turn can be converted back to the original pixel values, as long as there’s an algorithm that takes into consideration those 8 standard frequency curves.

One advantage of breaking a wavy line into discrete cosine constituents is that it effectively teases out high and low frequency components. The human visual system is not so adept at picking up the high frequency components in an image, i.e. we are not good at noticing small differences in the luminance values between adjacent pixels or within small clusters of pixels. So a compression algorithm can generally discard the high frequency component of an image. The JPEG image compression algorithm does this and on a varying scale that can be adjusted by the user of the imaging software.

Here I show what happens to the curve if we set the coefficients of the 3 highest frequency curves to 0. They were low anyway in this case. But their removal doesn’t appreciably affect the shape of the curve, and hence the values along the row of 8 pixels with which I began.

Nor do the coefficients need to be to four decimal places. So the 8 pixels that I started with could be stored as a series of coefficients: 2.04, -1.10, -0.37, 2.77, 2.51, 0, 0, and 0.

I’ve only shown the application of the DCT technique in one dimension. An image is a 2-dimensional array of pixels. Here’s the standard 2D grey-scale chart used by graphics and signal processing experts to explain the cosine space. This is sourced from: By Devcore – Own work, Public Domain, https://commons.wikimedia.org/w/index.php?curid=10414002

My 8×8 grey scale matrix above corresponds to the values in the first row of this diagram, though I had arranged the spectra vertically instead of horizontally.

Another way of looking at the DCT algorithm in 2D is to imagine that any 8×8 pix array from a digital image could be represented as combinations of some of these 8×8 frequency spectra laid on top of each other, i.e. combined by weighted averaging. There’s a nice video of Mike Pound explaining this process. See the bibliography section below.

There are a lot of “8 by 8″s in these attempts to explain DCT functions. I have to keep reminding myself that the coefficients don’t correspond to pixels, but to the amplitudes of a standard set of cosine curves that go to make up the values on an 8×8 array of pixels.

As I’m interested in steganography, a further advantage of the DCT compression of images is that information can be concealed in the coefficients, especially around the 0 coefficients, i.e. the high frequency components of an image, with relatively little deterioration in image quality.

This is my understanding of DCTs at present, and I’m happy to be corrected on details. I’m also conducting this exploration with standard functions on an Excel spreadsheet, and without resorting to routines in Visual Basic. I was keen to see the cosine curves, and so I used a pixel image array of more than 8 pixels to generate the curves using the Excel chart feature. Visualisations of DCT calculations are usually much more “chunky.”

- Anon. 2019. Testing different image hash functions.
*The Content Blockchain Project*. Available online: https://content-blockchain.org/research/testing-different-image-hash-functions/ (accessed 19 July 2020). - Berry, Nick. 2013. Discrete cosine transformations.
*Data Genetics*. Available online: http://datagenetics.com/blog/november32012/index.html (accessed 21 July 2020). - Pound, Mike. 2015. JPEG DCT, Discrete Cosine Transform (JPEG Pt2).
*Computerphile*, 22 May 2015. Available online: https://www.youtube.com/watch?v=Q2aEzeMDHMA&feature=youtu.be (accessed 24 July 2020). - Rabie, Tamer, and Ibrahim Kamel. 2017. High-capacity steganography: A global-adaptive-region discrete cosine transform approach.
*Multimedia Tools Applications*, (76)6473–6493.

- Compression algorithms don’t waste CPU time by drawing curves. In fact, the cos calculations in the formula shown above are pre-calculated and stored in tables in the software doing the compression.

Apart from that the GIF format provides lossless compression. So GIF files are smaller that raw image files. But the main advantages of GIF format is that it stitches together sequences of images to produce animations. These are like short videos that run in a loop endlessly on a web page. There’s no need to start or stop the GIF to run it. In fact you can’t. Nor do they have sound. This makes them useful for those little emojis and reaction clips that you see on web pages, text messages and social media posts.

The GIF (Graphics Interchange Format) was developed in the 1980s, ostensibly to give life to static web pages. Sellers quickly adopted them as a means of drawing attention to their advertisements. Animated GIFs served as the new neon lights of the digital age.

Various websites are dedicated to compiling, searching and displaying animated GIFS, e.g. giphy.com. There you will see nightmare pages of 1-2 second clips lifted from video content, cartoons, real life events, digital drawings, collages, etc.

There’s a history and culture to the GIF, nicely explained in an article by Kate Miltner and Tim Highfield, who also indicate how GIFs purvey visual memes, promote causes, deliver jokes, troll politicians, etc. The GIF is potentially an activist medium. People also use GIFs to communicate basic emotional states: “the performance of affect and the demonstration of cultural knowledge” (3).

As I’ve been investigating hidden images I wanted to see to what extent animated GIFs subvert the human perceptual system. I found many jokey references to subliminal messaging at giphy.com, but none that seemed to exploit flashing images in rapid succession.

I compiled some pictures from my photo gallery using the *Convert Photos to GIF* shortcut on my iPhone and uploaded it to this blog post. As animated GIFs are relentless and distracting I chose to provide a link to the GIF rather than plant it in this page. Click on the picture below to see the animated GIF.

We are familiar with the rapid succession of images in film, advertisements and music videos and other media, but I suspect most viewers could only stand this in short bursts.

There are 35 images in my animated GIF, each displayed for one tenth of a second. By trial and error this seemed to be the threshold at which I could discern and remember some of the content of individual images, if I stared at the GIF for long enough.

What colour is the butterfly? Is it a butterfly or a moth? How many ducks are there in the water? Is there anyone in the sea? How many stone buildings are there?

There are no subliminal messages, unless you think of the whole GIF as a hypnotic tribute to nature, the outdoors, cats, photography, infinity, or excessive CPU loading.

- Johnson, Neil F., and Suchil Jajodia. 1998. Exploring steganography: Seeing the unseen.
*Computer (IEEE)*, (31) 2, 26-34. - Marwick, Alice E., and Danah Boyd. 2014. Networked privacy: How teenagers negotiate context in social media.
*New Media and Society*, (16) 7, 1051–1067. - Miltner, Kate M., and Tim Highfield. 2017. Never Gonna GIF You Up: Analyzing the Cultural Significance of the Animated GIF.
*Social Media and Society*, (3) 3, https://doi.org/10.1177/2056305117725223.

Audiences in a cinema could be induced to buy a Coca-cola during intermission if presented with a few images of the brand and texts telling you that you are thirsty. These suggestions would appear for a split second in the film as just single, isolated frames evading conscious detection.

Images flashed in rapid succession are a commonplace in the digital age. If you have sufficient visual acuity you can rattle through their own digital photo-library at about 10 frames a second and identify the portrait of your best friend.

Though advertisers were sceptical about those particular techniques, the idea of subliminal messaging became a leitmotif for critics of mass media advertising. In his book *The Hidden Persuaders*, Vance Packard sought to expose the surreptitious nature of advertising tactics.

“It is about the large-scale efforts being made, often with impressive success, to channel our unthinking habits, our purchasing decisions, and our thought processes by the use of insights gleaned from psychiatry and the social sciences. Typically these efforts take place beneath our level of awareness; so that the appeals which move us are often, in a sense, ‘hidden.’ The result is that many of us are being influenced and manipulated, far more than we realize, in the patterns of our everyday lives” (31).

Google Books currently provides all the back issues of the weekly *Life* magazine going back to 1936, offering a searchable compendium of twentieth century cultural mores and how these have changed.

The magazines include advertisements of course, but also articles about advertising. I was drawn to a 1958 article featuring so-called “Hidden sell” techniques, their methods and dangers. Film producers were on the verge of producing SP (subliminal perception) movies, e.g. a film might flash images of a skull at audiences to heighten the impact of a horror scene.

The advertising scenario was best captured by a cartoon that showed a tv addict reclining in his armchair. Hair products are on the coffee table and his hair is in curlers. “I don’t know what came over me” he says. The article highlighted serious and non-serious causes for alarm.

The idea that advertising might operate subliminally assumes that the application of such techniques is exceptional — as if we are otherwise in control of what we see, hear and sense, and the effects those sensations have upon us. In fact that particular edition of Life magazine is full of other “subliminal messages.”

In keeping with the age, the edition purveys the good life, middle-class suburbia, a burgeoning consumer culture, and the nuclear family — wash and wear shirts, lawn mowers, pasta sauce, washing machines, *South Pacific*, a Smith-Corona portable electric typewriter, a Keystone 8mm movie camera, etc.

*Life* is an American pictorial magazine, but the only non-white depictions of people are performers — Mike Satiri (a sax player) and singer Johnny Mathis in an extended family setting. There’s an exotic depiction of villagers in Sri Lanka, and a cartoon depiction of American First Nation art advertising tourism in Oregon.

There’s an article about schooling. The only negative image on that theme is of a non-white student being admonished by a teacher, captioned “Tough student: New York City has shifted troublemakers from regular schools to special ‘700’ schools.”

Media presentations that reinforce stereotypes are also a form of subliminal messaging. Most modes of influence are in that category after all. It’s a common feature of interpretation that we are never fully aware of what influences our judgements and interpretations. See posts tagged Hermeneutics.

- Barthes, Roland. 1973.
*Mythologies*. Trans. Annette Lavers. London: Paladin - Brean, Herbert. 1958. ‘Hidden sell’ technique is almost here: New subliminal gimmicks offer blood, skulls and popcorn to movie fans.
*Life*, (44) 13, 102-114. - Crandall, Kelly B. 2006. Invisible Commercials and Hidden Persuaders: James M. Vicary and the Subliminal Advertising Controversy of 1957.
*HIS 4970: Undergraduate Honors Thesis University of Florida Department of History*, 12 April. Available online: http://plaza.ufl.edu/cyllek/docs/KCrandall_Thesis2006.pdf (accessed 13 July 2020). - Packard, Vance. 2007.
*The Hidden Persuaders*. Brooklyn, NY: Ig Publishing. First published in 1957.

- According to their website, “LIFE Magazine is the treasured photographic magazine that chronicled the 20th Century. It now lives on at LIFE.com, the largest, most amazing collection of professional photography on the internet. Users can browse, search and view photos of today’s people and events. They have free access to share, print and post images for personal use.”
- As they say they are free to share, here are a couple of architectural images from an article about the Brussels World Fair.

“One can draw an outline around a shadow, so that a shadow has a boundary; yet it would be odd to say that a shadow has a surface. No properties or features can be attributed to the surface of a shadow per se; it cannot be said to be dark or light, thick or thin, smooth or rough, wet or damp; nor can it be removed, sanded, polished, and so forth” (32).

But most people enjoy searching for the exception to such rules. If we can’t find it in everyday language, then it’s there in architectural theory, metaphor, jokes, fantasy and literature, e.g. Peter Pan loses his shadow which Wendy then kindly sews back onto his body.

At least in his *Surfaces* book, Stroll doesn’t mention disguise, camouflage, dissimulation or other interesting breaks from the norms of “surface talk.” He explains how surfaces can hide the contents of the objects they surround, as skin hides the view of internal organs, but not how one surface might hide another.

Stroll’s analysis mainly focusses on the perception of surfaces, and avoids patterns and images planted onto or etched into surfaces and how these become the surface. After all, fresco artists draw scenes that have surfaces onto surfaces. That surfaces become the bearers of images opens them up to an even richer vocabulary of experience.

Anamorphosis is the application of a distorted image onto a surface such that it is visible only from a particular angle of view, or with a lens or reflecting device, such as a polished cylinder placed over a key location in the picture. Architects are used to the idea that a room extends beyond the constraints of the room’s wall surfaces, by painting, lighting, mouldings and reliefs that deliver an exaggerated or false perspective. Designed to be photographed from a particular vantage point, 3D pavement art breaks the bounds of surface.

Search Google image for “camouflage architecture” for examples of forms and surfaces that conceal, obscure, obfuscate and make ambiguous the shape and materials of buildings. Dazzle camouflage works particularly well on naval vessels and has developed into an art form. I saw this on the River Thames in 2015.

Surfaces made up of digitally-controlled arrays of mechanical components, electro-sensitive materials, colours and light sources, as well as surfaces onto which digital images are projected, compound surface phenomena and render surfaces dynamic, responsive and interactive.

I’m fixated on cryptographic surfaces at the moment. Steganography presents as a fascinating subspecies of dissimulated surfaces. I explained in a previous post how the colour value of a pixel is stored in a file as a number, usually in binary. In 8 bit colour, the grey colour 235 is 11101011. Removing the last 4 bits gives you 1110, which is 14. That process is called a “bit shift” and it’s a very efficient (fast) operation in a binary computer. It’s an easy way of reducing the pixel values in a grey scale image from 8 bit to 4 bit. 8 bit colour has a range of 0-255 values. 4 bit colour has values in the range of 0-15 colours. If you want to conceal the value of a pixel that exists in a second picture (e.g. 210 = 11010010) then you also bit shift that bit string by 4 to produce 1101 (13) and append these two bit strings. The pixel value of the hidden picture will make up the right half of the bit string. The new bit string will be 11101101 (237). In what follows, I’ll just show decimal rather than binary values as they are easier to read. Helpfully, Excel has a function that performs bit shifts on decimal numbers. You don’t need to see the binary numbers at all, though I showed the process in a previous post.

The image on the left is a fragment of a grey-scale carrier image — perhaps an ear zoomed in close. The image to the right of that is a simplified and stylised plan of the Helsinki main station. Both images are then reduced from 8 bit colour to 4 bit and combined using the bit shift method described above. The difference is scarcely noticeable here, but at scale you would notice that the 8 bit grey scale image is of higher quality than the 4 bit version.

That’s the combined picture on the right. The station plan is invisibly concealed within the pixel values of the carrier picture. The combined picture is still 8 bit, and the hidden picture constitutes a subtle layer of random noise.

The reverse bit-shift operation returns the hidden picture as shown below. I wanted to see what happens if the hidden picture is integrated into the carrier at different degrees of colour depth, i.e. 1, 2, 3, 4, 5, 6, 7 bits with a corresponding reduction in the colour depth of the carrier picture. I’ve arranged these here. The central image shows both the carrier and the hidden picture at 4 bits colour. If the carrier picture is much less than 4 bits then the hidden image starts to show through when the images are combined, scrambling the combined picture, as evident at the far right.

Here are a couple of images to prove that I can also hide the carrier picture inside the hidden picture, and recover it using the same method. Any picture can be hidden inside any other it seems.

This demonstration shows that it’s possible to conceal hidden pictures in publicly visible display screens. I’ve explored why anyone would do that in a previous post. Here, it allows one image to blend into another and remain undetected, but also to recover itself, like a chameleon.

I’ve yet to see if a bit shift technique has been used to discover traces of objects or artefacts imprinted on land or urban surfaces. The recover process applied to a picture without hidden content would simply return an array of pixel values presenting the remainder after dividing by 16. That’s arbitrary in the case of a photograph of a surface. Here’s what happens when I apply the recovery procedure to the original carrier picture that has no hidden picture.

It seems to highlight outlines and fits within a range of algorithms for detecting boundaries, exaggerating differences between coloured patches and identifying objects.

- Dorrian, Mark. 2013. On Google Earth. In Mark Dorrian, and Frédéric Pousin (eds.),
*Seeing from Above: The Aerial View in Visual Culture*: 290-307. London: IB Tauris. - Johnson, Neil F., and Suchil Jajodia. 1998. Exploring steganography: Seeing the unseen.
*Computer (IEEE)*, (31) 2, 26-34. - Stroll, Avron. 1988.
*Surfaces*. Minneapolis, MN: University of Minnesota Press - Leach, Neil. 2006.
*Camouflage*. Cambridge, MA: MIT Press