## Sensor Fusion controller using Fuzzy Logic approach (software implementation)

##### Description and architecture

In this systems, the sensors are read under interrupt, while some low-speed processes are executed under a 1 sec repetitive timer. The interrupt rates vary, from a few tens of ms  (light measures)  to completely arbitrary rates (motion detection) or very long periods (Heart Rate value). Hence I had to defined software components at 2 layers Continue reading “Sensor Fusion controller using Fuzzy Logic approach (software implementation)”

## Sensor Fusion controller using Fuzzy Logic approach (Design choices)

Following the previous article, I now concentrate on design choices and implementation.

The  device was an OHRM gadget, so there was already some sensors available which could be used: Continue reading “Sensor Fusion controller using Fuzzy Logic approach (Design choices)”

## Sensor Fusion controller using a Fuzzy Logic approach (intro)

The recent rise of MEMS and Microsensors have posed a new and interesting problem to designers. Before MEMS, you barely had one temperature sensor, maybe one pressure sensor in your system. Then you would put some code around … Et Voila ! your device was capable of measuring Temperature and Pressure. Continue reading “Sensor Fusion controller using a Fuzzy Logic approach (intro)”

## FFT based frequency calculation (implementation)

In a previous article I described the goal, which was to do a simple tool to measure the fundamental frequency of a simple sine wave. In this article, I describe the implementation, which is based on 2 open source libraries:

1.  lib FFTW for Fourier calculation
2. libsndfile for wav file parsing

## Cortex M4 floating point optimisation

Carefully hand-written assembly language routines can bring dramatic savings in the runtime and RAM/ROM budget, for deeply embedded systems. This is especially true on very tiny Wearable devices, where small micro controllers are very often used, running at low frequency, with very limited memory resources.

## FFT based frequency calculation (algorithm)

Determining the frequency of a sinusoidal waveform can be achieved using an FFT based method. If we restrain ourselves to the simple case where the waveform is made of one single sine wave, then the fundamental frequency (f0) is indeed what we call the “waveform frequency”.

If that is the case, a simple FFT would allow isolating the frequency peaks. An histogram would then detect the highest one: the fundamental frequency. Again, this is valid only for this kind of waveforms. We can even tolerate some level of harmonics which are due to distortions.