Posts

Showing posts from April, 2020

[Chapter 5.1] Meaning of General Linear Phase or Group Delay of a filter?

Image
For me, one better description of the  general linear phase (GLP)  is a  constant group delay . By definition, group delay is a negative derivative of phase [1] (In fact, the detailed phase/delay relationship can be derived but I suggest we just accept them.). Then, the Derivative (group delay) of a linear (phase) is constant and vise versa. Then, let's move on to the meaning of group delay. the group delay of a frequency represents the delay unit of the filter to that frequency. So, the filter may treat different frequencies with different delay units. For an extremely bad example of a non-linear filter, the input signal 'do re mi' may becomes 're mi do' in the output. A GLP filter can guarantee that such weird condition will never happen. Github link ----------------------------------------------------------------------------------- Here I wrote an example. The example comes from Chapter 5.1.2 in the bible of DSP[2] and I just implemented the sample. Fi

[Ch4 ADC/DAC] How to simulate ADC/DAC process in Matlab? How to actually reconstruct a signal nearly sampled in Nyquist Rate?

Image
Reconstruction is essentially a kind of interpolation or so-called digital to analog conversion (DAC). Detail descriptions are introduced in chapter 4.8.3 of the DSP Bible [1]. Although we all understand the basic sampling theory, the problem is how to bridge the theory and practice . Because all the signals we can simulate in Matlab are essential 'Digital'. So, the so-cal ADC/DAC is just an approaching simulation. Let me briefly justify the difference. Ideal Reconstruction in DAC:  There is typically a zero order hold circuit and reconstruction filter. Please note that the frequency response of zero-order hold is not evenly flat so a reconstruction filter comes into an aid. Matlab Simulation in DAC: There is no need to actually simulate a zero-order hold. All you need are an upsampling and an ideal low pass filter. This sample code sample a simulated 2 Hz analog signal,x_a, (with sampling rate 1500 Hz) to a discrete-time signal,x_d, with 5 Hz sampling rate (near