PMW with duty cycle?

Someone else will have to help you with the frequency but analoWrite() is 8-bit PWM.

With 8-bits 100% is 255 so 50% is 127 or 128. (It's integer so you can't have 127.5).