Edinburgh was once a city of breweries, and at times the smell of hops would descend upon the city. I used to walk home from a night out, slightly inebriated and hoping the hour-long journey would help to sober up. And so often, at two or three in the morning, that walk would be enriched by the smell of the breweries around Fountainbridge. I have a particularly strong memory of a long walk through a misty night, and of inhaling the air as if it were nourishing me, or at least hinting at an airborne hair-of-the-dog.

Those large Fountainbridge breweries are long gone, but I now live in the shadow of the Caledonian Brewery on Slateford Road. Is there an olfactory equivalent of a shadow? Regardless, whenever I catch a whiff of that heady mix of hops and malted barley, I am reminded of those late-night walks home twenty years ago. It doesn't happen often - in fact, it doesn't happen often enough for my liking - but it always brings back happy memories.

The west of Edinburgh sometimes lies under another, rather tormenting smell - the caramel-sweetness of the Burton's biscuit factory in Sighthill. It's a cruel smell, often occurring first thing in the morning while I'm heading to work. It immediately puts me in mind of biscuits and cakes - perhaps that's why I am so tempted by a morning scone from the office canteen?

All this talk of smell has been prompted by recent trip to Berlin, which sits under - or perhaps more accurately, above - a much less pleasant aroma.

The name of the German capital reportedly derives from an old Slavic word, "Brl" or "Berl", meaning "swamp" or "marsh". Perhaps that explains the stale, sewage-ry smell which hung around the city like an unwanted party guest. And come to think of it, what's with the blue pipes which rise from the ground, travel a few metres, twisting and turning and blocking the view of some stunning architecture? Do Berliners really pump their sewage above their heads?

Well, no. In fact, the pipes are temporary, appearing around construction sites, and are used to drain groundwater. And there are a lot of construction sites in Berlin. The city's water table lies only a few metres below the surface, and modern building projects rely on foundations dug at least as deep as that. The pipes help drain the groundwater - usually, directly into the River Spree.

The smell didn't seem to be correlated with these curious pipelines in the air. So back to "Berl" and the swampy origins of the city. Is Berlin built on a swamp?

Only a little. The central core of the city, the district of Mitte, was built on swampland, but Berlin has grown and expanded to a metropolis of over 3.5 million people, and most of this city is not on swampy land. Indeed, there is almost a thousand years of occupation in Mitte, and Berlin has been built and bombed and rebuilt and divided and rebuilt many times since then. There's little that's swampy about Mitte now.

In researching this odorous phenomenon, I came across another theory: the Berliners don't flush enough. Or rather, the Burghers are so parsimonious with their water usage that sewage moves slowly through the flat city, lingering longer than one might expect. On a warm summer's day, perhaps that stagnancy manifests as a miasma?

So where does the truth lie? Do Berliners even notice this smell? Am I spoiled by the comparatively fresh Edinburgh air?

There's probably no single answer. The constant construction works, with blue and pink pipes shifting thousands of gallons of groundwater from the land to the Spree. A hot, overcast summer sitting low on a sprawling, flat city. The massive excavation works of Projekt U5, the extension of the U5 U-Bahn line through Mitte, digging deep into the swampy history of city and under the river. And an environmentally conscious citizenship doing their bit to save the planet, one short, swift shower at a time.