Latest stories

Perceptron Neural Network using Matlab

Perceptron is one of the simplest forms of a neural network model. The following code snippet is a simple version of such a neural network using Matlab. Before using it please read some background information at wikipedia :  clc; clear all; close all; % Data inputs=[1 0 0; 1 0 1;1 1 0;1 1 1]; % Desired Output desiredOutput=[1 1 1 0]; % Learning Rate learningRate=0.1; % HardLimit threshold...

Separation of Image Mixture using FastICA

Image separation of mixed and overlapped images is a frequent problem in computer vision (image processing). The following Matlab source code is a demonstration of image separation using FastICA algorithm based on kurtosis. clc;clear all;close all; original_image1=imread ('input1.jpg'); original_image2=imread ('input2.jpg'); figure() subplot(3,3,1),imshow(original_image1),title('Original Source...

Find the Elapsed Time using Monotonic Clocks in Linux

When a linux program requires measuring elapsed time, you need an individual timer to perform this task. This timer should be independent even if the user changes the time on the system clock. In Linux there are several different implementations for different cases (): CLOCK_REALTIMESystem-wide realtime clock. Setting this clock requires appropriate privileges.CLOCK_MONOTONICClock that cannot be...

Edge detection with a given direction using Matlab

The aim of this article is to detect the edges with a given direction in an image. To that end create a function [ E ] = oriented_edges( I, thr, a, da ) that takes as input a double grayscale image Ι, a threshold value thr, a direction a, and an angle da. The output of the function is a binary image Ε where the pixels that meet the following requirements should have the value 1: The pixel...

Principal Component Analysis using Matlab

PCA is a way of identifying patterns in data, and expressing the data in such a way as to highlight their similarities and differences. Below are the steps of the algorithm: close all; % clear all; clc; % data = load('Data/eeg.mat'); % data = data.data{1,2}; Step 1 – Initialize the dataset, 6 vectors of 32 sample data % % Step 1 - Initialize the dataset, 6 vectors of 32 sample data % X =...

C++ Template Class for Linear Algebra Matrix

It seems that many projects come upon a need to perform some linear algebra maths. However, the a large number of the available libraries usually are huge with many unnecessary or system dependent functionalities or …they are not free. The following template class provides some basic linear algebra matrix operations such as +,-,* as well as find the determinant, the covariance matrix...

CRC16 Simple Algorithm for C

The following code snippet is about CRC16 hash function. Usually in embedded systems there is an already built-in function for CRC8-16-32 etc. However in case there is not, here is a simple approach for it. If you are looking for CRC8 Algorithm please go to the following post here. /* CRC_H_ */ #ifndef CRC_H_ #define CRC_H_ #ifdef __cplusplus extern "C" { #endif #include <string.h> #include...

Improved circular list /array (ring buffer) in C++

This is a new version of the ring buffer. Using function templates the FIFO ring buffer is able to handle almost any type of data. template<typename T> struct cbuffer_t { T * data; T * first; T * next; int max; }; template<typename T> extern cbuffer_t<T> * cBufferInit(int); template<typename T> extern int cBufferPush(cbuffer_t<T> *, T ); template<typename T> extern int...

Simple Memory Management

This project is a memory allocation scheme that provides efficient dynamic memory allocation for small embedded systems lacking a Memory Management Unit (MMU). The proposed Simple Memory Management Scheme (SMM) maintains a balance between performance and efficiency, with the objective to increase the amount of usable memory in MMU-less embedded systems with a bounded and acceptable timing...

How to install Latex (texStudio) in a Windows PC

In this post we will introduce how to install MiKTeX plus TeXstudio on windows. This is very easy! You simply have to accept just about all the default settings. Step 1: To begin with you have to go to the MikTeX website and navigate at the downloading page. From there you could pick the appropriate installer (32bits or 64bits) based on your system. [ Link ] Step 2: Just start the installation...

Disclaimer: The present content may not be used for training artificial intelligence or machine learning algorithms. All other uses, including search, entertainment, and commercial use, are permitted.

Categories

Tags