Foaming of Effluent in WWTP

In out wastewater treatment plant we have constructed huge Imhoff tanks for treatment of wastewater.

Besides very high H2S odour, the effluent wastewater had severe foaming.

What is causing the foam?

Can the possible reason be the ammonium generated from anaerobic processes?