If the code looks correct, why would the result be that the frequency does not change? Could you set a shield up and confirm or deny my result?

As to your question: I would prefer a much higher frequency of chopping. For some reason the motor shield library limits the frequency to about 1600Hz even though the tb6612 can go to 100KHz. I am wanting to characterize the driver and motor’s dynamic response using a random binary sequence. This information will alow for designing a EMC filter to decouple the PWM’s di/dt common mode noise from the power supply. The Arduino’s susceptibility to this noise is grossly misunderstood and a proper filter should solve much of the ills our community suffers from when using PWM to control power loads.

For some reason the motor shield library limits the frequency to about 1600Hz even though the tb6612 can go to 100KHz.

The PCA9685 which is actually generating the PWM has an upper limit if 1.6KHz. If you want to work with higher PWM frequencies, we have the TB6612 available separately as a breakout which can be driven using the Ardiuno PWM pins.https://cdn-shop.adafruit.com/datasheets/PCA9685.pdf