We have been floundering around because you initially gave so little information
"I am trying to measure the amplitude of a PWM signal using Ardunio. I know the duty cycle and the frequency of the signal. "
So we know:
the range of voltages? NO
the frequency? the duty cycle?
how it is grounded?
the source impedance?
where the noise is coming from?
the precision to which you want to measure the "amplitude"
trawling through the thread (finally at #47, #50) it looks as if the signal is ground referenced with a peak amplitude of 400mV, rep rate of 10kHz and pulse width (presumably variable) shown as about 5usec.
So: you need to make the voltage bigger to be able to measure it.
A 5usec pulse has frequency components at and above 200kHz so you will need an amplifier that can work at those frequencies.
The SparkFun OpAmp Breakout - LMV358 - BOB-09816 - SparkFun Electronics
uses a lmv358 which has a gbw of 1Mhz
"The bandwidth is set to 15.9kHz by a pair of feedback capacitors, or over 100kHz with the caps removed." so its too slow.
An op amp such as the AD823 could be used as a 2 stage amplifier to give a suitable voltage for measurement - you would still need a detector, peak hold or lock-in amplifier to measure the peak voltage. And you would need to get rid of the noise - although the bandwidth limityataion of the amplifier might well do that.