[ESP32] How generate a pwm signal with 20 kHz frequency?

I'm trying to generate a 20 kHz signal PWM signal. I'm a bit confused with esp's ledc api. I read the documentation and found that the lower my timer bit and the higher the base frequency I can achieve and also the APB clock of the esp generates upto 80 MHz signal. After read thing this post on ESP's forum, and trying to implement that I still could not get a 20 kHz frequency signal.

Here is a basic sketch that I've been playing with

#define LEDC_CHANNEL_0     0
#define LEDC_TIMER_BIT  1
#define LEDC_BASE_FREQ     20000
#define LED_PIN            33

void setup() {
  ledcSetup(LEDC_CHANNEL_0, LEDC_BASE_FREQ, LEDC_TIMER_BIT);
  ledcAttachPin(LED_PIN, LEDC_CHANNEL_0);
  ledcWrite(LEDC_CHANNEL_0, 255); // ((2 * TIMER_BIT) - 1) * x%
}

void loop() {
}

Basically the motor that I'm trying to control creates audible noise and I'm trying to reduce that, my initial thinking was if I get above or at 20 kHz that would reduce the noise at least to some extent.

Thanks.

Does the motor produce noise with simple DC voltage? Looks like the motor is sort of creating
a beat freq or resonating with the PWM. Try a LC filter before the motor, or even just a 10uF or thereofs cap across the motor's terminals...maybe filtering out the switching frequency that way might help. Basically we're just smooting or averaging out the PWM into DC before feeding to the motor instead of relying on just the motor to do it.