Solved

Frequency/Signal of the pulsating light in a video

Posted on 2016-08-02
10
29 Views
Last Modified: 2016-08-03
I have a video with an LED pulsating on/off.
Just by looking with the naked eye I estimate the frequency somewhere in a visible spectrum 2-10Hz.
I would like to know with a higher precision the frequency.

Do you know any software for Windows or a trick/procedure how to find that frequency?
If I would be able to extract the signal on/off as a curve (rectangular signal) vs. time, that would be even better. It would be perfect.

What crossed to my mind up to now is only to split the videos in frames and to look how many frames are with LED on and how many with the LED off. Then knowing the frame rate I could calculate the frequency of the LED light or even to draw the signal. But that seems a Sisyphus work.
The problem is that frequency is not even constant.
There is also „flicker tester” software (http://www.visosystems.com/products/flicker-tester/ ). But I do not know if I can point that to my monitor, because the monitor has its own flicker frequency. I do not have access to the original light source. I have only a recorded video.
https://goo.gl/HLFPE9
Flickering-LEDs.zip
0
Comment
Question by:viki2000
  • 7
  • 3
10 Comments
 
LVL 27

Accepted Solution

by:
d-glitch earned 500 total points
ID: 41739139
What is the duration of your video sample?  
Can you tell what the original frame rate was?
Is there any sort of image compression going on?  That might really mess things up.

Do you suspect the flickering is sinusoidal, rectified sinusoidal, or on/off?  If it is sinusoidal, you should be able to find the zero's pretty easily.

If you have access to software like Matlab, you could isolate the relevant pixels and plot their amplitude.  You could also use a small photo diode probe and plot the output on a scope.
In either case you might be able to run an FFT.
0
 
LVL 20

Author Comment

by:viki2000
ID: 41739166
Do you see the video in the link above and as well in the attached zip?
It is around 4s.
I do not know the original frame rate, neither the compression, but I can try to find out.


I do not have access to Matlab and I am not use with it.
The LED light intensity is proportional with the current in LEDs. I only suppose the current is sinusoidal. I would like ti find that from the video.
0
 
LVL 27

Assisted Solution

by:d-glitch
d-glitch earned 500 total points
ID: 41739325
I  was able to look at the file with the VLC Media Player.  This was one of the options that came up when I clicked on Open With.  I don't remember ever using this program, but I apparently installed it five years ago.

The file properties say the video is 25 frames per second.  I was able to slow it down by a factor of 30 and count the frames.  I counted 94.  The LED's seem fairly erratic.  Sometimes on for a single frame, sometimes for several.  You can also see several brightness levels.

If normal (unidirectional) LED's are connected to a magnetic pickup coil, I would expect them to be on less than half the time.  The coil will generate a voltage proportional to the change in magnetic field.
Current will flow when the voltage forward bias the diode and exceeds the turn-on threshold.
0
 
LVL 20

Assisted Solution

by:viki2000
viki2000 earned 0 total points
ID: 41739603
It is erratic indeed. Seems so.
I expect to be sinus current through the LEDs, from here the variation of intensity, but then there are breaks, time off moments between sine wave pulses.
I would like to reconstruct the current waveform.
Assuming that part with sine is too difficult, it would be enough to know the time on and time off intervals. Then I can see the frequency.

I was thinking that maybe there is a piece of video analyzing software that maybe can do that or at least a part of the job, that's why I asked here.

One idea that you suggested, using a photo-sensor and an oscilloscope is not so bad, but involves one steady point on the screen. The LEDs from video are moving according with the camera motion which was held in hand. So to apply your idea, I need next video fix: how to apply a video motion filter/transformation (what program) in such way that an object in motion will become steady still? I think this would an interesting problem and maybe I should open a new question special only for it.

Other video analyses software to help me I do not know. Can you do something in Matlab?
Any other, more accessible software, solution?

In mean time I extracted all the frames.
There are 123 frames with 25 frame/s frame rate:
https://goo.gl/yByViv


After Effects has a Warp Stabilizer without manual motion tracking.
The attached zip shows the result.
Flickering-LED-stabilized.zip
0
 
LVL 20

Assisted Solution

by:viki2000
viki2000 earned 0 total points
ID: 41740168
Now that the image is stabilized is easier to focus only on one region and extract the brightness/luminance levels for each frame.

Here is what you proposed:
https://de.mathworks.com/matlabcentral/newsreader/view_thread/290213?requestedDomain=www.mathworks.com
but I do not have Matlab and I do not work with it.

Here is something similar that I would like to have as end results:
http://www.nature.com/nature/journal/v523/n7562/fig_tab/nature14660_SV3.html

It seems that are functions/programs with filters/plugins named "videoscope" or "vectorscope" that can do that, but all seem to do it on the entire screen and not on a certain region:
https://documentation.apple.com/en/color/usermanual/index.html#chapter=8%26section=3%26tasks=true
http://www.sonycreativesoftware.com/using_the_vegas_pro_color_scopes
http://www.premiumbeat.com/blog/video-essentials-how-to-read-a-vectorscope-and-waveform-monitor/
https://www.youtube.com/watch?v=cpXmNbram1Y

The worst case is to use a picture editor and use the color picker for each 123 picture-frames and see the level of white, luminance.
For example Gimp can make a mean value of a region:
https://docs.gimp.org/en/gimp-tool-color-picker.html
But then it would be nice a batch processing and not manually look for each picture-frame.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 20

Author Comment

by:viki2000
ID: 41740215
Test Gear 2.5 pulgin  from Synthetic Aperture for After Effects lets you see the waveform of luminance, but I have no idea about timing.
What you see below is from one frame.
Waveform
0
 
LVL 20

Assisted Solution

by:viki2000
viki2000 earned 0 total points
ID: 41740370
Here is the test with my 1st idea.
I opened the video in frames.
Then I used a program http://annystudio.com/software/colorpicker/
In 10 min I was able to pick-up manual the RGB of the middle LED from all frames and a list was generated. It would have been nice an automated batch process a single piece of software...
Using the next formulas:
http://www.nbdtech.com/Blog/archive/2008/04/27/Calculating-the-Perceived-Brightness-of-a-Color.aspx
http://www.had2know.com/technology/rgb-to-gray-scale-converter.html
I calculated the gray-scale, brightness and I plotted over the time knowing that the video was 25 frame/s, meaning 1 frame each 40ms.
The result is in the Excel below.
It seems around 200ms-400ms period for the siganl, so a 2.5Hz-5Hz frequency.

It remain only one thing to consider: the interference and the sampling rate (frame rate) of the digital camera vs. the LED pulsating light. Maybe some pulses are missing or there is a total interference, hard to say.

Color.xlsx

I ran a second test, this time a bit automated using mouse recorder software accelerates the tasks a bit (http://www.mouserecorder.com/ ).
I focused this time on lightness (HSL) https://en.wikipedia.org/wiki/HSL_and_HSV
The results are very similar.

HSL.xlsx
0
 
LVL 27

Expert Comment

by:d-glitch
ID: 41740753
You are way ahead of me.  I managed to read the video into Matlab then got stuck on the learning curve.
The VLC program said the frame rate was 25 per second.  I don't know if this is embedded info or a default.
I could easily believe you have a sinusoidal signal with some saturation and rectification.
0
 
LVL 20

Author Comment

by:viki2000
ID: 41741035
I want to conclude few things:
- forget for a moment about the current waveform in the LED and consider only on/off, meaning max. brightness of the LED in the center of LED when is ON and the gray level when is OFF. That is enough to find the pulsating frequency.
- I find the result and entire analysis irrelevant now. The reason comes from DSO way of working or general from a DAQ. In order to see/acquire correctly a signal we must have the sampling rate higher than the signal. There is a theorem saying that must be at least 2 times higher, but in reality that makes from a sine a triangle, so we need in fact at least 10 times higher to reconstruct the initial signal with a good/acceptable approximation. Higher is even better. This applies also to our case. If the LED flashes with low frequency in reality, let's say 400ms period, as I calculated, and the frame rate is 25 frame/s, meaning 1 frame each 40ms, that is acceptable because the sampling rate is 10 times higher. But how do I know that for sure? I do not have access to original video. If the frequency of the LED is higher, multiple of 40ms, then the frame rate, sampling rate of the digital camera catches only some of the pulses, missing some, and everything is then wrong. On the other hand that is less probable because it needs a synchronization between camera frame rate and pulsing moments.
It is a strange and difficult to analyze problem if we do not know more info about original video.
But was also interesting.

Thank you for your suggestions and your time. Sometimes brainstorming or only another person to speak with is enough for me. It just make me going further. I think I will close the question now.

P.S. If you want to play further in Matlab it would be interesting to see the outcome. The 25 fps is defined in video, inside. I can see that with any video editing software that I used. That's why when I extracted all the frames, it was clear how many I have, because is the length of the video multiplied with the frame rate.
0
 
LVL 20

Author Comment

by:viki2000
ID: 41741237
I tried FFT and I got around 4.5Hz for the slowest blinking and around 20.5Hz for highest rate blinking.
I used Excel, Analysis Pack as explained here:
http://www.stem2.org/je/Excel_FFT_Instructions.pdf
Data-LED.xlsx
FFT Excel
Then I tried Sigview trial software. The units on the axis are not proper.
http://www.sigview.com/
SignalFFT barsFFT curve
I tried also DaDisp free student, but I could not get the FFT proper, I miss a setting somewhere.
http://www.dadisp.com/dlindex.htm
https://www.youtube.com/watch?v=ddRdXcSE7KA
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
Digital marketing agencies have encountered both the opportunities and difficulties that emerge from working with a wide-ranging organizations.
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…
The Bounty Board allows you to request an article or video on any technical topic, or fulfill a bounty request to earn points. Watch this video to learn how to use the Bounty Board to get the content you want, earn points, and browse submitted bount…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now