A Tutorial on C++ Copy and Swap Idiom

Someone once shows me the following code

struct Widget {
    Widget() = default;
    Widget(const Widget& w) = default;
    Widget(Widget&& w) = default;
    Widget& operator=(Widget obj) {
        // swap obj and this
        ...
        return *this;
    }

    // member variables
    int id;
    ...
};

More...

Munkres Algorithm For Assignment Problem: A Tutorial

./image/step1_prime.svg

Munkres algorithm (or Hungarian algorithm) is very efficient to solve the assignment problem. However, I can't find a good tutorial from the internet (most of them are vague high-level description; some show the implementation without explanation), so I try to do it by myself. Here are some applications,

More...

SMACOF: A Tutorial

./image/smacof3.svg

For parameter estimation, if the cost function is quadratic, it is easy to find the solution by setting its derivative to zero. For example, suppose we want to estimate $y_i$ from input $\boldsymbol{x}_i$, where $\boldsymbol{x}_i$ is a row vector. Suppose that from our understanding to the problem, we believe linear least square is a good estimator. That is,

$$ \hat{y}_i = \boldsymbol{x}_i^T \boldsymbol{w}, \label{eq-ls} $$

where row vector $\boldsymbol{w}$ is the coefficients we want to estimate,

More...

A tutorial on time series with neural network

./image/walk.svg
If you torture the data long enough, it will confess.
Ronald H. Coase, Essays on Economics and Economists

More...

bsmedit -- C/C++/SystemC simulation controller

./image/bsmedit.png

bsmedit is a C++/SystemC Visualizer. Long time ago, when I first used the Systemc library to simulate some communication algorithms, I was quickly bored with the following debugging procedure:

  1. update the source code;
  2. re-compile the program;
  3. check the results.

And occasionally, I would need to add some debugging code. For example, printing some value (e.g., printf) to the terminal or dumping the data to a file, so that I can use other tools (e.g., Matlab) to visualize and analyze it.

bsmedit aims to simplify this procedure. With bsmedit, we can

  • control the simulation
  • monitor the signals in real-time
  • plot/dump the signals
  • ......

More...

bsmdoc -- another technical html doc generator

./image/bsmdoc2.png

bsmdoc is a tool to generate technical static html docs:

  • Light-weighted: keep the 'core' as small as possible;
  • Highly extendable: extend the tool to solve your own problem easily;
  • Single file doc: generate images, equations in a single file.

bsmdoc splits the whole doc into blocks (e.g., equation block, paragraph block, heading block, ...). In the following sections, we will show each block in detail, as well as the way to extend the existing blocks.

More...

Acoustic Echo Cancellation Overview

./image/aec_dtd.svg

In acoustic transmission system, there are two important components: the speaker and the microphone. If the speaker and the microphone are totally separated, there will be no echo from the speaker to the microphone. Then, there is no need for acoustic echo cancellation.

However, in practice, the speaker and the microphone is almost always not totally separated. For example, when you are calling your friend A, you are the near end user and your friend A is the far end user. The speech from your friend A will come out from the speaker of your phone, which may also be collected by the microphone of your phone and sent back to your friend A.

More...

Basics of Digital Signal Processing in Communications System

basics of digital signal processing

./image/sampling_ambiguity.svg

In this section, we will review some basic principles in digital signal processing, which will be widely used in the following sections.

More...

Transmitter

./image/mapping_gray_table.svg

Scrambler is also called randomizer. It is usually the first block in many communication systems, which 'randomizes' the source data (e.g., the binary sequence). Why do we want to randomize the data? One example is that the randomized data can help the receiver to achieve the symbol synchronization.

More...

Sampling Rate Conversion

./image/filter_fir_polyphase_down.svg

As suggested by the name, sampling rate conversion (SRC) is to change the sampling rate without distorting the signal. There are several purpose to do that. For example, the ADC at the receiver may always working in a certain sampling frequency, while the digital processing block may work in a different frequency. Thus, an SRC block is needed to fill the gap between the ADC and the following digital blocks.

More...

Synchronization

./image/sync_rx_df.svg

Synchronization is critical to communications system. It helps the system to establish a shared sense of time and frequency between transmitter and receiver. In this section, we will introduce some basic ideas. As we mentioned in all the other sections, we will not plan to list all the algorithms (how could that even be possible?), instead, we will show some basic ideas and wish you will know how to start when you need to deal with a real problem. The code used in this section can be found here.

More...

Small tools

.