## Car speed from engine sound

All that has to do with the power train, gearbox, clutch, fuels and lubricants, etc. Generally the mechanical side of Formula One.
I thought that you are maybe interested in seeing how easy is, in principle, to extract a graph of a car’s speed vs time just from engine sound.

First of all, what we need an audio track of engine sound, it would be perfect to have a microphone attached to the car. Bernie is so kind to give it to everybody having a tv . Unfortunately Italian tv commentators have the bad habit to always talk during on boards, Suisse tv commentators more often let you hear the engine sound and thanks to that I was able to extract a few good “clear” segments. The best one is roughly 23-24 second long, and it’s the Renault engine sound from Fisichella on board with 16 laps to go (I did choose it also because there was the rev counter on tv so if you taped the race you can compare the reliability of my program for rpm extraction with the tv rev counter). Presumably GF was already taking care of the engine at that point using reduced revs, but I don’t care about that, it’s only the method I care about here.

Once we have the audio data, we need to extract rpm. That’s not particularly difficult, although obviously requires a bit of knowledge of signal analysis, of what Fast Fourier Transform is and an even rough filtering of the signal.
Here the result from the analysis of that Fisichella onboard (end of the segment is roughly at the braking point for the last corner, where the speedtrap is) :
[IMG:152:129]http://img103.imageshack.us/img103/1452/mal2006gfr168pv.th.jpg[/img]

As you can see the signal is quite clear (although there are a few disturbs on the signals causing unwanted spikes) and it’s quite easy to distinguish upshifts due to the sudden revs loss. More difficult to distinguish the downshifts because they happen in rapid succession meaning that the time resolution isn’t good enough to catch them perfectly and with engine already losing rpm.

Rpm vs time is already, in principle, car speed vs time. You need only to know the gear ratios and to extract them isn’t difficult.

First of all it’s necessary to identify which gear the driver was using at a given point and for that we measure and compare the slope of the curve in the different parts. For example, assuming that between 18” and 24” it was in 7th gear (minimum slope), the slope of the part right before downshift (between 4” and 8”) is higher, hence you can see that the driver was in a shorter gear. Using these two info as starting point we can assign the right gear to each segment as I did in the figure. At that point it’s possible to compare the slopes of the different parts to verify that the assignment is correct (BTW, the slope on each part isn’t exactly constant).

Then from the figure we can easily extract the ratio between two successive gear ratios, and that comes from engine rpm drop during the upshift.
Example, passing from 6th to 7th gear the engine rpm drops from 19000 to 17050 meaning that the 6th gear ratio is 1.11 times the 7th gear ratio.
We can repeat it for each upshift and we have then each gear ratio in proportion to the following one, and consequently in proportion to the 7th.
At the end to know the 7th we just need to know the car speed at a given point.
In this case we know from the video that the speed trap was close to the end of that segment. I don’t have precise data about speed trap at the moment (and certainly not about that particular lap), so let’s just make an assumption, let’s assume it’s 295 km/h because that’s the roughly the speed level commentators mentioned during the race.
Rpm there is 18500 = 1937 rad/s. Wheel rotational speed is (radius =0.33, from rules) 295 / (3.6 *0.33) = 248 rad/s => the gear ratio is 7.81. Consequently we can calculate the others :

3rd = 1.52 = 11.87
4th = 1.35 = 10.54
5th = 1.23 = 9.6
6th = 1.11 = 8.67
7th = 1 = 7.81

Now, last step. Applying to each part the right gear ratio, we can extract the speed vs time for the whole segment. For example, if engine rpm is 18k and the gear is 4th, then the speed is 18000 / 10.54 * (2 pi / 60 * 0.33 * 3.6 ) = 212.5 km/h, repeat the same for every point and you have the curve car speed vs time for Fisichella’s Renault.
Only problem is obviously the downshifting part, because in that part the rpm isn’t directly related with car speed so we have an hole, hole that anyway it will be possible to fill with a later estimate of deceleration.
I also didn’t eliminate the disturbs on the signal causing a few spikes because I wanted to show the result without tweaking, but it would be easy to fix it substituting to the clearly wrong points an estimate of speed from the adjacent ones :
[IMG:152:124]http://img93.imageshack.us/img93/4264/mal2006gfr16vraw0tb.th.jpg[/img]

Obviously this is just a first order approximation made in few minutes, with elementary instruments, lack of precise data (for example about speed trap) and without application of “cosmetics” to improve the quality of results, but I hope it was enough to show the principle of the method.
Reca

Joined: 21 Dec 2003
Location: Monza, Italy

That's very interesting indeed. I was wondering just how by sound analysis you would get absolute data to get speed with relative inputs. But, in that point, you "cheat" and need speed trap info, which is ok, since it is available.
Nevertheless, to get accurate, you would have to make the measurements yourself at the track by measuring engine frequency in the exact moment you would measure instant speed, otherwise you'll never know how a possible delay from one of the informations would bias your measurement.
dumrick

Joined: 19 Jan 2004
Location: Portugal

Nice work Reca. I bet you could get some good sound grabs from the full race onboard footage that pops up.

Do you think you coudl develop an algorithm that will allow you to know Renault's speed without needing the speed trap?
zac510

Joined: 24 Jan 2006
Location: London

That is not a post but technical article!

manchild

Joined: 3 Jun 2005

What sort of windowing function do you use? What length of window worked best for you?
ReubenG

Joined: 21 Apr 2004

Cleary the biggest problem is to extract rmp levels from sound.
I try to convert rmp to speed using your notes. I compared it with GP4
game (using telemetry) and you are right. Your calculation form match what I readed from telemetry.

Can you plese say more about how to extract revs from engine sound?
rob

Joined: 28 Jul 2004

Thank you all, I’ll try to add a few more with possibly further analysis from next races. I’m also doing a different kind of analysis to extract further info, I already did actually but I need further verifications.

dumrick wrote:Nevertheless, to get accurate, you would have to make the measurements yourself at the track by measuring engine frequency in the exact moment you would measure instant speed, otherwise you'll never know how a possible delay from one of the informations would bias your measurement.

It’s not big deal at the moment because there are more relevant sources of error than that one. The accuracy of rpm itself also limits the accuracy for the measure of the rev drop during the upshift hence the determination of the gear ratio, these are lot more relevant compared with also because at the speed trap the rate of acceleration is limited. Furthermore the error in the reference speed has the same influence on the whole curve, if it’s 1% higher than actual data at the point where I impose it, then it will be 1% higher at each point. Other errors have variable influence on the different points hence are potentially more “dangerous”.
The best indication would probably come from the speed at the intermediate because there’s a white line crossing the track that can be used as reference.
Anyway, as I said, that was just to show the method, with more precise data the accuracy can be improved.

zac510 wrote:Do you think you coudl develop an algorithm that will allow you to know Renault's speed without needing the speed trap?

Difficult, I can obviously do the same analysis but then I wouldn’t have absolute figure for speed, just at each point a speed value relative to the maximum. Theoretically then could be possible, having a few data about aero, tyres, engine etc, to make a guess about the speed even without knowing it, but it would obviously introduce lot more approximations. As I said I’m working on an evaluation of some of these info, but I need more audio samples to analyse and reduce the uncertainty.

ReubenG wrote:What sort of windowing function do you use? What length of window worked best for you?

Language barrier here... what do you mean by length of the window ? The length of the single time interval to analyse ? If that’s the case I adopt a 0.3 s long interval as basis because I found it to work well as a start, I can adjust it if required. Anyway I also adopt a few tricks to improve the time resolution.

rob wrote:Can you plese say more about how to extract revs from engine sound?

Well, to make a long story short.
The engine sound just like any other sound is the composed by the sum of different frequencies, some of them, the one we are interested in, are proportional to the frequency of ignitions, hence to rpm. To find this frequencies you have just to separate the complete audio data of several seconds in intervals of a given, short, time length, say 0.3 s, and then, using a Fast Fourier Transform on the interval, you have a representation of the frequencies composing the sound in that interval. Then identifying which ones are proportional to frequency of ignitions, you have the average rpm in the interval. Repeat it for all the intervals and you have rpm vs time.
The problem here is that you obviously want to divide it in short intervals to follow the rapid rpm variation, but the shorter the interval is, the lower is the frequency resolution (for example you could be in a situation where all the frequencies between 247 Hz and 253 Hz are identified as 250 Hz) and this consequently limits the precision in identification of rpm. It’s this one the delicate part and you have to play a few tricks to manage it.
That’s just an overview and I’m not sure I put it clear... if you want more details just ask.
BTW, as software I use Matlab, it has all you need, functions for signal analysis, functions to read wav files and plotting functions, nothing more is required in term of instruments.
Reca

Joined: 21 Dec 2003
Location: Monza, Italy

This is a cool Article!!!I like it very much.
Hello, everyone, My name is Diana from China.I am Newbie to be here. I am enjoying to know

all kinds of car diagnostic tools. Hope can learn something about automotive software from

all you in this forums. Nice to meet you all. See you soon.
Everyone has a dream,but not everyone can realize the dream.
Diana

Joined: 6 Dec 2010

Having an interest in playing music and recording live performances, I am interested in the types of microphones and other equipment used.
autogyro

Joined: 4 Oct 2009

In the mid 90's F1 teams where using this technology to capture their competitors engine rpm sounds, to determine as you did, the gear ratio and other engine data. They did it at track side gathering data on each of their competitors...

http://www.grandprix.com/ft/ft00345.html
"Driving a car as fast as possible (in a race) is all about maintaining the highest possible acceleration level in the appropriate direction." Peter Wright,Techical Director, Team Lotus
speedsense

Joined: 31 May 2009
Location: California, USA

Hi Reca,

What exactly have you used FFT for in this analysis? I did a quick simple example this evening using Audacity software and a video of a Cosworth V8 running on the dyno which happens to have an RPM readout on a screen in the foreground! I downloaded the audio file from the video and opened it up in Audacity.

We know from watching the video that between 13 and 14 seconds, the engine is sitting on its rev limiter of 20,000RPM and is therefore firing 80,000 times a minute or 13.3times per 1/100th of a second. I've attached a screenshot from audacity where I have lighted one hundreth of a second in the 13s area and can make out 13 peaks.

Have you just used FFT to filter out all of the unwanted parts between the major peaks?

Julian
Last edited by JulianW on Thu Jan 06, 2011 10:37 am, edited 1 time in total.
JulianW

Joined: 28 Dec 2010

I played a little bit with Sonic Visualizer and some data from my datalogger:

Race Monkey and Engine Acoustics

A longer version, but in my native language (Bulgarian) translated vie translate.google.com (I think it is readable). It has more details about working with Sonic Visualizer too (which is free).

RPM and Engine Acoustic Analysis
lz2lps

Joined: 28 Apr 2009
Location: Bulgaria

That's brilliant sound clip lz2lps, where did you get hold of it?
JulianW

Joined: 28 Dec 2010

If you open the video in youtube, you can see it in the description

That's the one:
lz2lps

Joined: 28 Apr 2009
Location: Bulgaria

Well, I don't know if this is interesting. I'm bringing back some quick calculations we made in this forum ages ago, taking Reca's image. I ask for forgiveness from old members, it must be the third time I show how this is done.

I reproduce the sped vs time graph for Fisichella at Albert Park in 2007 (data extracted by Reca using a Fourier transformation of the sound of the engine, taken from a video, to get the rpm and using gearbox ratios already known):

Speed vs time for Fisichella

Now, I used a CAD package to calculate speed vs time, by drawing a grid on top of the graph and deducing the scale of it, like this:

So, we have the speed for ten consecutive seconds for an F1 car. Beautiful, I think.

From this info I can deduce effective power to the wheels. The rolling force is neglectable, or a very approximate calculation shows this (the red box means nothing, the "Rolling power" cell is at position B20: a mere 9400 watts or miserable 13 hp).

Power to the wheels simple calculation

From that, it was relatively simple to get the drag and acceleration, by iterating the same procedure between different points in that "peak":

By "Fourth acceleration" I mean the fourth peak from left to right in Reca's image.

This could be interesting for some members: you can get information about your opponent's HP and efficiency by recording the sound of their engines. I have done it with good results. You HAVE to take in account the doppler effect problem (here is where Fourier Transformation comes handy, you have to know where the microphone is located and you have to deduce approximately the frequency shift caused by Doppler).

I'd say this:

Wheel spin stops at top speed (acceleration equals zero)

The total vertical force is more or less 5 kilonewtons at 250 kph (cell B13).

You can reconstruct the same worksheet, the equations are in the C column: those are approximations, but the figures must be pretty good, they are taken from the first graph, that should be more or less accurate.

The main uncertainty is in the drag coefficient, but nobody protested back then about that number... perhaps someone will find an error (thanks in advance! I'd appreciate that) or maybe someone can provide a better figure for drag coefficient now.

The number is in the range of downforce I've read elsewhere. Anyway, from the speed/time graph you can extract whatever you want about the force, the power, etc. Enjoy.

NOTE: by using a Fourier transformation you can filter noise that is polluting your signal, as you probably know. The problem here, I think, is the fact that you have phase shifts in the signal (we cannot hear phase shifts, that is, the moment when the wave starts shifts, but you can see it in the graphs posted recently). There is software devoted specially to extract the RPM from the sound, we posted some links also ages ago, I'll check for it if I have the time. BTW, it never worked well for me, the software was designed for airplane engines, and all I got was harmonic frequencies, around 1/6th of the real ones, but, hey, you can always multiply by 6...
Last edited by Ciro Pabón on Mon Jan 10, 2011 2:33 am, edited 5 times in total.
Ciro
Ciro Pabón

Joined: 10 May 2005

Next