<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Karl St-Arnaud  on Medium]]></title>
        <description><![CDATA[Stories by Karl St-Arnaud  on Medium]]></description>
        <link>https://medium.com/@karl.starnaud?source=rss-ed6a6df76683------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*QLk1sDeKkCEBvej_</url>
            <title>Stories by Karl St-Arnaud  on Medium</title>
            <link>https://medium.com/@karl.starnaud?source=rss-ed6a6df76683------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 03:22:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@karl.starnaud/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[What the flicker]]></title>
            <link>https://medium.com/@karl.starnaud/what-the-flicker-9cda339729b1?source=rss-ed6a6df76683------2</link>
            <guid isPermaLink="false">https://medium.com/p/9cda339729b1</guid>
            <category><![CDATA[pwm]]></category>
            <category><![CDATA[flickering-lights]]></category>
            <category><![CDATA[stroboscopic-effect]]></category>
            <category><![CDATA[phantom-array-effect]]></category>
            <category><![CDATA[flicker]]></category>
            <dc:creator><![CDATA[Karl St-Arnaud ]]></dc:creator>
            <pubDate>Sun, 18 Oct 2026 02:26:13 GMT</pubDate>
            <atom:updated>2026-11-01T16:09:22.448Z</atom:updated>
            <content:encoded><![CDATA[<h4>Why car headlights seem to flicker out of the corner of your eye</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*fdUe3Z5LXjU1NxTpsiq3Og.png" /></figure><p>You’re stopped at a red light when something suddenly catches your eye out of the corner of your vision. It looks like the light reflected in your side mirror is flashing. You look directly at it, but nothing seems to be flickering; the car behind you doesn’t have flashing headlights.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*WadPMEfpyJUY-WXK5C3OYA.gif" /></figure><p><strong>TL;DR:</strong> No, you’re not crazy; many modern cars use rapid light modulation to control their lights. Human perception of flicker is complex, and while you might not see it when looking directly at a light source, several other factors can make flicker visible under the right conditions.</p><h3><strong>Why do car lights flicker?</strong></h3><p>First, we need to understand the three lighting functions found on most cars:</p><ul><li><strong>Daytime running lights (DRL):</strong> Make the car more visible to other road users.</li><li><strong>Low-beam headlights:</strong> Illuminate the road without causing excessive glare for other drivers.</li><li><strong>High-beam headlights:</strong> Provide greater illumination in dark conditions when other road users won’t be dazzled.</li></ul><p>On older cars, DRLs and low-beam headlights often used the same halogen bulbs, operating at different intensities for day and night. With the widespread adoption of LEDs, their compact size and relatively low cost have made it easier to separate these lighting functions. Their small size also enables sleek lighting patterns that make cars look like they came straight out of the <em>Tron</em> movie.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*MKSZJQuO0yxBBBDb3Vo2wA.png" /><figcaption>Functionality of car headlight</figcaption></figure><p>During the day, DRLs often operate at high intensity to remain visible in bright sunlight, much like turning up your phone’s screen brightness on a sunny day. At night, these lights need to be dimmed to minimize glare for other drivers. One common way to achieve this is through pulse-width modulation (PWM). Instead of supplying a constant current to the LED, the current is rapidly switched on and off, reducing the average light output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*KYHgwSFtsLAOTwU3ndcKWQ.png" /><figcaption>Pulse width modulation (PWM) controls LED brightness by varying the duration of current pulses (Duty-cycle)</figcaption></figure><h3><strong>What is flicker</strong></h3><p>In simple terms, flicker is a rapid variation in a light source’s intensity that can make it appear to flash. Common examples include old film projectors, strobe lights, or a light bulb flickering just before it burns out.</p><p>We often associate flicker with lights flashing very rapidly. This raises an interesting question: <strong>How fast must a light flash before it becomes imperceptible?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*g3OA6ZLbiaeIDzOcrzuDxg.png" /><figcaption>Factors that influence flicker perception</figcaption></figure><p>The answer depends on several factors. The size of the flickering object, its peak light intensity, and its location in our field of view all influence how we perceive flicker. Humans are particularly sensitive to large, high-intensity flickering objects in their peripheral vision [1]. This might explain why a bright LED from the car behind us, seen in our peripheral vision, can suddenly catch our attention. However, we generally find it difficult to perceive flicker above about 120 Hz, even under favourable viewing conditions.</p><h3><strong>What flickering frequency do cars use?</strong></h3><p>Well, I didn’t know the answer, so I decided to experiment myself. I limited my investigation to the car I had available: a 2026 Subaru Uncharted. Unfortunately, my camera wasn’t fast enough to capture the flicker frequency, but the video still shows the DRL flickering at night.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*euYN2UCBmeT6rfp-YLwovQ.gif" /></figure><p>Even if I wasn’t able to find the flicker frequency from the video, I was able to infer the flicker frequency to be 240hz (see explication in phantom arrow effect)</p><h3><strong>What the flicker is going on</strong></h3><p>This is the title of a recent report on flickering lights [2]. Many standard uses of flicker date from the recent past, when flicker beyond 120 Hz wasn’t much of an issue. However, the reality is much more complex. Research over the past two decades has shown that the visual effects of flickering light can remain perceptible at frequencies well above the threshold for direct flicker perception.</p><p>Two particularly interesting phenomena are the <strong>stroboscopic effect</strong> and the <strong>phantom array effect</strong>.</p><h4><strong>Stroboscopic effect</strong></h4><p>This is how you perceive a moving object under flickering illumination. The best way to show it is to move a chopstick very rapidly in front of a flickering light. The movement becomes choppy instead of blurry. Flickering affects how we see a moving object. Studies have shown that the stroboscopic effect can be seen up to 1280hz.</p><h4><strong>Phantom array effect</strong></h4><p>This is how you perceive the flickering object when either your eye or the object is moving. The effect is similar to the stroboscopic effect, except that the flickering light source itself may appear as a series of distinct images rather than a continuous streak. A good example is looking at a car with DRLs; the moving light will show some duplication along its axis of motion instead of a blurry trail. Studies have shown that, on average, the phantom array effect can be seen up to 10,000Hz for the average population and up to 15,000Hz for a sensitive person [4].</p><p>In the picture, you can see six duplications of the light. We acquired the picture with an exposure time of 25 ms. With six duplications, the light turns on and off six times during the 25 ms period. A little math gives us 240 Hz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*11mCE2U_MPFe9xg4yPeYSw.png" /><figcaption>Different effects that make flicker visible</figcaption></figure><h3><strong>Enough science; why is the car flickering only from my side mirror</strong></h3><p>First, flicker in your peripheral vision is always more noticeable because humans are more sensitive to it there. Then, the road is a dynamic environment where objects around you are constantly moving, and your eyes are continuously scanning your surroundings. These movements can make the stroboscopic and phantom array effects more noticeable. However, when you look directly at the headlights, relative motion decreases, making these effects less apparent. Several studies have examined these flicker phenomena over the last two decades, and the automotive industry may need to review past standards using new metrics and knowledge.</p><h3>Reference</h3><p>[1] Brooke Krajancich, Petr Kellnhofer, and Gordon Wetzstein. 2021. A perceptual model for eccentricity-dependent spatio-temporal flicker fusion and its applications to foveated graphics. ACM Trans. Graph. 40, 4, Article 47 (August 2021), 11 pages. <a href="https://doi.org/10.1145/3450626.3459784">https://doi.org/10.1145/3450626.3459784</a></p><p>[2] Miller, N. and Irvin, L., “What the Flicker Is Going on Here? Temporal Light Modulation in Automotive Lighting,” WCX SAE World Congress Experience, Detroit, Michigan, United States, April 16, 2024,<a href="https://doi.org/10.4271/2024-01-2462"> https://doi.org/10.4271/2024-01-2462</a>.</p><p>[3] Małgorzata Perz, Dragan Sekulovski, Ingrid Vogels, and Ingrid Heynderickx, “Stroboscopic effect: contrast threshold function and dependence on illumination level,” J. Opt. Soc. Am. A <strong>35</strong>, 309–319 (2018)</p><p>[4] Kang H, Lee C-S, Lee J, Lee K-M. Phantom array effect can be observed above 15 kHz in high speed eye movement group for high luminance warm white LED. <em>Lighting Research &amp; Technology</em>. 2024;56(7):669–675. doi:<a href="https://doi.org/10.1177/14771535221147312">10.1177/14771535221147312</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9cda339729b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rolling back in time]]></title>
            <link>https://medium.com/@karl.starnaud/rolling-back-in-time-d40ca59f9a5f?source=rss-ed6a6df76683------2</link>
            <guid isPermaLink="false">https://medium.com/p/d40ca59f9a5f</guid>
            <category><![CDATA[cameras]]></category>
            <category><![CDATA[phone]]></category>
            <category><![CDATA[sensors]]></category>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[Karl St-Arnaud ]]></dc:creator>
            <pubDate>Thu, 17 Oct 2024 03:38:16 GMT</pubDate>
            <atom:updated>2024-10-17T03:38:16.506Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*caKeGYCYwhkuVocf" /></figure><p>This picture shows an iPad lying on the floor with a mirror on top of it reflecting the iPad display. The clock reflected in the mirror shows 3 minutes 18 seconds and 983 milliseconds, offset by 17 milliseconds compared to what is displayed on the iPad: 3 minutes 19 seconds and 000 milliseconds. How was this image produced? The answer to the questions is in the first sentence of the results section and explained visually in Figure 3, but before you jump there, think about it.</p><h3>Context</h3><p>About 30 years ago, film cameras were used to take pictures. When the user pressed the button, a shutter inside the camera opened for a fraction of a second, letting the light pass and exposing the film until the shutter closed again. The light created a chemical reaction with the film, imprinting every light reaching the film during the shutter’s opening definitively on the pelicule. In context, if a sports car traveled 30m between the opening and closing of the shutter, the film would have shown a blurry car traveling a distance of 30m.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*UdwEXYciUzFITVmYronwow.png" /><figcaption><strong>Figure 1</strong>: a) Depictation of a camera with film. b) Timing of the stutter opening to take a picture on the 35mm film. c) The car that travels a distance of 30m during the opening of the shutter will appear as a blur over that distance.</figcaption></figure><p>Then came the digital camera, which could imprint the scene content in a digital version of those pellicles. Instead of a chemical reaction, a semiconductor accumulates electric charge as the light reaches the pixel. The first version of digital film to be integrated into cameras was a CCD (Charge-coupled device). As with the film, with the CCD, the complete sensor is exposed simultaneously to light until the sensor enters the reading stage. As depicted in Figure 2, during that stage, every pixel’s charge is transferred to the unique amplifier and analog-to-digital converter, which essentially transforms the electric signal of every pixel into digital information you save on a memory disk. Since every pixel needed to be read sequentially, this process was quite long, resulting in a very slow frame rate if you wanted to capture video, for example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*tu0mFfo6KUohXWixFfdgXw.png" /><figcaption><strong>Figure 2</strong>: Comparison between CMOS and CCD and their reading process.</figcaption></figure><p>CMOS (Complementary metal oxide semiconductor) came as an alternative to CCD with a faster readout time. This is partly achieved by reading the charge value in every pixel in several sequences interleaved with exposure sequences. As shown in Figure 2, the charge of every row is transferred in a reading bus after the exposure stage. During the reading process of that row (referred to as the readout process), the sensor continues to expose the next row. To achieve this, each pixel is equipped with electric circuitry to move the charge out of the pixel and execute readout externally, as shown by the dark square in the corner of each pixel. Instead of exposing the sensor all at once and reading every pixel afterward, which was quite long, the sensor exposes and reads each row individually. Since the exposure isn’t happening simultaneously for each row, a fast-moving car will appear to stretch from top to bottom. CMOS and CCD exposure aren’t instantaneous, so both will show a blurry moving object.</p><p>The readout process described for CCD and CMOS is often called global and rolling shutter. The camera can read one row at a time in rolling shutter mode. Therefore, the timing between the start of exposure of two rows equals the readout time of one row. The readout of one row is generally in the range of microseconds, but when aggregated on a full sensor, the full readout time of one frame can reach a few milliseconds.</p><h3>Results</h3><p>The main photo in the article shows an example of the rolling shutter effect. An iPad Air four was installed on the floor, playing a Chrono video with a frame rate of 60Hz, meaning each image is displayed for ~16 milliseconds (ms). On top of the iPad, a mirror reflects the display. The pixel 4a 5G camera is placed such that the top and bottom rows of the sensor, respectively, image the mirror and the iPad. In the image captured by the camera, one can see that the top of the sensor was captured later compared to the bottom part of the sensor at approximately one screen frame. The scene was taken to have some bright objects in the background to get the exposure time as low as possible and minimize blur on the number displayed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*ZsFnEv5mbvbTz92YNwEbeA.png" /><figcaption><strong>Figure 3</strong>: Display timing compared with the read-out of the camera.</figcaption></figure><p>A second set of captures was taken to validate that a rolling shutter created the timing artifact. The same settings were used for the camera, and a laptop was used as a display with a refresh rate of 60Hz. One capture was taken the same way as the original image, and the other was taken with the camera flipped upside down. On both captures, the timing difference is present, but when the camera is flipped, the time offset is now negative, showing the readout orientation of the sensor. On this second set of captures, the light wasn’t that bright outside, leading to a slightly higher exposure time and a blurrier display.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9mstYZELvTdQr1PUnmFWwg.png" /><figcaption><strong>Figure 4</strong>: The rolling shutter is always applied in the same sensor direction, so the phone’s orientation will change the timing perspective of the picture.</figcaption></figure><h3>Discussion</h3><p>The experimentation presented in this article is a quick demonstration of the rolling shutter effect. In a more controlled and scientific context, there is a more accurate way to measure the impact of a rolling shutter. For example, in the CNET example of the iPhone 15, they use a flickering video displaying a bright and dark pattern to measure the read-out time accurately [1]. Another method DXOmark proposed [2] uses a panel such as the <em>IQL camera timing test </em><a href="https://www.imatest.com/product/iql-camera-timing-test-system/"><em>chart</em></a> to measure the time it takes for an LED to travel from left to right on a display. In the end, keep in mind that the camera itself applies several post-processing setups to correct most of the artifacts created by the sensor.</p><p>The experiment was replicated with a more recent phone, the Pixel 8. It wasn’t possible to reproduce this timing artifact image. The camera is one of the phone features that improve the most every year, and reducing that readout will, of course, create a better picture. For comparison, in the CNET review, the latest iPhone 15 pro showed a rolling shutter of ~5ms [1]. Most smartphone cameras use a stabilization algorithm to correct the rolling shutter effect. For example, if you search “rolling shutter,” most images will show the impact of a rolling shutter with a rotating blade. However, these days, chances are that you won’t be able to capture this artifact as drastically with your phone as they are correcting for it. When testing it with three different phones, it was found that newer phones indeed show lower rolling shutter artifacts, as shown in Figure 5. The pixel 4a 5G still produces the type of rolling shutter common artifact (the blades are bent to the left). Pixel 8 applied severe correction as the experiment showed the display refresh rate syncing with the rotating blade, as shown in Figure 6. Looking at Figure 5, making the following article about white balance might be worth it ;).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*34GKFVOSg5XklX2GazbzJA.png" /><figcaption><strong>Figure 5</strong>: Effect of the rolling shutter of different phones imaging a rotating blade</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*5caEY4xVOpRHhk0BtC0OTg.gif" /><figcaption><strong>Figure 6</strong>: This gif shows the display refresh rate syncing with the blade rotating</figcaption></figure><h3>References</h3><ul><li>[1] <a href="https://www.cined.com/iphone-15-pro-lab-test-rolling-shutter-dynamic-range-and-exposure-latitude/">https://www.cined.com/iphone-15-pro-lab-test-rolling-shutter-dynamic-range-and-exposure-latitude/</a></li><li>[2] Lucie Masson, Frédéric Cao, Clément Viard, Frédéric Guichard, “Device and algorithms for camera timing evaluation,” Proc. SPIE 9016, Image Quality and System Performance XI, 90160G (3 February 2014);<a href="https://doi.org/10.1117/12.2042161"> https://doi.org/10.1117/12.2042161</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d40ca59f9a5f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How does your wearable device measure elevation; a sensor story]]></title>
            <link>https://medium.com/@karl.starnaud/how-does-your-wearable-device-measure-elevation-a-sensor-story-62b4ef096879?source=rss-ed6a6df76683------2</link>
            <guid isPermaLink="false">https://medium.com/p/62b4ef096879</guid>
            <category><![CDATA[garmin]]></category>
            <category><![CDATA[cycling]]></category>
            <category><![CDATA[gps]]></category>
            <category><![CDATA[wearables]]></category>
            <category><![CDATA[sensors]]></category>
            <dc:creator><![CDATA[Karl St-Arnaud ]]></dc:creator>
            <pubDate>Mon, 22 Jan 2024 03:54:34 GMT</pubDate>
            <atom:updated>2024-01-22T03:54:34.572Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ealRGLItPKL91SEZIXMXuQ.jpeg" /></figure><p>If you regularly run, bike, or perform any outdoor activities, good chances are that you log your activities using an application such as <a href="https://www.strava.com/">Strava</a>, <a href="https://connect.garmin.com/">Garmin Connect</a>, etc. (You know, it doesn’t count if it is not on Strava). Nowadays, everyone has with them a complete set of sensors that measure a quantity of data that wouldn’t have been imaginable 20 years ago (shout out to the <a href="https://en.wikipedia.org/wiki/MEMS">MEMS</a>).</p><p>Personally, I enjoy going for long bike rides with my friends. After our rides, we are often amazed by the difference in our recorded elevation between us, even though we rode together. As a developer specializing in sensor integration, I always wanted to write about the subject. After reviewing our ride at <a href="https://www.facebook.com/groups/168205783562658/user/100076236188746/">Annie’s Flatland</a> (probably the most underrated Quebec gravel event), I decided to do it. That day, two friends and I rode the same path and ended up with a very different elevation value ranging from 824m to 1334m, as shown in Figure 1. In concrete terms, rider A exceeded the top of the <a href="https://climbfinder.com/en/climbs/alpe-d-huez">Alpe Duez segment</a> (~1120m elevation) that day, while rider C couldn’t reach the 3/4, which represents 1.5 times the height of the Eiffel Tower (no, I am not writing that article because I am mad to be the rider C).</p><p>There are already a lot of similar articles on the web. This one reviews the subject from an engineering point of view, looking at the sensors themselves and how they process data. The goal of the following three sections is not to compare wearable devices but to explain why the values they report differ:</p><ol><li>Theory: Review how wearable devices collect and process altitude data.</li><li>Experimentation: Review data collected with five wearable devices</li><li>Flatland: Review the original data</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K6_OaK6H9RdFqAKAGRvQVA.png" /><figcaption>Figure 1: Over 150 km, riders A and C measured a difference of 510 m altitude, representing 1.5 times the height of the Eiffel Tower.</figcaption></figure><h3>Theory</h3><p>Wearable devices and sensors will be used in this article using the following definition:</p><ul><li>Sensors: Any type of sensor (e.g., barometer, GNSS, etc.)</li><li>Wearable device: Collection of sensors encapsulated in a device that can be used by the user (e.g., Wahoo Elemnt Bolt, Garmin Edge, etc. )</li></ul><h4>What is altitude?</h4><p>It might sound silly, but when you read that Mount Everest is at an altitude of 8849 m, have you ever asked yourself from which reference point the altitude was measured? The main answer is according to the sea level, but is the sea level equal all around the globe? Measuring altitudes on the Earth is done according to two main reference models depicted in Figure 2.</p><ul><li>Geoid: This is the most precise model of the Earth’s reference altitude. It considers the difference of gravity all around the globe. This system is equivalent to the sea level, as depicted in Figure 2. The best way to visualize the Geoid model is to imagine the form the Earth would settle in if it was covered in water.</li><li>Ellipsoid: This is an approximation of the Geoid using an ellipsoidal model. The most commonly used model by GNSS devices is the ellipsoid <a href="https://en.wikipedia.org/wiki/World_Geodetic_System">WGS84</a>.</li></ul><p>Different models of Geoid and Ellipsoid exist, which are usually measured to give better accuracy over some areas of the world. The Ellipsoid and Geoid differences are exaggerated in the figure below, but the difference usually varies by a few meters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-vx_HPKXaRtW5WFkE2gE-w.png" /><figcaption>Figure 2: Depiction of the Geoid and Ellipsoid model used as a reference to measure altitude.</figcaption></figure><h4>Sensors</h4><p>There are two main ways to measure altitude using relatively affordable sensors that can fit on a wearable device:</p><ul><li>Global Navigation Satellite System (GNSS): Using satellites to triangulate your position (latitude, longitude, altitude)</li><li>Barometer: Using the direct correlation between altitude and pressure.</li></ul><p>Wearable devices will mainly use either or both of these sensors to evaluate the altitude. With the improvement of these wearable devices every year, they might use more sensors in the following years.</p><p><em>GNSS / GPS parenthesis</em></p><p><em>GNSS is more representative of the system that wearable devices use today. </em><a href="https://fr.wikipedia.org/wiki/Global_Positioning_System"><em>“Global Positioning System” (GPS)</em></a><em> is a more commonly used term that only encompasses satellites from the United States. GNSS is a broader term that includes all the global satellite positioning systems: </em><a href="https://fr.wikipedia.org/wiki/GLONASS"><em>GLONASS</em></a><em> (Russia), </em><a href="https://fr.wikipedia.org/wiki/Beidou"><em>Beidou</em></a><em> (China), and </em><a href="https://fr.wikipedia.org/wiki/Galileo_(syst%C3%A8me_de_positionnement)"><em>Galileo</em></a><em> (European Union).</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/240/1*RPFWYsReSn3OgR0D7qDCsg.gif" /><figcaption>Figure 3: GNSS measures the position using the available visible satellite (dark dot with green line) from the observer’s point of view (https://commons.wikimedia.org/wiki/File:ConstellationGPS.gif).</figcaption></figure><p><strong>GNSS</strong></p><p>As shown in Figure 3, at every moment, the GNSS chooses the signal from the satellites directly viewed by its antenna and determines its position (latitude, longitude, and altitude) according to the ellipsoid WGS84. Multiple factors influence the GNSS error:</p><ol><li>Location &amp; Environment: Large buildings can obstruct or reflect the signal in the city.</li><li>Number and position of the visible satellites</li><li>Atmospheric condition</li><li>Device and Antenna: Some GNSS device can improve accuracy by collecting more precise information (e.g., signal phase). Some antennas are also compatible with multiple frequencies, which can improve the resolution.</li></ol><p>Because of all these factors, giving an exact value for the uncertainty of wearable GNSS devices is difficult. From a short literature review, a good rule of thumb is to expect an accuracy of a few meters for longitude and latitude at most (e.g., you shouldn’t expect your GNSS to know on which road lane you are). For altitude, the error will generally be twice the error on the longitude and altitude axis [1, 2] because the mathematical resolution along the altitude axis is not as constrained. One example of this lack of constraint is that the GNSS only sees satellites in the upward direction; downward satellites are not visible because the Earth blocks them.</p><p><strong>Barometers</strong></p><p>Barometer data determine the altitude based on the direct correlation between altitude and air pressure. Usually, the altitude of 0 m corresponds to the pressure at sea level (Geoid).</p><p>The main factors influencing the barometer are temperature and weather changes. Nowadays, thermometers placed in wearable devices will help compensate for weather changes. Weather changes will also create variations in air pressure, which the sensor can misinterpret as an elevation change. Humidity and obstruction (e.g., dust from the road) are other factors that might influence the sensor by partially blocking the device’s entry (usually a tiny hole of a few mm on your device).</p><p><strong>Precision / Accuracy</strong></p><p>The GNSS will generally present a better accuracy, while the barometer has a better precision. Combining those two is to take advantage of each sensor’s capabilities.</p><ul><li>Precision (variance): The repetition of multiple captures will give values close to each other. However, it doesn’t guarantee an overlap with the expected ground truth.</li><li>Accuracy (bias): The average of multiple captures will overlap well with the expected ground truth. However, the different captures might be very sparse.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DvIcYKkepQzls8dQeETW2g.png" /><figcaption>Figure 4: Illustration of accuracy and precision for GNSS and barometers</figcaption></figure><h4>Process</h4><p>The Last section discussed the sensors and their physical sources of errors. One of the primary sources of error comes from the difference in the process of raw data between wearable devices. To illustrate that process, Figure 5 divides it into five individual sub-processes (yellow boxes).</p><p><strong>Sensor drivers (1, 2, 3)</strong></p><p>The software layer controls the sensor hardware using basic communication protocols (GPIO, I2C, SPI, UART). The sensor driver sets the registered value and interprets the raw reading value into comprehensible data for the user to manipulate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*89sm0Ai67KjpgJ-AvCmzjQ.png" /><figcaption>Figure 5: Data flow from the sensor to final elevation measurements.</figcaption></figure><p>Sensor driver’s operations will mainly include:</p><ul><li>Set intrinsic calibration (scaling parameter that translates raw value into physically meaningful value)</li><li>Initialise hardware with specific configuration parameters (mode of acquisition, frequency per second (FPS), power mode)</li><li>Process the raw reading into user-interpretable data.</li></ul><p>These interactions are highly customizable by the wearable device provider and can add variability between them. For example, one could use a low-power mode to maximize battery usage and, in return, degrade accuracy.</p><p><strong>Combine sensor data (4)</strong></p><p>Each wearable device will use its strategy to combine GNSS and barometer data, resulting in variability between devices. One source of error generated here comes from the GNSS using the ellipsoid model as reference altitude, while the barometer uses the geoid model.</p><p>When barometer data are available, they will be used as the primary source to measure altitude with minor GNSS correction when the signal is deemed valid. The barometer measurement’s significant contribution and error are depicted in Figure 5 by the pink arrow. Using a barometer is a good strategy, as most wearable device users are interested in the delta of altitude, not the altitude itself. Precision is much better than accuracy when the delta of the measured value is more important. The best way to convince yourself is to draw a path between all the dark red points of Figure 4. The higher precision quadrant is very rapid to draw, representing the delta near 0 as expected for a static point.</p><p><em>Barometer / Altimeter parenthesis</em></p><p><em>Some wearable device specifications mention the presence of a barometer and altimeter sensors. On wearable devices, these are the same physical sensors that measure air pressure. The sensor provides a value for air pressure, and based on data interpretation, the data are either logged as altimeter or barometer data [3].</em></p><ul><li><em>Altimeter: All pressure variations are counted as an elevation change regardless of the weather. Perfect for a clear day on a mountain.</em></li><li><em>Barometer: This approach considers weather change as a possible influence of pressure variation. Excellent for cloudy days in the prairies.</em></li></ul><p><strong>Calculate elevation from altitude data (5).</strong></p><p>Most wearable devices use an altitude measurement frequency of 1Hz (1 measurement / second). Then, the simplest way to get the elevation value is to sum all the positive deltas of altitude. However, most applications will apply different strategies to filter the noise further. For example, Strava only adds elevation to the final count if the increase is continuous over a certain threshold [4]. The device itself often applies this process.</p><h3>Experimentation</h3><p>Five wearable devices were installed on the bike to capture latitude, longitude, and altitude over five loops in a <a href="https://maps.app.goo.gl/7EpdvFPkTrQRF5BR7">Parc Federick back</a>. Custom-built GNSS and barometers were used as control data.</p><ol><li><a href="https://www.devicespecifications.com/en/model/ac9f549d">Pixel 4a (5g)</a>: Running Strava 337.10; Android version 13</li><li><a href="https://www.garmin.com/fr-CA/p/541225">Forerunner735xt</a>: Garmin Connect 4.73.4; watch software version 9.80; <a href="https://support.garmin.com/en-CA/?faq=R4I5hFFcUk8gJPC4zi0Xv6">Elevation correction</a> on Garmin Connect is disabled (to use raw GPS data)</li><li><a href="https://support.wahoofitness.com/hc/en-us/articles/115000527644-Original-ELEMNT-and-BOLT-Information-and-Setup">Custom GPS</a>: Duinopeak NEO-6M GPS Shield; using <a href="https://www.arduino.cc/reference/en/libraries/neogps/">NeoGPS</a> to read the data; the device was available from a previous project (more details here); the device has a larger antenna than a usual wearable device</li><li><a href="https://support.wahoofitness.com/hc/en-us/articles/115000527644-Original-ELEMNT-and-BOLT-Information-and-Setup">Wahoo Elemnt Bolt V1</a>: Elemnt Bolt 0655; version: WB15–16525</li><li>Custom barometer: <a href="https://www.bosch-sensortec.com/products/environmental-sensors/pressure-sensors/bmp280/">BMP280</a>; using `<a href="https://github.com/adafruit/Adafruit_BMP280_Library">Adafruit_BMP280</a>` to read the data</li></ol><p>For devices 1, 2, and 3, the data were extracted directly from the <em>fit</em> file and CSV files for devices 4 and 5. The results for every wearable device are presented in different colors and shades for every lap in Figure 6. Every lap was overlapped using the distance relative to the starting point.</p><p>Some data captured with GNSS-only sensors had to be discarded because they were too noisy.</p><ul><li>Lap 1 for custom GPS</li><li>Lap 1 and 2 for Forerunner735xt</li></ul><p>Interestingly, it is mentioned in the integration manual of the Ublox <a href="https://www.u-blox.com/en/product/neo-6-series?legacy=Current#Documentation-&amp;-resources">Neo-6M</a> (2) that the unit is performing continuous calibration and recommends a specific driving sequence of a few minutes at the beginning to achieve a good calibration. Such a calibration procedure could also explain why the Forerunner 735xt had difficulty on the first two laps (~10km).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4uBwEAFYfkW_nWNgpkg5HA.png" /><figcaption>Figure 6: Altitude data from five devices over five park laps.</figcaption></figure><p>Since there is a large data variability across the different devices, Google Earth was used as a reference to get an idea of the expected altitude range of the park (lowest and highest point were simply extracted manually from Google Earth). Figure 6 shows that GNSS-only devices provide better accuracy with altitude values that overlap the most with the expected range. However, their reading is imprecise, with significant altitude variations between laps.</p><p>The Wahoo <a href="https://support.wahoofitness.com/hc/en-us/articles/115000441324-Why-are-there-Elevation-differences-in-my-ride-data-">documentation</a> stipulates that the barometer mainly uses minor GNSS correction when the signal is reasonable. The data from the Elemnt Bolt are very close to the custom BMP, showing that the sensor mainly uses the barometer.</p><p>The Pixel 4a shows different results compared to other sensors. The phone was placed in the back pocket of the cycling jersey. The reading might have been affected by the obstruction of the jacket or even the humidity of the cyclist.</p><p>In the end, this graph, combined with Figure 4, greatly shows the complementarity between the barometer and the GNSS sensor.</p><h3>Flatland</h3><p>Returning to the Flatland day, each rider started and ended simultaneously and followed each other closely along the way. For this reason, each rider’s data were overlapped base on the time of every device.</p><p>All the data were extracted from the <em>fit</em> file of every rider.</p><ul><li>Rider A -&gt; <a href="https://www.hammerhead.io/products/hammerhead-karoo-2">Hammerhead Karoo 2</a></li><li>Rider B -&gt; <a href="https://www.garmin.com/fr-CA/p/621232">Garmin Edge 830</a></li><li>Rider C -&gt; Wahoo Elemnt Bolt WFCC3 V2</li></ul><p>The graph below shows every altitude reading from the <em>fit</em> file and the Google Earth elevation value for reference only (extracted using Google Cloud API).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ud3usrNNPaqsydSoVjeUOA.png" /><figcaption>Figure 7: Altitude profile for riders A-C</figcaption></figure><p>Something worth mentioning here is the temperature delta throughout the day. We started that day at 17C in the parking lot and ended at 29C in the exact location. Here, we can see the temperature effect on the barometer with all devices starting at an elevation near 40 m and ending their journey near 60 m altitude. Other factors, such as humidity and dust, could have contributed as we were doing gravel bikes that day (dust and mug).</p><pre>Table 1<br>╔═══════════════╦═══════════════════╦═══════════════════╗<br>║               ║   Raw elevation   ║ Process Elevation ║<br>╠═══════════════╬═══════════════════╬═══════════════════╣<br>║ Rider A       ║ 1845 m            ║ 1334 m            ║<br>║ Rider B       ║ 1160 m            ║ 1055 m            ║<br>║ Rider C       ║ 1128 m            ║ 824 m             ║<br>║ Google earth  ║ 2037 m            ║ ------            ║<br>╚═══════════════╩═══════════════════╩═══════════════════╝</pre><p>The raw elevation was measured for each rider, taking the most straightforward process (sum of every positive altitude difference). As shown in Table 1, the raw elevation of riders B and C are very similar. However, there is a significant difference after the elevation process (block 5, figure 5). This difference is entirely independent of the sensor and is a question of how the data are processed. The Wahoo reading also has an ascent field, which was used with the expectation of reversing the engineering of the elevation process. However, data processing showed a mismatch between the last ascent value and the total elevation, which is attributable to a software error in the Wahoo device [6]. That highlights that the complete process is also subject to errors that could come from the software development releases.</p><h3>Conclusion</h3><p>The take-home message of this article in a few statements is:</p><ol><li>Wearable devices are generally equipped with GNSS and barometers, respectively, providing complementarity between accuracy and precision.</li><li>Most wearable devices with barometers will use this sensor as their primary data source to measure elevation, making altitude very sensitive to weather, temperature, humidity, and dust.</li><li>Variations in the implementation of the process of every wearable brand and the source of error of each sensor will cause elevation differences.</li></ol><p>In this article, I mainly focus on Barometer and GNSS. However, other sensors could be used to improve the accuracy further. For example, today’s wearables also have an <a href="https://en.wikipedia.org/wiki/Inertial_measurement_unit">Inertial Measurement Unit (IMU)</a>, which can also be combined with the sensor set to improve accuracy further.</p><p>As a sensor developer, I am always curious to learn more about different sensors to find the best way to use and process them. While writing this article, I needed much research to back up my initial knowledge. Feel free to comment to encourage the discussion.</p><p>Science is not a source of truth; it’s a discussion workflow that helps model the truth.</p><h3>References</h3><p>[1] <a href="https://iopscience.iop.org/article/10.1088/1361-6501/ab8a7d/meta#mstab8a7ds2">https://iopscience.iop.org/article/10.1088/1361-6501/ab8a7d/meta#mstab8a7ds2</a></p><p>[2] <a href="https://www.frontiersin.org/articles/10.3389/fpubh.2014.00021/full">https://www.frontiersin.org/articles/10.3389/fpubh.2014.00021/full</a></p><p>[3] <a href="https://support.garmin.com/en-US/?faq=d7G0fSGGJ98l1ZH9dyglZ6">https://support.garmin.com/en-US/?faq=d7G0fSGGJ98l1ZH9dyglZ6</a></p><p>[4] <a href="https://support.strava.com/hc/en-us/articles/115001294564-Elevation-on-Strava-FAQs">https://support.strava.com/hc/en-us/articles/115001294564-Elevation-on-Strava-FAQs</a></p><p>[5]<a href="https://support.wahoofitness.com/hc/en-us/articles/115000410550-ELEMNT-BOLT-v1-2017-Firmware-Release-Notes">https://support.wahoofitness.com/hc/en-us/articles/115000410550-ELEMNT-BOLT-v1-2017-Firmware-Release-Notes</a></p><p>[6] <a href="https://support.wahoofitness.com/hc/en-us/articles/115000410550-ELEMNT-BOLT-v1-2017-Firmware-Release-Notes">https://support.wahoofitness.com/hc/en-us/articles/115000410550-ELEMNT-BOLT-v1-2017-Firmware-Release-Notes</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62b4ef096879" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>