Ranger is a popular and powerful file manager in console.
[Read More]Mathematica
Bracketing
Constants
| Command | Value |
|---|---|
| Pi | \(\pi\) |
| E | \(e\) |
| I | \(i = \sqrt{-1}\) |
| Infinity | \(\infty\) |
Data objects
| Command | Meaning |
|---|---|
| 2 + 8 I | complex |
| "text" | string |
Defining variables, functions, and rules
| Command | Meaning |
|---|---|
| x = value | assignment |
| x := value | delayed assignment |
| x = . or Clear[x] | remove value assigned to x |
| f[x_] := expression | define a function f(x) |
| expression /. x->a | replace x by a in expression |
| expression //. x->a | replace repeatedly |
| lhs :> rhs /; test | apply rule if test is True |
Linear algebra
| Command | Meaning |
|---|---|
| {a, b, c} | vector, list |
| {{a, b}, {c, d}} | 2 × 2 matrix |
| n.m | matrix multiply |
| Inverse[m] | inverse of matrix |
| Transpose[m] | transpose |
| Det[m] | determinant |
| MatrixPower[m, n] | m^n |
| MatrixExp[m] | e^m |
| LinearSolve[m, b] | solve mx = b |
| Eigenvalues[m] | eigenvalues |
| Eigenvectors[m] | eigenvectors |
| Eigensystem[m] | eigenvalues and eigenvectors |
Algebraic calculation
| Command | Meaning |
|---|---|
| Solve[lhs==rhs, x] | solve algebraic equation for x |
| DSolve[eqn, y[x], x] | solve differential equation |
| Reduce[eqn, x] | reduce equations |
| Eliminate[eqn, x] | eliminate variable x |
Calculus
| Command | Meaning |
|---|---|
| D[f, x] | \(\partial f/\partial x\) |
| D[f, {x,n} | \(\partial^n f/\partial x^n\) |
| Dt[f] | \(df\) |
| Integrate[f, x] | \(\int fdx\) |
| Integrate[f, {x, a, b}] | \(\int_a^b f dx\) |
| Sum[f, {i, m, n}] | \(\sum_{i=m}^n f\) |
| Product[f, {i, m, n}] | \(\prod_{i=m}^n f\) |
| Limit[f, x->a] | \(\lim_{x\to a} f\) |
Input and output
| Command | Meaning |
|---|---|
| <<file | read expressions from file, return last expression. |
| expression>>file | write expression to file. |
| expression>>>file | append expression to file. |
| !!file | display the content of file. |
| Save["file", x] | save the definition of x to file. |
| !command | issue a UNIX command. |
Expression in different formats
| Command | Meaning |
|---|---|
| FullForm[e] | full form |
| InputForm[e] | input |
| OutputForm[e] | out |
| CForm[e] | C codes |
| FortranForm | fortran |
| MatrixForm[e] | matrix |
| StandardForm[e] | math |
| TeXForm[e] | TEX |
Programming
- Table[expression, {i, max}]
- make a list of values of
expressionwithifrom1tomax. - Module[{a, b, c}, expression1; expression2;…]
- a procedure with local variables
a,b,creturn value of last expression. - Do[expression, {i, min, max, di}]
- evaluate
expressionwithirun frommintomaxin steps ofdi. - While[test, body]
- evaluate
bodyrepeatedly, so long astestisTrue. - For[star,test,inc,body]
- evaluate
start, then repeatedly evaluatebodyandinc, untiltestfails. - If[test, then, else]
- evaluate
theniftestisTrue, andelseif it isFalse. - Which[test1,value1,test2,value2,…]
- give the value associated with the first
testthat isTrue. - Switch[expression, form1, value1, form2, value2, …]
- give the value associated with first
formmatchingexpression. - Function[x, body]
- specify a pure function.
- Nest[f, x, n]
- apply the function
fnestedntimes tox. - Apply[f, {a, b, c}]
f(a, b, c).- Map[f, {a, b, c}]
- apply
fto each elements,{f(a), f(b), f(c)}.
Multiple Signal Classification (MUSIC)
Multiple signal classification (MUSIC) is a popular algorithm for spectrum estimation. This post is just written as a brief summary.
[Read More]NR - Numerology
Since release 15, new radio (NR) system has explicitly proposed the concept of numerology, which is used to represent the scaling of subcarrier bandwidth, FFT size, etc.
[Read More]Python - Einops
Einstein-inspired notation for operations (Einops1) is a python package which provides extremely flexible and powerful opertions on tensors, e.g., permuting/reordering, reshaping (combining and partitioning along axes), reducing, repeating. Moreover, it supports numpy, tensorflow, pytorch, etc.
[Read More]Python - Function
在Python中,函数通过关键字 def 定义。
Sparse Array
Concepts
Given a sparse array, the locations of its component antennas/sensors can be normalized to a minimum inter-antenna distance, denoted by \(d\), e.g., typically \(d = \lambda / 2\). Accordingly, a sparse array can be simply denoted by an integer set \(\mathbb{S}\), and the locations of the antennas are \(nd\), \(n \in \mathbb{S}\).
Given a sparse array \(\mathbb{S}\), its difference coarray (DCA) is defined as \[\begin{aligned} \mathbb{D} \triangleq \{n_1 - n_2 \mid n_1, n_2 \in \mathbb{S}\}. \end{aligned}\]
- Each entry in \(\mathbb{D}\) is termed a spatial lag.
- The cardinality of DCA, i.e., \(|\mathbb{D}|\), is termed degree of freedom (DoF) of the sparse array \(\mathbb{S}\).
- Clearly, DCA is symmetric, i.e., \(\forall n \in \mathbb{D}\), \(-n \in \mathbb{D}\).
Let \(\mathbb{U}\) denote the central ULA segment of \(\mathbb{D}\). Its cardinality \(|\mathbb{U}|\) is termed uniform degree of freedom (UDoF). Then, the number of uncorrelated sources which can be identified is \(\dfrac{|\mathbb{U}| - 1}{2}\).
Direction Cosine
In 3-dimension (3-D) space, a non-zero vector can be denoted by \[\begin{aligned} \mathbf{v} = v_x \mathbf{e}_x + v_y \mathbf{e}_y + v_z \mathbf{e}_z, \end{aligned}\] where
[Read More]Estimation of Signal Parameters by Rotational Invariance Techniques (ESPRIT)
Estimation of Signal Parameters by Rotational Invariance Techniques (ESPRIT), as its name indicates, is an algorithm to estimate the frequency of sinusoid waves from a noisy mixture of them. Additionally, it can also be used for direction of arrival (DoA) estimation in a multiantenna system. This post describes its principle.
[Read More]C++ - Standard Template Library (STL)
标准模板库(standard template library, STL)是C++标准库的子集, 其大量使用了模板.
[Read More]