Author Topic: Extract RPM info from Video  (Read 1577 times)

0 Members and 1 Guest are viewing this topic.

Offline mtiberio

  • Full Member
  • ***
  • Posts: 248
  • ElMo MPG1K 141, LTA MPF1K 137, ECTA MPG1K 118
Extract RPM info from Video
« on: November 02, 2017, 10:11:59 AM »
I have no data logging on my motorcycle. I'd like to know what RPM I'm shifting at and what my terminal RPM is. I have gopro video of my run. I could extract the audio from those files. Does anyone have any signal processing software (matlab scripts preferred) which could extract RPM from an audio feed? Exhaust Pulses detected per second could easily be converted to RPM given the number of cylinders and firing order (known). I cant believe I'm the first to think of this, so If I cant find what I want I might have to write it.

Mike

Offline manta22

  • Hero Member
  • *****
  • Posts: 4137
  • What, me worry?
Re: Extract RPM info from Video
« Reply #1 on: November 02, 2017, 12:11:02 PM »
Mike;

You can probably digitize the audio using the Mic input on your computer and then use free software such as Audacity to plot the waveform on-screen. Then measure the pulse period or frequency using the time mark cursors.

http://www.audacityteam.org/download/

Regards, Neil  Tucson, AZ
Regards, Neil  Tucson, AZ

Offline mtiberio

  • Full Member
  • ***
  • Posts: 248
  • ElMo MPG1K 141, LTA MPF1K 137, ECTA MPG1K 118
Re: Extract RPM info from Video
« Reply #2 on: November 02, 2017, 12:53:26 PM »
googling around I found some matlab scripts to create spectrograms. it plots in RPS (S=seconds), so you have to multiply by 60. There are a lot of harmonics and at least one sub harmonic in my data, so knowing what the rpm should be helps pick the correct line. Here is my 2nd run from the October El Mirage event. I topped out at 136 which by my calculations should have been ~7400 RPM. The plot shows a bright line at about 125 HZ which when multiplied by 60 yields 7500, so getting close. You can see the RPM variation in 1st gear due to it being too tall, clutch slip and bogging off the line. 2nd, 3rd and 4th are clear (only used 4 gears of a 5 speed due to available gearing options).

OctRnd2GPaud by mtiberio, on Flickr

here is the code I ran (extracts from 40 to 84 seconds in the input file foo.wav):
[data, fs] = wavread('foo.wav');
data = data(fs*40:fs*84);
winL = 32768;
win = hamming(winL);
nfft = winL;
[S,F,T,P]=spectrogram(data, win, winL/2, nfft, fs, 'yaxis');
surf(T,F,10*log10(P),'edgecolor','none');
axis tight;
view(0,90);
colormap(hot);
set(gca,'clim',[-80 -30]);
xlabel('Time (Seconds)');
ylabel('Frequency (Hz)');
« Last Edit: January 30, 2018, 07:40:51 AM by mtiberio »