2017/09/11

Principle of Partial Response Maximum Likelihood (PRML)



This simple example demonstrates the principles of ML detection:

Decisions are made based on a sequence of samples, instead of one current sample. For each sequence of samples a list of allowable sequences is generated. Each of the allowable sequences is compared with the received sequence and SSE (or any other distance function) is calculated.

The sequence having the minimum distance (maximum likelihood) is selected to be the
result of the detection.

What should be stressed here is that the Viterbi algorithm is only (although smart and ingenious) a practical realization of the Maximum Likelihood detection principle which opened the way for effective real-time data detection.

Reference
http://www.lintech.org/comp-per/09PRML.pdf

2017/09/08

Tricky Things in New Ubuntu PC Setup

Fcitx input method panel not showing

I have a problem that fcitx google-pinyin panel is not showing on Ubuntu, the criminal is package fcitx-ui-qimpanel, after removing fcitx-ui-qimpanel, problem solved.


DNS not working sometimes

sudo gedit /etc/NetworkManager/NetworkManager.conf
Comment out line as:

#dnsmasq deactivated
#dns=dnsmasq

2017/09/04

Create Simple DLL loadable by MatLab

Creating DLL

Create a new project in visual studio community 2017
File -> New -> Project

On New Project Dialog
Installed -> Visual C++ -> Windows Desktop -> Windows Desktop Wizard

On Wizard Dialog
Application type -> Dynamic Link Library (.dll)
Additional Info:
  check "Empty Project"
  uncheck "Precompiled Header"

Add Files to project
Project -> Add New Item -> .cpp/.h ... etc

Set x64 or Win32 Platform as Active Configuration
Solution Explorer -> right click project -> Properties -> Configuration Manager

Code
simple.c
#define EXPORT_FCNS
#include "helper.h"
#include "simple.h"

int sq(int x)
{
 return (x*x);
}
simple.h
#ifndef SIMPLEH_H
#define SIMPLEH_H

#include "helper.h"

#ifdef  __cplusplus
extern "C" {
#endif

 EXPORTED_FUNCTION int sq(int x);

#ifdef  __cplusplus
}
#endif

#endif
helper.h
#ifndef HELPER_H
#define HELPER_H

#ifdef _WIN32
#ifdef EXPORT_FCNS
#define EXPORTED_FUNCTION __declspec(dllexport)
#else
#define EXPORTED_FUNCTION __declspec(dllimport)
#endif
#else
#define EXPORTED_FUNCTION
#endif

#endif


Loading DLL on Matlab

Setup compiler
on command window
mex -setup

Script
loadlibrary('simple')
libfunctions simple
calllib('simple','sq', 3)



Reference 

https://stackoverflow.com/questions/18413118/visual-studio-dll-and-matlab

Post Code on Blogger

Simplest way to post code to blogger for me: <pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black;overflow-x:...