Skip to content
Blueprint Technologies - Data information specialists
Main Menu
  • What we do

      Artificial Intelligence

      Intelligent SOP
      Generative AI
      Video analytics

      Engineering

      Application development
      Cloud & infrastructure
      Lakehouse optimization

      Data & Analytics

      Data platform modernization
      Data governance
      Data management
      Data migration
      Data science & analytics

      Strategy

      TCO planning
      Productization
      Future proofing
  • Industries

      Manufacturing

      Enhance productivity and efficiency through tailored technology solutions, optimizing processes, and drive innovation in manufacturing operations.

      Retail

      Revolutionize customer experiences through innovative technology solutions for seamless shopping journeys and enhanced retail operations.

      Health & Life Sciences

      Advance healthcare outcomes and pharmaceutical innovations through cutting-edge technology solutions and data-driven strategies.

      Financial Services

      Empower financial institutions with secure and scalable technology solutions, driving digital transformation, and personalized customer experiences.

  • Databricks

      Databricks
      Center of Excellence

      Maximize your Databricks experience with our comprehensive Center of Excellence resources and support.

      QuickStarts

      Proof-of-value projects designed to get you started quickly on Databricks.

      Accelerated Data Migration

      Regardless of the source, we specialize in migration your data to Databricks with speed and quality.

      Unity Catalog Migration

      Accelerate your UC migration and minimize errors with our meticulously tested Brickbuilder approved solution.

      Lakehouse Optimizer

      Get higher return on your investment and minimize your total cost of ownership with self-facilitated optimization.

      Accelerated Snowflake to Databricks Migration

      Unlock increased cost savings, heightened operational efficiency, and enhanced analytical capabilities. 

  • Our work
  • Insights
  • About

      Our Approach

      Discover our holistic approach to uncovering strategic opportunities.

      Careers

      Explore exciting career opportunities and join our team today.

      News

      Get the latest updates and insights about our company.

      Events

      Stay updated on upcoming events and webinars.

      Our Partners

      Get to know our trusted technology partners and collaborators.

Connect
Blueprint Technologies - Data information specialists

Explainable signal smoothing with Fourier analysis opens doors for user customization

By Cori Hendon

Signal smoothing is not a new concept, but it is still being used in many cutting-edge applications. At its core, signal smoothing represents a variety of algorithms used to remove the noise from a data set to reveal important patterns. A wide variety of techniques are available for smoothing out your data — from simple algorithms like moving averages and polynomial splines to Kalman filters and RDP decimation.

All those methods will smooth your signal data for sure, but one question always surfaces — “Is this the right amount of smoothing?”

NASH Video Analytics

We recently encountered an example of this while developing NASH, Blueprint Technologies’ video analytics product. As with any detection algorithm, we had noise in our signal, making insights and behaviors much harder to identify. A simple example of this would be when a video analyst wants to see all parts of a video where more than 20 cars were visible at an intersection. A simple threshold request, but one riddled with challenges from noisy data.

Raw data for smoothing

Raw detection data from a stationary camera monitoring an intersection at about 30 frames per second. The red circle shows a simple example of how the noise can be problematic for analysts searching for threshold events.

Explore simple solutions fast

The data science team at Blueprint Technologies embraces an agile development philosophy because we understand that the fastest path to meaningful, useful solutions is through iteration and feedback. We began the NASH signal smoothing process with two simple solutions to achieve quick results with the idea of iterating further from there. We began with moving averages and spline interpolation with sampling.

Moving averages

Noisy raw data with moving average smoothing

Moving averages gave clear feedback. The data was smoother, but it still wasn’t “smooth-smooth.” The initial response from our data scientists was to increase the window size for the convolution function, but that came with its own set of challenges:

  1. Can we choose a window size that works for every user?

  2. Can we explain this to users in a way that allows them to then know how to choose their own window size?

Cubic spine interpolation with sampling

Noisy raw data with cubic spline smoothing

Cubic spline interpolation with sampling produced similar results with a few new pros and cons. The results were smoother than those achieved using the moving averages option thanks to the continuous derivatives, but that introduced new noise into the data, also thanks to the continuous derivatives. Regardless, we were still stuck with the same two challenges as moving averages: window size/sampling frequency and explainable configurations. Also, choosing a sampling frequency means potentially throwing out a bunch of data. You can work around these information loss issues by using detection confidence scores to guide which frames to keep, or even layering your sampling on top of the rolling mean smoothing so you keep the information around, but then you have to choose a window for smoothing and choose a sampling frequency.

Designing solutions for our users

At the end of the day, it doesn’t matter how cool of an algorithm we come up with to implement some exciting smoothing math. What matters is smoothing the data in a way that allows our users to solve the problems that are important to them. The difficulty is that there is no one-size-fits-all solution here. We needed to create a smoothing parameter for our users, but we needed to do it in a way that made sense to them intuitively.

Fourier analysis

To accomplish this, we looked to Fourier analysis. By asking the user about the timescale of their analysis, we can filter out frequencies in our signal that are too high for that timescale. A simple example is finding behaviors like traffic jams. A very short occurrence of many cars in the video would not be considered a jam on its own (high-frequency events) but a sustained high count might (low-frequency events). With simple examples like this, we are able to explain to our users this behavior timescale concept and have them choose the timescale for their analysis.

We accomplish this with Fourier analysis tools. The premise of Fourier analysis is that you can represent a function (or discrete time series) as a sum of many sine and cosine functions reasonably well, as long as you use enough of them.

Fourier Series

Fourier Series definition from Wikipedia

Example of Fourier Convergence.gif

A plot showing the convergence of a Fourier series to a relatively arbitrary function as more terms (N) are included in the approximation. Notice that it only takes about 10 or so terms to roughly match the shape of the underlying function. As you continue to include more terms with N>10, we gradually match the shape better, but we start to see what looks like high frequency “noise” near discontinuities (this is called the Gibbs phenomenon.) Source: Wikipedia

Signal processing and filters

Fourier tools have been used in the signal processing world for decades, and they have come up with some great tools we can borrow. For this task, we designed a filter for our signal that cut out the noise (high frequency) and kept the larger trends (lower frequency). The cool part about these filters is that they work similarly to moving averages: by convolution of our signal with a window function. All we are changing is how we build our window function.

If you haven’t read up on creating these frequency filters from scratch before, you can see more detail here. To summarize the process, we can build a frequency cutoff into our filter using a relatively simple sinc function multiplied with a Hamming window (or another attenuation window of your preference) to reduce the ringing effects of discontinuities in a truncated sinc filter.

We asked our users to provide the understandable behavior timescale and constructed our frequency cutoff using that and the sampling frequency, which in this situation, was the frames per second of the video data if you are using all frames of the feed.

Smoothing equation

After we had the custom cutoff frequency, we constructed a standard lowpass filter with a standard sinc function multiplied by our preferred ring-reducing window function – Hamming.

Hamming equation

Putting the math together, we plotted the windowed-sinc filter kernel and its frequency response given by a Fourier transform. From there, we could see from the plots that the frequency response did not allow frequencies greater than the cutoff frequency indicated by the dashed red line. The discussion could continue from here to include the transition bandwidth (how steep is the cutoff approximation to the discontinuity we theoretically wanted), but we’ll leave that rabbit hole for another day.

Frequently response and filter kernels

On the left, we have a window filter kernel computed as the product of a sinc function (including information about the user’s preferred frequency cutoff) and a hamming window. On the right, we have the frequency response of the filter, which shows low frequencies (less than) are passed through and higher frequencies (greater than) are stopped. Fft stands for fast Fourier transform and ifft stands for inverse fast Fourier transform. Transforms were computed with a standard numpy package.

Results

With a custom low-pass filter set to a timescale of 20 seconds, we were able to reduce the noise, making it so the threshold is no longer surpassed, and the user can continue with their actual objectives, identifying insights and behaviors from their video footage, instead of wasting time wiggling sliders to adjust mystery parameters like “window size” or “sampling frequency.”

Lowpass filter of noisy raw data

Beyond creating this simple-to-visualize threshold example, there are many downstream processing events dependent on this smoothed data that share the same dependence on the user’s timescale. With this functionality Blueprint incorporated, NASH users are also able to apply it in other areas, such as the identification of patterns, behaviors and similarities to other processed videos. This appropriate-for-the-analysis smoothing is a critical component of any analysis workflow in NASH.

At Blueprint, the experience and expertise of our diverse team of data scientists are paramount in our customer-focused agile approach to delivering data science results. From bleeding-edge deep learning architectures to domain-specific tools and algorithms like the one described within this blog, Blueprint’s data scientists work together to deliver solutions to real business challenges.

Share with your network

You may also enjoy

Classic vs. Serverless: Exploring Databricks’ latest Innovations

Explore the benefits of Databricks’ serverless solutions, which simplify resource management, improve productivity, and optimize costs. Discover key insights and best practices to enhance your data strategy with cutting-edge serverless technologies.

Help for FinOps Leaders – How the Lakehouse Optimizer can assist with your Lakehouse 

Discover how FinOps leaders manage cloud and data costs effectively while maximizing business value. Learn how the Lakehouse Optimizer (LHO) addresses common business problems through discovery, optimization, and operation.
Blueprint Technologies - Data information specialists

What we do

  • Generative AI
  • Video analytics
  • Application development
  • Cloud and infrastructure
  • Data platform modernization
  • Data governance
  • Data management
  • Data science and analytics
  • TCO Planning 
  • Productization
  • Future Proofing
  • Intelligent SOP
  • Lakehouse Optimization
  • Data Migrations
  • Generative AI
  • Video analytics
  • Application development
  • Cloud and infrastructure
  • Data platform modernization
  • Data governance
  • Data management
  • Data science and analytics
  • TCO Planning 
  • Productization
  • Future Proofing
  • Intelligent SOP
  • Lakehouse Optimization
  • Data Migrations

Industries

  • Manufacturing
  • Retail
  • Health & Life Sciences
  • Financial Services
  • Manufacturing
  • Retail
  • Health & Life Sciences
  • Financial Services

Databricks

  • Databricks Center of Excellence
  • QuickStart Offerings
  • Accelerated Data Migration
  • Accelerated Unity Catalog Migration
  • The Lakehouse Optimizer
  • Accelerated Snowflake to Databricks Migration
  • Databricks Center of Excellence
  • QuickStart Offerings
  • Accelerated Data Migration
  • Accelerated Unity Catalog Migration
  • The Lakehouse Optimizer
  • Accelerated Snowflake to Databricks Migration

About

  • Our approach
  • News
  • Events
  • Partners
  • Careers
  • Our approach
  • News
  • Events
  • Partners
  • Careers

Insights

Our work

Support

Contact us

Linkedin Youtube Facebook Instagram

© 2024 Blueprint Technologies, LLC.
2600 116th Avenue Northeast, First Floor
Bellevue, WA 98004

All rights reserved.

Media Kit

Employer Health Plan

Privacy Notice