Wednesday 12 July 2017

Oxygen Installation error on Oneplus One Resolved

While Installing OxygenOS 2.1.4 using TWRP you might get into an issue, Installation fails with an error message showing

This package is for "OnePlus" devices; this is a "bacon" ....

Its easy piece to bypass this message and fix this , In the Build Zip file downloaded from oneplus one website

open the Zip directly(without extracting) and go to the location META-INF/com/google/android

edit the first line with 

getprop("ro.build.product") != "OnePlus" || getprop("ro.build.product") != "ONE" || abort("This package is for \"OnePlus\" devices; this is a \"" + getprop("ro.build.product") + "\"."); 

Save the zip file.

All done !! , try installing using TWRP and it will be successful.

Cheers 

Friday 26 June 2015

Linux Help

1. Using Extra Monitor but closing the Lid of Laptop make the other monitor sleep too.

Best solution to make the extra monitor alive even though Lid is closed.

$ sudo vim /etc/UPower/UPower.conf
Edit the line at the end : ignoreLid=false as below:
# <snip> ...

ignoreLid=true

# <snip> ...

Friday 12 June 2015

Git Commands

As a wireless engineer you have to use Linux and Git for your software development work.Here i have tried to give a basic Idea of Git with some useful commands.Git is one of the most used Version control system for software development. It is quire powerful but looks ugly when you start using it for the first time.

Here I have tried to put all the useful basic Git commands at one place.
Helpful to any one who wants to learn.

Git v/s GitHub : Most people who start using Git gets confused between Git and GitHub , In a simple line Git is a version control that works on your local machine. GitHub is something like cloud based solution where you can sync and share your local repository. GitHub helps you develop the software when you are collaboration with other developers/colleagues.
  • ~ $ git init : initialize a new repository in current directory.
  • ~ $ git status: shows the current status of files changed.
  • ~ $ git log : Displays the current commit history in your repository. As stated above don't get confused, git gives you information about your local repository which will be same as the one you clones/pulled from GitHub.
  • ~ $ git log --graph: shows the commit log in graphical flow.
  • ~ $ git show Commit-ID : Shows the changes that where made in the commit represent by the Commit-ID.
  • ~ $ git log -n 1 : shows the log for top most commit.
  • ~ $ git diff : git diff without any argument shows the difference between your working directory and staging area.
  • ~ $ git diff --staged : shows the difference between the staging area and your local repository.


  • ~ $ git config --global color.ui auto : make color scheme of the shell auto for git.
  • ~ $ git config --global core.editor "subl -n -w" : make current/default editor as sublime for git.you can chose any editor you want.
  • ~ $ git clone url : clone git from GitHub Url into your current local directory.
  • ~ $ git checkout branch : makes current working head as branch.
  • ~ $ git branch : git branch without any argument tells you the current branch where you are.
  • ~ $ git branch branch-name : create a new branch with name as branch-name.
  • ~ $ git add filename : Add the file to staging area.
  • ~ $ git commit : commit changes from staging area to repository. Don't get confused that commit will push your changes to GitHub. Commit writes/update your changes to the local repository.
  • ~ $ git merge branch-1 branch-2 : merge branch-1 and branch-2
  • ~ $ git remote : create a remote repository in local that will get synced to GitHub.
  • ~ $ git remote -v : more details about remote repositories.
  • ~ $ git remote add remote-name linlurl : create a remote repository in your local for the link directed by url.
  • ~ $ git push remote-name branch-name : Push current remote with all changes to branch in GitHub specified by branch-name.
  • ~ git fetch branch-name : Updates the local copy of the branch with that on GitHub without pushing changes.




*I would keep on updating with more useful commands and concepts for git.


Thursday 26 March 2015

Optimal Receiver for Additive White Gaussian Noise Channel

Sometimes students get confused while studying receivers design in Digital communication system. I have just tried to explain things in a concise and simple method.

Lets consider a receiver model as:


so received signal is the additive sum of transmitted symbols and white noise added by the channel.


suppose we received a symbol r and the transmitted symbol was s.

Probability of correct decision given symbol r is received can be written as P(s/r), mathematically

\begin{array}{l}
p(Correct - decision/r - received) = p(s - sent/r - received)\\
 \Rightarrow p(correct - decision) = \int {p(correct - decision/r).p(r).dr} 
\end{array}
                                                = \int {p(s - sent/r).p(r).dr}

where , p(r) , probability density function of received vector which is always positive.

Thus , The optimal receiver will be one which maximizes {p(s - sent/r).p(r)} .


The receiver knows the set of symbols which are being used by the transmitter to send data.To decide on s , it is designed to select s among all possible values of s, such that the conditional probability {p(s - sent/r)} is maximum. Mathematically find  s\limits^\^  such that,

                                             s\limits^\^  =  {{\rm{argument }}\max }\limits_{1 \le s \le M} {\rm{ p(s/r)}}{\rm{.p(r)}}

here , we can drop p(r) as the value of p(r) is always positive. Thus the decision rule equation becomes

                                                 s\limits^\^  =  {{\rm{argument }}\max }\limits_{1 \le s \le M} {\rm{ p(s/r)}}
 From the above rule equation we design system for MAP(Maximum aposterior probability) RULE and also ML(Maximum Likelihood) RULE.





Sunday 22 March 2015

Channel Equalizers

What are channel equalizers ?

If you search the word equalizers on google, it says "a thing that has an equalizing effect" . The same applies in relation to communication theory. When the transmitted signal pass through a dispersive channel , the symbols interfere between them resulting in Information loss. We call this as ISI or inter symbol interference. Equalizers are filters that help us reduce the ISI and equalize the symbols.

Linear Equalizer:

  •  Zero Forcing(ZF) Equalizer
  •  Minimum Mean Square Error(MMSE) Equalizer 


Decision Feedback Equalizer :

Improves the Linear Equalizers by adding a new feedback filter which uses the feedback from prior decisions to cancel the interference due to past symbols. This in turn  reduce the noise enhancement as compared to ZF and MMSE Linear Equalizers.

Lets try to understand it mathematically.

we can model a linear modulated signal over a dispersive channel as below:




where,
{B_n} - Transmitted bits
{G_{transmitter}}- Transmitter filter
{G_{Channel}}- Channel filter
            AWGN- Additive white gausian noise n(t)
            Rx- Received Symbols r[n]

We can write the receiver model as,  r[n] = Ub[n] + W[n]

where ,
             r[n]  - received symbol vector
              U - Vector , whose each column gives the response on each
              symbol from all the filters through which it passes. mathematically
             U = {G_{transmitter}} \otimes {G_{Channel}} \otimes {G_{{{\rm Re}\nolimits} ceiver}} .
             G-Corresponding filters Models of Transmitter, Channel and Receiver.
             All the elements of U Matrix are shifted in acyclic so that it gives contribution to the                corresponding transmitted vector.
             B[n]- transmitted symbols Vector. (b[n - {k_1}],.........b[n],b[n + 1],..........b[n + {k_2}])
             W[n]- AWGN noise with Power Spectral density  \sigma _w^2


we can write received symbols r[n] as,
                                        r[n] = b[n]{u_0} + \sum\limits_{j \ne 0}^n {b[n + j]{u_j}}  + w[n]
Now the idea of Linear Equalizer is to design a filter such that the second term \sum\limits_{j \ne 0}^n {b[n + j]{u_j}}  is significantly smaller as compared to b[n]{u_0}. To understand lets expand the Model stated above,

                       r[n] = \left( {\begin{array}{ccccccccccccccc}
{{a_{32}}}&{{a_{11}}}&0\\
0&{{a_{22}}}&0\\
0&{{a_{32}}}&{{a_{11}}}
\end{array}} \right)b[n] + {w_n}
                        \Rightarrow r[n] = \left( {\begin{array}{ccccccccccccccc}
{{a_{32}}}&{{a_{11}}}&0\\
0&{{a_{22}}}&0\\
0&{{a_{32}}}&{{a_{11}}}
\end{array}} \right){[b[n - 1],b[n],b[n + 1]]^T} + w[n]
                        \Rightarrow r[n] = {[{a_{32}}b[n - 1] + {a_{11}}b[n],{a_{22}}b[n],{a_{32}}b[n] + {a_{11}}b[n + 1]]^T} + w[n]
                        \Rightarrow {r_1}[n] = {a_{32}}b[n - 1] + {a_{11}}b[n] + {w_1}[n], similarly {r_2}[n] and {r_3}[n] .

The work of equalizer filter is to give us  b[n]  from  {r_1}[n]  and remove the influence of  b[n - 1] .

ZF : In case of Zero forcing equalizer , we design the ZF filter such that the term
 \sum\limits_{j \ne 0}^n {b[n + j]{u_j}}  = 0 and b[n]{u_0} has only contribution to r[n] plus the additive noise for sure.


MMSE: The above explanation shows that the ZF Equalizer ignores the effect of noise at the output, thus to have a trade off between ISI and effect of Noise is the MMSE Equalizer. We design the equalizer filter such that Mean Square Error(MSE) , MSE = E[|{F_{MMSE}}r[n] - b[n]{|^2}] is minimized to get the Filter {F_{MMSE}}.




Sunday 15 March 2015

Poles and Stability of System

Why do we say that poles should be within unit circle for the system to be stable ?

let the Transfer function which is the designed filter in our system have a impulse response h(n), the system is stable only if h(n) tends to zero as n tends to infinity.
In terms of Z transform, consider a causal impulse response of the form 
                                              h(n) = {r^n}{e^{jwnT}} ,n=0,1,2...
If r>1 , then the amplitude envelope will increase exponentially as {r^n},
the Signal h(n) has the Z-Transform,
                  
                   H(z) = \sum\limits_{n =  - \infty }^{n = \infty } \begin{array}{l}
\\
{r^n}{e^{jwnT}}{z^{ - n}}\\

\end{array}  = \frac{1}{{1 - {r^n}{e^{jwT}}{z^{ - 1}}}}

                    taking in , |{r^n}{e^{jwT}}{z^{ - 1}}| < 1 or r < |z|
thus the Transfer function consists of a single pole at z = r{e^{jwT}} when r < |z| , now consider  r \ge 1 , the poles of H(z) moves out of unit circle and the impulse response has exponential increasing amplitude or the definition of stability fails. Thus for r \ge 1 , the Z transform no longer exists on the unit circle.

Above we considered the case with single pole, it will give the same result with multiple pole transfer function. To summarize all poles of an LTI System should lie withing the unit circle for a stable system.


Saturday 14 March 2015

Orthogonal and OrthoNormal Vectors

Orthogonal and OrthoNormal Vectors : When the dot product of two vectors are zero , we say it as orthogonal vectors. If the vectors are normalised to a value 1, the these same orthogonal vectors are called OrthoNormal vectors. mathematically,




  • any orthonormal set is orthogonal but reverse is not true.
  • any orthogonal set corresponds to a unique orthonormal set but an orthonormal set may correspond to different orthogonal sets.