Basically, there are three steps:

  1. Install the Arduino IDE and libraries.
  2. Get the sketch for the '328P front end and change it.
  3. Upload it.

The way you write, you might already have the Arduino IDE. If not, the full instructions are in the ‘Learn’ section here: Learn→Electricity Monitoring→Using the Arduino IDE

The sketch is on GitHub, under emonpi/firmware/src/:

(NOT emonpi/Atmega328/ )

The file itself where you make the change is src.ino, line 96:
const byte min_pulsewidth= 60;

Here is the tricky part - uploading it. If you do all of the above on the Raspberry Pi, the compiled file you upload will be on there somewhere. If you did it on another computer, you must find it on that computer and transfer it to the Raspberry Pi. The file has the .hex extension, where it is depends on your operating system - there’s a lot more detail on the Arduino website.

Once it’s on the RPi, there’s a script to move it

or, if that doesn’t work for you and the file isn’t where that script expects it to be, stop emonHub, then do
$ avrdude -v -c arduino -p ATMEGA328P -P /dev/ttyAMA0 -b 115200 -U flash:w:sketch_name.hex
(Don’t forget to restart emonHub.)

(I cheat: I disassemble the emonPi, take the “emon” board off and plug in a programmer and 5 V d.c., and load the sketch from my computer directly.)