Monday 14 November 2022

DSP Equations In Latex

I was recently documenting some DSP equations in Latex and couldn't find any suitable examples so I've put them together and thought I'd share.

The Fourier Transform

\large \mathscr{F} \normalsize (x(t))=\int_{-\infty}^{\infty}x(t)e^{-j \omega t}dt

Rendering

$$\large \mathscr{F} \normalsize (x(t))=\int_{-\infty}^{\infty}x(t)e^{-j \omega t}dt$$

The Discrete Time Fourier Transform

X(k) = \sum_{n=0}^{N-1}x(n).e^{-j 2 \pi nk/N},\; for\; 0 \le k \le N-1

Rendering

$$X(k) = \sum_{n=0}^{N-1}x(n).e^{-j 2 \pi nk/N},\; for\; 0 \le k \le N-1$$

The Inverse Discrete Time Fourier Transform

x(n) = \frac{1}{N} \sum_{k=0}^{N-1}X(k).e^{j 2 \pi nk/N},\; for\; 0 \le n \le N-1

Rendering

$$x(n) = \frac{1}{N} \sum_{k=0}^{N-1}X(k).e^{j 2 \pi nk/N},\; for\; 0 \le n \le N-1$$

FIR Filter

y(n) = \sum_{n=0}^{N-1}h(k).x(n-k)

Rendering

$$y(n) = \sum_{n=0}^{N-1}h(k).x(n-k)$$

IIR Filter

y(n) = \sum_{k=0}^{N}a_{k}.y(n-k) + \sum_{r=0}^{M}b_{r}.x(n-r)

Rendering

$$y(n) = \sum_{k=0}^{N}a_{k}.y(n-k) + \sum_{r=0}^{M}b_{r}.x(n-r)$$

Roots Of Quadratic Equation $ax^{2} + bx + c = 0$

x=\frac{-b \pm \sqrt{b^2 - 4ac}}{2a}

Rendering

$$x=\frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$

One-Pole Filter

Difference Equation

y(n)=x(n)+\alpha.y(n-1)

Rendering

$$y(n)=x(n)+\alpha.y(n-1)$$

z Transform

Y(z)=X(z)+\alpha z^{-1}Y(z)

Rendering

$$Y(z)=X(z)+\alpha z^{-1}Y(z)$$

Transfer Function

H(z)=\frac{1}{1-\alpha z^{-1}}

Rendering

$$H(z)=\frac{1}{1-\alpha z^{-1}}$$

Frequency Response

H(e^{j\omega T})=\frac{1}{1-\alpha e^{-j\omega T}}

Rendering

$$H(e^{j\omega T})=\frac{1}{1-\alpha e^{-j\omega T}}$$

M-Point Moving Average Filter

Frequency Response

H[f]=\frac{sin(\pi f M)}{M sin(\pi f)} \: for \: 0 < f \leqslant 0.5

Rendering

$$H[f]=\frac{sin(\pi f M)}{M sin(\pi f)} \: for \: 0 < f \leqslant 0.5$$


Notes

To align equations with the equals sign, embed in the following blocks, use "&=" for the alignment and separate each line by ending with " \\".

\begin{equation*}
\begin{align*}


\end{align*}
\end{equation*}

VSCode doesn't support equation numbering auto increment and Colab doesn't support "equation*" or "aligned*" for disabling equation numbers. Colab requires "aligned" not "align".

Latex References


Friday 15 July 2022

The 30th Annual Running Of The University Of Oxford Digital Signal Processing Course Will Be Held Online Again, In 2022

The 30th annual running of the University Of Oxford Digital Signal Processing course will include a second online edition that will be running over a six week period, from Monday 17 Oct 2022 - Friday 25 Nov 2022.

The course first moved online in 2020 and has received excellent reviews from the attendees.

Based on the classroom course, Digital Signal Processing (Theory and Application), this online course consists of weekly live online tutorials and also includes a software lab that can be run remotely. We'll include all the same material, many of the existing labs and all the interaction of the regular course.

Online tutorials are delivered via Microsoft Teams once each week and practical exercises are set to allow you to practice the theory during the week. 

You will also have access to the course VLE (virtual learning environment) to communicate with other students, view and download course materials and tutor support is available throughout.

Code examples will be provided although no specific coding experience is required. 

The live tutorials will be on Wednesday each week from 13:00 - 14:30 and 15:00 - 16:30 (GMT) with a 30-minute break in between.

You should allow for 10 - 15 hours study time per week in addition to the weekly lessons and tutorials.

After completing the course, you should be able to understand the workings of the algorithms we explore in the course and how they can solve specific signal processing problems.

Full details are available here: https://www.conted.ox.ac.uk/courses/digital-signal-processing-online

Tuesday 21 June 2022

DSP Tech Brief : Notes On Notch Filtering - IIR vs. FIR

 A very simple way to implement a notch filter is to use and FIR filter and place a conjugate pair of zeros on the unit circle to define the location of the notch, as shown in the following z-Domain diagram:


Testing this filter in the application showed that while the initial results were good, because the interference was removed, there was a subtle negative impact on the performance of the signal processing functions further down the chain.

On investigation, the cause of this performance degradation turned out to be due to the FIR filter implementation not resulting in equal signal magnitudes in the pass-bands either side of the notch.

This can be clearly seen in the following diagram, where we have a sample rate of 16 kHz and a notch at 2 kHz.


Swapping the FIR filter for a single IIR biquad filter solved the problem and the IIR filter frequency response is shown below:


Functions for designing both FIR and IIR notch filters are included in the Numerix-DSP SigLib DSP and ML library, which can be downloaded from here: https://github.com/Numerix-DSP/siglib.

Sunday 23 January 2022

Analog I/O Example For The NXP LPC55S69-EVK

 I recently wrote some DSP code for the excellent NXP LPC55S69-EVK.

The standard audio I/O example for the LPC55S69-EVK implements a very simple piece of code to read in an array of audio data from the stereo codec and then write it back. It does not show how to access that data or process it using background DSP functions.

I have written an example that uses interrupts, ping-pong buffers and background tasks to apply DSP functions to the real-time audio datastream.

The example can be downloaded from: https://github.com/Numerix-DSP/embedded_projects


Version 10.00 Of The SigLib DSP Library Released And Is Now Fully Open Source

SigLib V10 now includes enhanced functions for training and inferring Artificial Intelligence and Machine Learning Convolutional Neural Networks (CNNs). In addition to the traditional DSP functions, the SigLib ML functions are designed for embedded applications such as vibration monitoring etc. They are architected for Edge-AI applications and have been written for the highest level of MIPS and memory optimization.

Containing over 1000 DSP and ML functions, SigLib is now available with a dual open source (GPL) and commercial license and is available from GitHub at: https://github.com/Numerix-DSP/siglib.