Thursday, July 13, 2017

Adaptive Filter: BMFLC

In this article, I will discuss about adaptive noise canceling techniques such as
  1. Fourier Linear Combiner (FLC)
  2. Weighted-frequency Fourier Linear Combiner (WFLC)
  3. Bandlimited Multiple Fourier Linear Combiner (BMFLC)

FLC estimates the quasiperiodic signal of known frequency by using least mean square (LMS) algorithm to adapt the amplitude and phase of a reference signal. WFLC is an extension of FLC which can adapt to a periodic signal of unknown frequency and amplitude. Consequently, WFLC also adapts to time-varying reference signal frequencies while FLC can only estimate a signal with fixed and known frequency. To eliminate the time lag which is not desirable in real-time application, a method using combination of WFLC-FLC has been proposed. One limitation of WFLC is its inability to extract a periodic or quasi-periodic signal containing more than one dominant frequency. To overcome that, BMFLC approach tracks a predetermined band of multiple dominant frequencies based on the prior knowledge of the desired signal. The adaption process is achieved using LMS optimization similar to WFLC and FLC. As the frequency components in BMFLC are constant, analytical ouble integration can be employed to obtain the displacement from acceleration. Due to this reason, it becomes an ideal choice for applications where data is sensed with accelerometers.


Arduino zero pro is used for the experiment. The code are written in C so that it can be ported to other platforms easily. Firstly, a reference signal is generated which is superimposed with noise. The generated signal is filtered with adaptive filter. The filtered output is compared with the reference signal by plotting them on serial plotter. The latest version Arduino IDE has not only Serial Monitor but it also has Serial Plotter. Therefore, it is easy and convenient to plot and see them serial plotter how an adaptive filter adapts to its input signal.

Figure. A simple setup using an Arduino Zero Pro board.

Tuesday, June 6, 2017

Flash content protection for LPC824

In this article, I would like to discuss about evaluation of LPC824 low cost 32-bit ARM Cortex-M0 microcontroller using OM13071 LPCXpresso824-MAX Development board. LPC824M201JHI33 is used in the board. Its size is only 5 x 5 x 0.85 mm in HVQFN package.

In order to evaluate it, MCUXpresso Integrated Development Environment (IDE) is downloaded and installed. Other tools for it can be found at this link . After launching MCUXpresso and assigning a workspace folder, example projects can be imported by clicking Quick Start Panel (near bottom left corner) -> Import projects from file system ... -> Browse LPC open resources as shown in the following figure.

Wednesday, May 31, 2017

Programming serial port in C++ with wxWidgets for Windows and Linux

We would like to present a class library 'serial.h' developed by us to use serial port (com port) on both Windows and Linux. This cross-platform 'Serial' class is written in C++. A simple example for C++ console program is demonstrated. Using it with wxWidgets for GUI application is also presented. The source code can be found at

Figure. A wxWidgets GUI application using 'Serial' class with Visual Studio 2017

Friday, February 24, 2017

Opencv-3.2.0 on Windows 10 - 64 bit Using Visual Studio 2015

Using the latest version OpenCV (currently opencv-3.2.0) pre-built for 64 bit Windows with Visual Studio 2015 is discussed. It is available to download at
Then, the downloaded file, opencv-3.2.0-vc14.exe is extracted at C:\opencv as a folder called opencv320. Visual Studio 2015 IDE is downloaded from and install. The following steps are tested on Windows 10 64 bit using Visual Studio 2015 and OpenCV-3.2.0. For other versions, the precedures are similar.

At first OPENCV_DIR is declared as an enviroment variable. Run 'Command window' in administrator mode by right clicking start menu and choosing command prompt (admin). Enter

setx -m OPENCV_DIR C:\opencv\opencv320\build\x64\vc14

Wednesday, February 22, 2017

A LaTeX Report Template for Myanmar Language Using XeTeX

This is a template for LaTeX report in Myanmar language using XeLaTeX. It is available at

To properly render Myanmar fonts using LaTeX, it is necessary to use TeX typesetting engines that support Unicode such as XeTeX. Simple examples for testing XeTex can be found in an older post Myanmar (Burmese) Language with XeTeX and LuaTeX.

Tuesday, February 21, 2017

Integration of Accelerometers

We have several 3-axis accelerometers attached to a rigid body at arbitrary positions. The rigid body is moving at arbitrary linear and angular movements, but the accelerometers can only sense linear accelerations. Consequently, the information about angular movements of the rigid body is not available.

A question is whether it is possible to integrate them to get an equivalent accelerometer without using angular movement information.
After consideration, I think the answer for that question is 'YES'.

Monday, January 9, 2017

Creating Dynamic Link Library (DLL) in C++ and Using it in Visual Basic .NET

I need to create a DLL (Dynamic Link Library) to be used in Visual Basic .NET 2012 (vs11). And I want to write the DLL in C++. Two different ways to accomplish the task are discussed below.

  • CLR Class Library
  • Win32 DLL