Modifying a variable frequency pulse?

I trying to figure out a way to modify the the output of a speed sensor on my truck. The sensor is simple and just does one pulses per revolution. I'm trying to be able to modify by a percentage. The challenge is that the output isn't consistent and is constantly changing.

The challenge is that the output isn't consistent and is constantly changing.

It's consistent between readings, isn't it?

How do you plan to output n pulses per second? Or n * m pulses per second?

If you want to output a different frequency you must first measure the existing one. That means at least timing the gap between two successive pulses. The pulseIn() function may be suitable for that.

Having measured the gap you can send out pulses with any other gap that suits you. The complication arises when you consider how often you want to alter the output gap because the changed pulses may screw up the continuity of the earlier ones.

One solution might to average the input frequency over (say) 500msec and output a constant (different) frequency for 500msecs (longer periods if the pulse rate is very slow and vice versa) but that means there will always be a 500 msec lag.

...R

PaulS:

The challenge is that the output isn't consistent and is constantly changing.

It's consistent between readings, isn't it?

How do you plan to output n pulses per second? Or n * m pulses per second?

I'm not sure? Essentially what I'm trying to do is to change my shift points in my transmission. The computer monitors a speed sensor in the transmission and decides when to shift. I want to alter the speed sensor and have the transmission shift a little later. I'm hoping to have a pot that I can adjust that changes the percentage of the skew.
I have done a few arduino sketches this is the most complicated one yet

Maybe this is a little out of arduino's league ?? Usually I have a little idea on how to approach things but this has me drawing a blank?..

Bradshaw106:
Maybe this is a little out of arduino's league ?? Usually I have a little idea on how to approach things but this has me drawing a blank?..

Is there a problem with the ideas in Reply #2?

If you explain what the problem is we might have a clearer idea of what you are trying to do.

...R

Robin2:
The pulseIn() function may be suitable for that.

Except I believe the pulseIn() function is blocking, which it likely to interfere with output pulse timing.

I don't think vehicle wheels spin so fast as to require interrupts, so I'd think that a simple Blink-Without-Delay polled loop using micro()s to measure input pulses and to schedule output pulses would suffice.