Monday, September 24, 2018

Goertzel filter




https://en.wikipedia.org/wiki/Goertzel_algorithm

Many applications require the detection of a few discrete sinusoids. The Goertzel filter is an IIR filter that uses the feedback to generate a very high Q bandpass filter where the coefficients are easily generated from the required centre frequency, according to the following equations. The most common configuration for using this technique is to measure the signal energy before and after the filter and to compare the two. If the energies are similar then the input signal is centred in the pass-band, if the output energy is significantly lower than the input energy then the signal is outside the pass band. The Goertzel algorithm is most commonly implemented as a second order recursive IIR filter, as shown below.



https://github.com/jacobrosenthal/Goertzel

Matlab Code
function Xk = goertzel_non_integer_k(x,k)
%   Computes an N-point DFT coefficient for a 
%   real-valued input sequence 'x' where the center 
%   frequency of the DFT bin is k/N radians/sample.  
%   N is the length of the input sequence 'x'.  
%   Positive-valued frequency index 'k' need not be
%   an integer but must be in the range of 0 –to- N-1.
 
%   [Richard Lyons, Oct. 2013]
 
N = length(x);
Alpha = 2*pi*k/N;
Beta = 2*pi*k*(N-1)/N;
 
% Precompute network coefficients
Two_cos_Alpha = 2*cos(Alpha);
a = cos(Beta);
b = -sin(Beta);
c = sin(Alpha)*sin(Beta) -cos(Alpha)*cos(Beta);
d = sin(2*pi*k);
 
% Init. delay line contents
w1 = 0;
w2 = 0;
 
for n = 1:N % Start the N-sample feedback looping
    w0 = x(n) + Two_cos_Alpha*w1 -w2;
    % Delay line data shifting
      w2 = w1;
      w1 = w0;
end
 
Xk = w1*a + w2*c + j*(w1*b +w2*d);


Quiet Beacon

Low-powered beacon transmitter/receiver which can be used either on its own or in addition to libquiet. The transmitter creates a simple sine tone at a specified frequency, and the receiver uses the '''Goertzel Algorithm''' to detect the presence of the tone with complexity O(n) for n samples.




Saturday, September 22, 2018

NaviPack LiDAR Navigation Module


https://www.indiegogo.com/projects/navipack-lidar-navigation-module-reinvented#/

https://www.youtube.com/watch?v=SBhIdXVnoZU&feature=share

https://robot.imscv.com/en/product/3D%20LIDAR


NaviPack makes any device smarter and easier to control. It uses the latest LiDAR technology and powerful APIs to create easy solutions for automated devices.

With the built-in SLAM algorithm chip, Navipack is the first plug-and-play type of LIDAR navigation module. NaviPack is also the most affordable LiDAR solution for drones, robots and other devices and instantly enables them with powerful 360-degree sensing capabilities

NaviPack integrates the SLAM algorithm with the LiDAR sensor module, making it super easy to use and significantly reducing development time.

NaviPack performs 360 degree scanning of its surroundings and all objects up to 15 meters away with a frequency of 4000 points per second. It is super easy to use! With the built-in SLAM module, it will start working immediately after plugging into your devices - scanning the environment, building a detailed map, and enabling auto-moving capability.


 navipack ks explosion.jpg








Wednesday, September 12, 2018

Keypoints in computer vision - OpenCV3 techniques

OpenCV3 - Keypoints in Computer Vision by Dr. Adrian Kaehler, Ph.D.




https://www.youtube.com/watch?v=tjuaZGvlBh4






Another good talk from him,


Future Talk #91 - Machine Vision, Deep Learning and Robotics

https://www.youtube.com/watch?v=kPq4lYGr7rE
A discussion of machine vision, deep learning and robotics with Adrian Kaehler, founder and CEO of Giant.AI and founder of the Silicon Valley Deep Learning Group

Feynman's technique





“I had learned to do integrals by various methods shown in a book that my high school physics teacher Mr. Bader had given me. [It] showed how to differentiate parameters under the integral sign — it’s a certain operation. It turns out that’s not taught very much in the universities; they don’t emphasize it. But I caught on how to use that method, and I used that one damn tool again and again. [If] guys at MIT or Princeton had trouble doing a certain integral, [then] I come along and try differentiating under the integral sign, and often it worked. So I got a great reputation for doing integrals, only because my box of tools was different from everybody else’s, and they had tried all their tools on it before giving the problem to me.” (Surely you’re Joking, Mr. Feynman!)




Complex numbers, Quaternions and Octonions




https://en.wikipedia.org/wiki/Real_number   2^0  = 1 Dimention

https://en.wikipedia.org/wiki/Complex_number  2^1 = 2 Dimentions

https://en.wikipedia.org/wiki/Quaternion  2^2 = 4 Dimentions

https://en.wikipedia.org/wiki/Octonion  2^3 = 8 Dimentions

https://en.wikipedia.org/wiki/Sedenion  2^4  = 16 Dimentions

Trigintaduonions  2^5  = 32 Dimensions





In the construction of types of numbers, we have the following sequence:
RCHOS

or:


or:
"Reals"  "Complex"  "Quaternions"  "Octonions"  "Sedenions"
With the following "properties":
  • From R to C you gain "algebraic-closure"-ness (but you throw away ordering).
  • From C to H we throw away commutativity.
  • From H to O we throw away associativity.
  • From O to S we throw away multiplicative normedness.

Why am I talking about this, Well specifically Quaternions are of interest for Robotics. 

There are many different parameterizations for orientations:
  • Euler Angles 
  • Angle Axis
  • Rotation matrix 
  • Quaternions

Euler-Angle, Angle-Axis  have Singularities! 

Rotation Matrix 
  • 9 scalars, more complex regularization 
  • Concatenation: 27 multiplications
  • Rotating a vector: 9 multiplications


Quaternion
  • 4 scalars, easy regularization
  • Concatenation: 16 multiplications
  • Rotating a vector: 18 multiplications 

Compared to Euler angles they are simpler to compose and avoid the problem of gimbal lock. Compared to rotation matrices they are more compact, more numerically stable, and more efficient. ... When used to represent rotation, unit quaternions are also called rotation quaternions.

Quaternions and spatial rotation - Wikipedia

https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation

William Hamilton invented quaternions in 1843 as a method to allow him to multiply and divide vectors, rotating and stretching them.

Alternative to Euler and Dot Products. http://en.wikipedia.org/wiki/Dot_product
Quaternions are an expansion of compex numbers. A quaternion has three imaginary elements: $i$, $j$ and $k$ and can be written in the form:
   $\tilde{Q} = q_w + q_x i + q_y j + q_z k$


OpenSCAD

Singularities
One must be aware of singularities in the Euler angle parametrization when the pitch approaches ±90° (north/south pole). These cases must be handled specially. The common name for this situation is gimbal lock.
Code to handle the singularities is derived on this site: www.euclideanspace.com

A sensor fusion algorithm for an integrated angular position estimation with inertial measurement units

A Gyro-Free Quaternion based Attitude Determination system suitable or implementation using low cost sensors.

Orientation estimation using a quaternion-based indirect Kalman filter with adaptive estimation of external acceleration

Videos

https://youtu.be/d4EgbgTm0Bg What are quaternions, and how do you visualize them? A story of four dimensions.


https://www.youtube.com/watch?v=dttFiVn0rvc Math for Game Developers - Axis-Angle Rotation
https://www.youtube.com/watch?v=SCbpxiCN0U0 Math for Game Developers - Rotation Quaternions
https://www.youtube.com/watch?v=A6A0rpV9ElA Math for Game Developers - Quaternion Inverse
https://www.youtube.com/watch?v=CRiR2eY5R_s Math for Game Developers - Multiplying Quaternions
https://www.youtube.com/watch?v=Ne3RNhEVSIE Math for Game Developers - Quaternions and Vectors
https://www.youtube.com/watch?v=x1aCcyD0hqE Math for Game Developers - Slerping Quaternions Spherical Linear interpolation.
https://www.youtube.com/watch?v=fRSaaLtYj68 Math for Game Developers - Quaternion Wrapup and Review


https://www.youtube.com/watch?v=dul0mui292Q Math for Game Developers - Perspective Matrix Part 2
https://www.youtube.com/watch?v=jeO_ytN_0kk Math for Game Developers - Perspective Matrix

https://www.youtube.com/watch?v=8gST0He4sdE Hand Calculation of Quaternion Rotation
https://www.youtube.com/watch?v=KdW9ALJMk7s Quaternions Explained by Dan

https://www.youtube.com/watch?v=0_XoZc-A1HU FamousMathProbs13b: The rotation problem and Hamilton's discovery of quaternions (II)

https://www.youtube.com/watch?v=d4EgbgTm0Bg  What are quaternions, and how do you visualize them? A story of four dimensions.