changing pwm frequency of arduino leonardo

hie , i want to generate pwm pulses of duty cycle 30% and 50% of frequency 50khz at pins 5 and 3 ,am using it in ac to dc converter for mosfet switching... am new to this am using arduino leonardo board i have written this code , how do i get 50khz of frequency.

void setup() { analogWrite(3,128) analogWrite(5,77)

}

void loop() { analogWrite(3,128) analogWrite(5,77)

} plz do guide me