Archive for the 'Digital Signal Processing' category

Computing Block-wise Cross Correlation

 | April 12, 2011 4:42 pm

The cross correlation of two vectors using discrete Fourier transform (DFT) is a popular method of searching the occurrences of one pattern inside another. It provides simple mean to detect echoes, specific patterns inside digital signals, signal comparison etc.

In some applications, one of the input vectors (signals) is much longer than another, or even of infinite length. For example: searching a transmitted signal’s echo in the received input stream in radar or sonar, or detecting an RDS signal inside a continuous radio transmission. In such applications one must compute the cross correlation of searched pattern and input stream in a block-by-block manner.

In this article I shall present a short MATLAB template to compute a block-wise cross correlation appropriate for searching a specific pattern vector inside a continuous input vector of indefinite size. Furthermore, I shall extend the algorithm to search for more pattern vectors simultaneously.

Show me more… »

Computing DFT of real signals in MATLAB

 | April 8, 2011 3:43 pm

The discrete Fourier transform (DFT) calculates spectrum of a complex vector. Typically, input vector represent sampled real signal. For real vectors (imaginary part of all vector components is zero) the upper half of the DFT spectrum is a conjugate mirror of the lower half. Therefore, the computation of the DFT of the real vectors can be made with almost half the effort [1].

Since MATLAB does not provide a function for computation of DFT spectra of real signals to save time and space, I developed my own.

Show me more… »