Digital implementations for determination of temporal light artefacts of LED luminaires

Flicker and stroboscopic effects caused by a temporally modulated light source may be harmful for the human visual system. Standardized measurement methods have been developed for the related temporal light artefacts of LED luminaires. It was found out that the performance of the International Electrotechnical Commission (IEC) recommended flickermeter implementation is highly dependent on sampling frequency. Novel digital implementations for the flickermeter and stroboscopic effect visibility measure (SVM) were created to remove any inaccuracies. The performance of the novel Aalto implementations does not depend on the sampling frequency when running the test waveforms of the IEC standard through the implementations. As compared with the IEC recommended digital implementations, Aalto flickermeter decreases the average error related to the test waveforms from 2 0.05 to + 0.003, and Aalto SVM meter also decreases the average error by almost two orders of magnitude.


Introduction
Different operating principles of light sources based on LEDs and incandescent lamps cause their temporal light modulation (TLM) behaviour to be significantly different.The TLM properties produce temporal light artefacts (TLA) that are visible effects in the human visual system.TLAs have been linked to some adverse effects to humans. 1,2The EU Ecodesign Regulation sets limits to two of the TLA metrics: the short-term flicker severity index P LM st and the stroboscopic effect visibility measure M VS (SVM).LED manufacturers need to follow the regulation when producing luminaires for the EU area. 3e values of P LM st and M VS can be determined by feeding a measured light waveform from a luminaire to a digital TLA meter. 4There are freely available MATLAB implementations recommended by International Electrotechical Commission (IEC) TR 61547 for flickermeter 5 and IEC TR 63158 for SVM meter. 5,6These can be found as MATLAB toolboxes for P LM st and M VS respectively. 7,8n this work, we describe anomalies found in the IEC recommended flickermeter implementation caused by built-in MATLAB functions butter() and filter().These functions do not follow the analogue response in the frequency band of interest in the IEC recommended implementation.This effect was noticed at the sampling frequency of 50 kHz and further studied using sampling frequencies between 40 kHz and Address for correspondence: V Mantela, Aalto University School of Electrical Engineering, PO Box 17600, Aalto 00076, Finland.E-mail: ville.mantela@aalto.fi100 kHz.Because of this reason, we implemented novel flicker and SVM meters to remove any anomalies in the TLA characterization results.These Aalto implementations decrease the average deviations from the expected values by an order of magnitude in the case of flickermeter and by almost two orders of magnitude in the case of SVM meter.

Flickermeter and stroboscopic effect visibility meter
We first describe the principles of digital implementations of the short-term flicker severity index and stroboscopic effect visibility measure.Both meters are defined in related standards 5,6 and consist of four blocks A to D that handle different physiological effects in the human vision system.Block diagrams are presented in Figures 1 and 3 for the flickermeter and stroboscopic effect visibility meter, respectively.

Light flickermeter
Block A in the flickermeter, as can be seen in Figure 1, works as an input adapter.The output of Block A is the normalized light waveform E(t). 5,9n Block B, the human eye response is simulated by using three different filters.Firstly, the signal goes through a first-order high-pass filter.The transfer function of the high-pass filter in Laplace domain is defined as shown in equation (1): where s = jv is the Laplace variable, with j as the imaginary unit, and v = 2pf m accounts for the frequency component f m of the signal.In Equation (1), t HP = 3:18s is the filter time constant. 5,9Next, the light waveform is fed through a sixth-order low-pass Butterworth filter F LPBW (s).This filter has a cut-off frequency of 35 Hz with mains frequency of 50 Hz.Butterworth filter has been chosen, as it has the flattest response at the desired passband.The sixth-order filter was selected to achieve 250 dB attenuation at double of the mains frequency. 10he third and final filter in Block B is a specialized bandpass filter F LM WF s ð Þ with a peak at 10 Hz.The filter is defined 1,7 using equation (2): Equation (2) has the form given in IEC TR 61547-1, and it represents the frequency response of an average human eye to the flicker signal. 5After these three filters, the input waveform is highly attenuated outside the most effective range of 5 Hz to 30 Hz, which can be seen in the black curve in Figure 2. The digital implementation of these filters is described in more detail in Appendix A. Block C of the light flickermeter is responsible for modelling the eye-brain response to the output signal from Block B. Block C is identical to Block 4 in the IEC 61000-4-15 flickermeter. 5irstly, the signal is squared to implement the nonlinearity of perception of flicker happening in the transfer phase from eye to brain. 9,10After this, the brain memory storage effect is modelled with a first-order low-pass filter defined as: where t LP = 300 ms is the time constant.This filter acts as a sliding mean filter that merges the fast changes in the flicker severity. 10The resulting waveform is the unscaled instantaneous flicker sensation. 5Digital implementation of the filter of Equation ( 3) is described in Appendix A. Maximum instantaneous flicker should get a value of P inst = 1 with illuminance waveform: where d E = 0:006832 is the peak-to-peak amplitude of the sinusoidal modulation at frequency f m = 8:8 Hz. 5 This is achieved by multiplying the filtered signal with a scaling factor S 0 , dependent on filters described above.The output of Block C is the instantaneous flicker sensation P inst . 5Equation ( 4) is later used in creation of the test waveforms.Finally, in Block D, the P LM st value is calculated from the P inst by conducting statistical analysis.This is done by dividing P inst into 2 12 vertical bins and then applying the cumulative distribution function.The P LM st is now calculated as: where P q are the values of P inst above which q% of the P inst values locate. 11Sudden changes in the cumulative probability are considered by smoothing the values.These are notated by suffix S and are smoothed as defined by Equations ( 6) to (9) 11 : 2.2 Stroboscopic effect visibility meter Function of Block A in the SVM meter as can be seen in Figure 3 is the same as in the flickermeter.Block B of the SVM meter takes the temporal light waveform and converts it to frequency spectrum.This is achieved by Hanning windowing and taking the discrete Fourier transform (DFT).Windowing was utilized to remove the effects of spectral leakage in the following Fourier analysis of the spectrum.The spectral leakage in this case would be caused by possible non-integer number of periods of light waveform in the sampled data.As DFT considers the sampled data as a discrete periodic signal, it will join the first and last datapoints together.This will cause a phase-shift in the endpoint boundaries of the signal in the case of sampled data consisting of non-integer number of periods. 12,13anning windowing was selected in this case as it is recommended by both Commission International de l'E ´clairage (CIE) and IEC. 2,6he Hanning window is given as: where n is the sample index and N s is the number of samples. 12In the Aalto SVM meter, windowing was achieved by using Equation (10).
Hanning window achieves the windowing task by reducing the amplitude at both ends of the signal, smoothing the transition from the end of the signal back to the beginning.This windowing in time domain causes the signal to be attenuated and needs a gain correction factor of 2, which was implemented in the code. 12,13ecause Hanning window is used to attenuate both ends of the signal, zero-padding is only utilized to ensure that the measured signal contains an integer number of periods.The Aalto SVM meter utilizes MATLAB built-in peak-finding algorithm, with a minimum peak distance of 1 Hz, as CIE recommends. 2 Block B produces the normalized frequency spectrum C i at frequency f i as the output.
Block C weights the frequency spectrum from Block B with the visibility threshold function for SVM.This is defined as: where a = 0.00518s, b = 306.6Hz, and c = 10 Hz. 6 The threshold function of Equation ( 11) is defined in the range 0 Hz to 2000 Hz.The frequency spectrum C i is divided by T i , which produces the output of Block C. Block D consists of only the summation of the weighted spectrum.SVM value is calculated as: where the summation of Equation ( 12) covers frequency components up to 2 kHz. 6The Aalto SVM meter is designed to be used with longduration light waveform (.20 s) with high sampling frequency (up to 100 kHz).

Anomalies in the IEC recommended implementation of light flickermeter
In the IEC recommended implementation of flickermeter, we found out that there are problems with the implementation of filters in blocks B and C. 7 These were found to be related to the MATLAB functions butter() and filter(), used to create the filtering.Figure 4 compares the analogue response and two digitized responses produced by the Butterworth filters of MATLAB butter() function and by using Tustin's method to create Butterworth filters. 12he filter transfer function given by Tustin's method can be found as Equation (A3) of Appendix A. We see that the signal given by butter() function does not follow the analogue response curve of the Butterworth filter.This is likely due to the way butter() is implemented in the IEC recommended implementation which does not follow the instruction by MATLAB manual. 14o fix these problems, we created a novel MATLAB implementation for the light flickermeter. 15In the Aalto implementation, the filter transfer functions that were earlier created using butter() function were replaced with filter transfer functions using zero-pole-gain (ZPK) representation in Z-domain as described in Appendix A. The digital ZPK filter representation used with Tustin's method accurately follows the analogue response curve of the sixth-order Butterworth filter as can be seen in Figure 4.
We did not find any anomalies on the same scale in the IEC recommended SVM meter as in the IEC recommended light flickermeter, but nevertheless decided to recreate the MATLAB code for M VS following the IEC standard 6 to see if we could produce better results for the SVM meter as well.The Aalto SVM meter 15 was implemented without using any modules of earlier implementations but following the related IEC standard. 6

Avoiding transient effects
In the IEC standard, 5 it is recommended to remove the first 60 s from the P inst data to reduce the effects from the transient period.In IEC TR 61547 Table 1, it is stated that the illuminance adapter in Block A is the dominating factor in the filter's transient response. 5We evaluated the behaviour of the transient period within the modulation frequency ranges of the light flickermeter and stroboscopic visibility meter test waveforms, that is, from 0.3 Hz to 1900 Hz and varying the modulation depth between 0 and 1, using Equation (4).During testing, the actual length of this transient period in the Aalto implementation was found out to be less than 20 s with all the waveforms evaluated.An example result can be seen in Figure 5.Because of this, the Aalto implementation disregards only the first 20 s of the data, instead of the full 60 s as recommended in Reference 5.

Validation of flicker and SVM meter implementations
The validation of the Aalto implementations was conducted with the given test waveforms of the IEC standards 5,6 for the flickermeter and SVM meter.

Flickermeter validation
In the case of light flickermeter, the IEC standard 5 gives five different waveforms defined by their modulation frequencies and their relative modulation amplitudes.Defined waveform parameters are shown in Table 1.
IEC TR 61547-1 gives in Section 8.2 seven factors a = 1/4, 1/2, 1, 2, 3, 4 and 5 for scaling the d E values of Table 1 by multiplication, which in the end gives 35 different test cases for flickermeter validation.The values a are the reference values which the digital implementations should produce for each test case. 5he results for flickermeter validation are shown in Table 2. IEC deviations are mostly negative and Aalto deviations are positive.This difference is due to the internal biases in the implementations.The bias in the IEC implementation seems to change significantly depending on the modulation frequency of the waveform.As waveform 5 has the highest modulation frequency, it also has the highest flicker value resulting in positive deviations.This Aalto flickermeter implementation outperforms the IEC recommended implementation with all reference waveforms.On the average, the deviation is decreased from 20.05 to + 0.003 when moving from the IEC recommended implementation to the Aalto flickermeter implementation.
We also studied the effect of the sampling frequency used for the measurement of light waveform.In Figure 6, the average deviations from the a values are shown as functions of the sampling frequency.Both digital implementations produce similar results for sampling frequencies from 4 kHz to 25 kHz.After 30 kHz, the Aalto implementation starts to outperform the IEC recommended implementation, and at 50 kHz the IEC recommended implementation starts to produce significantly larger deviations than the Aalto implementation.Aalto implementation gives stable results over the 4 kHz to 100 kHz range.At 100 kHz modulation frequency, the average deviation is 0.0028 with the Aalto Implementation.

SVM meter validation
For the SVM meter there are nine different test waveforms. 6These waveforms consist of five square waves (Sqr) and four sinusoidal waveforms (Sin) that are defined by their modulation frequencies and amplitudes.The waveforms and results with the IEC recommended implementation and the Aalto implementation can be seen in Table 3. Except for the highest frequency of 1900 Hz, the deviations of Aalto implementation from the expected values M E VS are considerably smaller than those of the IEC recommended implementation.The absolute values of deviations decreased, on the average, from 0.0074 to 0.0001 for square waves, and from 0.0045 to 0.0010 for sine waves when using the Aalto implementation of the SVM meter.

Conclusions
The currently available MATLAB implementation of the flickermeter recommended by the IEC standard has problems related to the implementation of filters.They were solved by creating a novel Aalto implementation of the flickermeter in MATLAB using robust mathematical methods.Along with the flickermeter, a novel Aalto SVM meter implementation was created following similarly robust methods.
The performance of the IEC recommended flickermeter implementation is highly dependent on the sampling frequency.Up until 30 kHz, both flickermeter implementations work fine, but with sampling frequencies above 50 kHz, the IEC recommended implementation was found not to work as intended.Aalto flickermeter was shown to produce stable results with sampling frequencies up to 100 kHz when using the test waveforms of the IEC standard.
Aalto flickermeter implementation decreased the errors by an order of magnitude, on average, as compared with the IEC recommended flickermeter, when using the test waveforms.In the SVM meter implementation, Aalto SVM meter decreased the average deviation from the target values by almost two orders of magnitude for the test waveforms when comparing to the IEC recommended SVM meter.
for sampling frequency f s = 50 kHz.The sampling frequency in Aalto flickermeter implementation 15 is an input variable and thus, these filters are accurately calculated using the sampling frequency and other exact parameter values every time the script is run.

Figure 1
Figure 1 Drawing of a block diagram of the flickermeter as it is described 5 in IEC TR 61547

Figure 2
Figure 2 Linear scale amplitudes for the filters in Block B, and the total amplitude of all filters

Figure 3
Figure 3 Drawing of a block diagram of the SVM meter as it is described 6 in IEC TR 63158

Figure 4
Figure 4 Response curves for sixth-order low-pass Butterworth filter implementations.Black curve under the dashed red line is the theoretical analogue response

Table 1
5arameters of the five waveforms defined in the IEC standard for the flickermeter validation5 Lighting Res.Technol.2023; XX: 1-10

Table 2
Deviations of the IEC recommended flickermeter and Aalto flickermeter from the target values in absolute units for each five waveforms in Table1Sampling frequency of 50 kHz and waveform length of 200 s were used.Figure6deviations from the expected values when using different sampling frequencies.In each case, the deviation is normalized by the value of a Lighting Res.Technol.2023; XX: 1-10