Vehicle speed sensor

You won't vary the frequency of your output with analogWrite - that only changes the mark/space ratio of a fixed frequency.

Use tone().

I've built revcounters using pulseIn() to get the period of a waveform - it works fine.

// now obtain pulse width - note measure high and low
// parts to deal with asymmetry

    pulselow  = pulseIn( pulsepin, LOW);   // measure pulsewidth
    pulsehigh = pulseIn( pulsepin, HIGH);  // measure pulsewidth    
    pulselen = pulselow + pulsehigh;       // pulse duration in uS

    Frequency = 1000000/pulselen;

( added for your project...

      if (Frequency > 60) tone(toneoutput, 160);
      if (Frequency < 10) tone(toneoutput, 30);

)

The measurement is done inside the main loop () using the millis() function to run every 20mS.

see the 'Blink without delay' example in the IDE.

The blocking nature of pulseIn() doesn't affect the operation.

This isn't a difficult problem.

Allan