blSignalProcessing — Fast Fourier Transforms and signal processing using OpenCV

This entry is part 13 of 17 in the series blImageAPI -- BarbatoLabs Image API

Introduction

Signal processing is the technical area that deals with encoding/decoding information into/from discrete or continuous signals of any kind. Signals of interest could be coming from images, sounds, mechanical motion, celestial bodies, bacterial systems, or just about anything you can name, thus making signal processing a very important field of science.

Over the past decades, many algorithms and tools have evolved to analyze signals, of which the Fast Fourier Transform (fft) is one of the most used ones.

In this short article I collect all the different algorithms I have and will develop to use the OpenCV for signal processing  (based on my blImageAPI).

List of functions

Here I list the current functions I have included so far. The list will grow, so make sure to come back for updates.

Note: The images can be of different types and size

  1. fft2

    1. Takes the fast forward fourier transform of an image and stores it into a destination image of different type. It can carry out a 2d fft on the whole image, or a 1d fft on the individual rows.
    2. There are two versions of this function, one for when the images are of different type, and one where the images are of the same type, which skips an extra copying step.
  2. ifft2

    1. Takes the inverse fast fourier transform of an image and stores it into a destination image of different type. It can carry our a 2d ifft on the whole image, or a 1d ifft on the individual rows.
    2. There are two versions of this function, one for when the images are of different type, and one where the images are of the same type, which skips an extra copying step.
  3. fftPowerSpectrum

    1. Calculates the power spectrum of a fast fourier transform image of one type and saves it as a destination image of another type
  4. fftPowerSpectrumAndShift

    1. Calculates the power spectrum of a fast fourier transform image of one type and saves it as a destination image of another type. It then shifts the image as to center the frequencies with the zero frequencies being placed at the center of the destination image (some people prefer to see it that way)
  5. SimpleRowLowPassFilter

    1. Takes an image of any type and size, and runs each row through a simple low pass filter.
  6. SimpleRowHighPassFilter

    1. Takes an image of any type and size, and runs each row through a simple high pass filter.
  7. SimpleColLowPassFilter

    1. Takes an image of any type and size, and runs each column through a simple low pass filter.
  8. SimpleColHighPassFilter

    1. Takes an image of any type and size, and runs each column through a simple high pass filter.

The code

I have put all the functions in a file called blSignalProcessing.hpp which follows:

blSignalProcessing.hpp (Click to see…)

About Vincenzo Barbato

Known to his friends as Enzo, he's an outside-the-box engineer/researcher whose interests and expertise span many fields, including controls systems, multi-physics simulations, mechatronics, oil technologies, data analysis and machine vision just to name a few.

Refusing to grow up, he's on a continuous journey to develop simple and creative solutions that have the power of disrupting industries by optimizing systems and processes.

Married to a beautiful wife, with two beautiful daughters and two identical twin boys, his home is a never ending chaotic fountain of inspiration.

His outlook on life:

"Never blindly accept what you're told, listen, but then question, with curiosity, creativity and collaboration we can change the world"

About Enzo

Known to his friends as Enzo, he's an outside-the-box engineer/researcher whose interests and expertise span many fields, including controls systems, multi-physics simulations, mechatronics, oil technologies, data analysis and machine vision just to name a few. Refusing to grow up, he's on a continuous journey to develop simple and creative solutions that have the power of disrupting industries by optimizing systems and processes. Married to a beautiful wife, with two beautiful daughters and two identical twin boys, his home is a never ending chaotic fountain of inspiration. His outlook on life: "Never blindly accept what you're told, listen, but then question, with curiosity, creativity and collaboration we can change the world"

Leave a Reply

Your email address will not be published. Required fields are marked *