Ah, RPM changer, sounded something like that!
So, this isn't anything new, it's been done many times -- have you checked what solutions are already available? I'm pretty sure I've heard of this application before. Maybe there's an open source solution?
Or maybe it's not a super common application, and is hard/impossible to search for, that always sucks...
To be clear, there are lots of ways to filter digital signals -- it works just the same as analog, everything's just smooshed down to one-bit quantization. Same theory applies: digital debounce is just a one-bit version of a linear lowpass filter; well, if you aren't using hysteresis, which is nonlinear of course -- but that still corresponds to a related analog circuit.
Yeah, electrical and opto signals should be pretty clean, save for EMI, which can be easily filtered (should be well above the signal's frequencies). Inductive sensors have weak waveforms at low RPM, so do be careful how you deal with that, including checking for pulse width and balance -- the duty cycle might be wonky for example. (Actually, if it's coming from a crank position sensor, the duty will be very low indeed by default, right? Well, I don't know what all sensors are usually available, maybe there's a cleaner one that's more readily available. CPS is ECU stuff after all.)
So, as is always the case -- if you can gather data from various environments, especially noisy ones, that gives you something to work with.
As for methods, there's kind of two ways to go about it: by event, or by periodic sampling. Perhaps there's a hybrid method inbetween, as well.
There's some logic to a "what's this pulse width compared to previous?" method; kind of a zero-dimensional cellular automata. It's a simple starting point. But it has the downsides that, if some pulses come too quickly, what do you do? A sudden burst of rapid pulses completely flushes the memory; so, it can respond quickly, sure, but... should it? Or if you decide to ignore a pulse (or edge, even), how do you go about that? It's event-driven, you're obligated to do something every time. And how much memory should you log? Probably not too many pulses, because of corresponding delay at minimum speed. But that limits how much analysis you can do.
A more academic approach is to treat it like any other signal problem: you've got some input bitstream at the given sample rate, and you can do filtering and statistics and whatever on it, and update the output periodically as needed. (Output updates don't even have to be exactly periodic; you might hold off on updating the output until a new value is known, after one or a few apparent input cycles have passed.) Analyses can be as fancy as the Fourier transform (resulting in a measure of frequency) -- though since we're working with bits, the Hadamard transform may be more appropriate (resulting in a measure of "sequency"!). Note that an FT (or HT) can only be done on a whole buffer, so this would have the downside of a total propagation delay equal to buffer length.
The upshot to methods like frequency transforms is, you can simply rescale the spectrum, inverse transform, and output the bitstream. It's hard getting there, but it's a fairly trivial task once it's done. And you can suppress noise/harmonics, peak detect, whatever to get a clean output.
An inbetween sort of analysis would be something like a digital PLL. Run a phase or frequency difference detector between input and reference, and adjust accordingly. Filter the detector output to remove spurious detections, which simultaneously limits the rate at which the output can respond -- as we should expect.
I'm not sure offhand how annoying a PLL is in software, but it should be alright with an MCU, timer (with input capture and other fairly standard things?) and PID loop*.
*I use "PID" generally here; you might not want a PID exactly, for numerical or dynamical purposes. More just, any control loop and filter response that's suitable, while having overall integral characteristic (so that error tends towards zero over time).
And we can also make some assumptions about the underlying physical system. The engine can only accelerate at whatever rate it can. If it's a manual transmission, changes could be a bit more abrupt due to external forces (both up and down shifting). Automatic should be somewhere inbetween, depending on type (with non-locking torque converter being the softest, I would think). This can inform decisions about what statistics to use on accepting/rejecting pulse widths, or, say we do a transform and instead of a nice sharp peak it's got a huge smear of frequencies (chirp), so maybe we shouldn't do peak detection on that; etc.
Tim