Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

Frequency/Signal of the pulsating light in a video

Posted on 2016-08-02
Medium Priority
74 Views
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
Question by:viki2000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 7
• 3

LVL 27

Accepted Solution

d-glitch earned 2000 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 21

Author Comment

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

d-glitch earned 2000 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 21

Assisted Solution

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 21

Assisted Solution

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:
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:
http://www.sonycreativesoftware.com/using_the_vegas_pro_color_scopes

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

LVL 21

Author Comment

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.
0

LVL 21

Assisted Solution

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
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

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 21

Author Comment

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 21

Author Comment

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

Then I tried Sigview trial software. The units on the axis are not proper.
http://www.sigview.com/

I tried also DaDisp free student, but I could not get the FFT proper, I miss a setting somewhere.
0

Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
If you're a modern-day technology professional, you may be wondering if certifications are really necessary. They are. Here's why.
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses
Course of the Month7 days, 4 hours left to enroll