EMA CALCULATION

As dicussed in the class i hav done the sma and lma offset function. How to calculate the ema value?