Q. Why should we go for digital signal processing where as the most of the real world data is in analog mode? Reconfiguration – Reconfiguration of analog circuits require redesigning the hardware followed by testing and verification where as DSP chips can be easily reconfigured by changing the software. Accuracy – DSP has higher accuracy. Storage – Digital signals can be easily stored on magnetic disks hence easily transported and stored for offline processing Precision – It is difficult to perform precise math operations on analog signals but DSP algorithms are easier to implement and can attain precision as well. Cost – DSP is cheaper than its analog counterpart.
Q. What are the differences between a microprocessor and a DSP processor? Q. What is the convolution? Any signal processing system with a memory makes use of convolution. Convolution is a mathematical operation where the output is obtained from the current input and previous inputs weighted appropriately. Output of an LTI system is obtained as the convolution of input and its impulse response. Application of convolution – Filters Convolution theorem – Convolution in time(frequency) domain is multiplication in frequency(time) domain.
Q. Why do we need Fourier transform in DSP? Response of a physical system to complex stimuli can be understood by expressing the complex stimuli as a linear algebraic sum of simple stimuli. Each of these simple stimuli is applied in isolation to the physical system under test. The individual results obtained are finally added together which gives us the end result. Complex waveforms can be expressed as sum of sines and cosines. Square waveform or any other waveform is not used to decompose the complex waveform because only sines and cosines have the special property – when applied as input to an LTI, the output has the same frequency. Only amplitude or phase may vary. Fourier Transform Fourier Series DTFT (Discrete Time Fourier Transform) DFT (Discrete Fourier Transform)
Continuous and Aperiodic Continuous and Periodic Discrete and Aperiodic Discrete and Periodic
In real world digital signals with only finite number of samples are available therefore the signal samples are periodically repeated in order to generate discrete periodic waveforms. Hence only DFT is applicable in DSPs
Zeros can be appended to finite length discrete signals thus producing discrete aperiodic waveforms. But in that case the result waveform is made up of a sum of infinite number of sinusoids. Therefore DTFT cannot be calculated by a computer algorithm.
Q. What is use of windowing in digital filters? The ideal filter impulse response is infinite (sinc function) where as for an FIR filter, the impulse response should be finite and non causal (dependent on future input). In order to accomplish the same, windows are used to truncate the impulse response and then it is shifted to meet the FIR design requirements. Window functions control the Roll off rate at pass band and stop band edge Stop band attenuation (ripples)
Q. Tell something about Interpolation and decimation?
Q. What is the need of FFT ? FFT is useful for an efficient implementation of DFT in the DSP software.
Q. What’s the difference between FFT and DFT? FFT algorithm performs complex DFT with much lesser computational effort compared to the later. DFT computations = kDFT N2 FFT computations = kFFT Nlog2N
Q. What is the advantage of a Direct form II FIR over form I?
Q. What is the difference between equi ripple filter and FIR filter? Q. What is the application of Cross correlation and Auto Correlation? Autocorrelation is used to compare a signal with a time delayed version of itself. Autocorrelation has two important properties. Firstly, ACR only depends on the time lag and the maximum value of ACR occurs for k = 0 i.e. when the two signals exactly superimpose and have the highest possible similarity. The value is repeated after regular intervals in case of periodic signals. | ( )|
( )
ACR is an even function. ( )
(
)
Q. Explain using convolution the effects of taking an FFT of a sample with no windowing (rectangular window). Time domain signals always have a finite length. This is equivalent to multiplication of an infinite duration signal with a finite duration time window (rectangular function). Since multiplication in time domain is equivalent to convolution in frequency domain therefore, the frequency response of an infinite length signal is convolved with sinc function (frequency response of rectangular function). The resultant FFT spectrum is a sinc function instead of a dirac delta function (ideal case). This means ideally the power is concentrated only at the signal frequency but in reality the power is spread to adjacent frequencies. This phenomenon is called as spectral leakage. Although it can never be completely eliminated but the effect can be reduced by using window functions. Q. What are basis vectors in a transform? Any element in vector space can be expressed as the weighted sum of its basis vectors. Basis vectors are linearly independent in nature i.e. a basis vector cannot be expressed as the algebraic sum of other basis vectors. In DFT, sines and cosines are basis functions. DFT coefficients are amplitudes assigned to sines or cosines and the signal is represented as sum of scaled sines or cosines.
Q. In signal processing, why we are much more interested in orthogonal transform? Orthogonal transforms like DFT, DCT have two advantages Orthogonal transforms tend to decorrelate signal components – physical signals in time domain show high correlation (any signal discontinuity requires very large energy) hence unknown signal components can be determined using the known ones (interpolation and extrapolation). This is not true in frequency domain i.e. signal components are decorrelated In time domain, power is evenly distributed throughout the signal. In frequency domain, power is concentrated mainly at the signal frequency and a fraction of power is spread to adjacent frequencies only. Due to the above two properties, signal processing operations like filtering etc are easily carried out in the orthogonal transform (frequency) domain, instead of the time domain.
Q. How does polyphase filtering save computations in a decimation filter? Q. Why IIR filters do not have Linear phase? Linear phase filter means constant group delay i.e. all the input frequencies appear at the output after a fixed time. FIR filters have finite impulse response. The output signal is obtained from the convolution of input signal and impulse response. Since impulse response is finite hence linear phase is possible.
IIR filters have infinite impulse response. The IIR filter response may last indefinitely due to feedback in the filter. Since input frequencies do not appear at output at the same time therefore phase is not linear. Help - http://www.gearslutz.com/board/mastering-forum/569408-linear-phase-versus-minimumphase-eqs.html Q. Whats basic difference b/w winer filter and kalman filter and lms filter Q. What is the use of windowing in digital filters FIR filters are expressed by the equation ∑ FIR filters are causal in nature i.e. output depends only on current and previous inputs and not on future input and FIR filters have finite impulse response. The impulse response of an ideal LPF is a sinc function which is infinite and the values on the left hand axis correspond to future inputs. The finite impulse response for FIR filter is obtained by – a. Truncating the infinite impulse response (rectangular window in default case) b. Shifting impulse response to right so that it is causal in nature. Truncation in time domain leads to ripples in frequency domain (a discontinuous signal cannot be expressed as the sum of finite terms in frequency domain. It is in fact a sum of infinite terms. Therefore larger the number of terms used in expression better is the approximation). This is known as Gibbs phenomenon. The ripples can be removed by using windows. Hence truncation of impulse response for the design of FIR filters is done using windows. Windows are smoothing functions which softens the signal discontinuities (time domain) and thus attenuate ripples in frequency domain.
Q. What are the pros and cons of Discrete Cosine Transform?
Q. What is Interpolation and decimation filters and why we need it?
Q. What is the simplest high pass filter ? write the equation? C R Q. What is the difference between ProtoPlus and ProtoPlus Lite? ProtoPlus prototyping daughter card - A plug-in, 2-connector, multi-layer, low noise, and stackable prototyping board that plugs into the Texas Instruments DSK and EVM DSP development systems.
ProtoPlus Lite prototyping daughter card - A Low cost, 2-connector, plug-in prototyping board that plugs into the Texas Instruments DSK and EVM DSP development systems.
Q. What is Auto Regressive Model? How is the order of auto regressive model is decided? AR model is defined by the below equation ∑ The current output xt is a weighted sum of previous terms in the series. The weighting factors used for the previous terms are called AR coefficients (ai). N is the order of the AR model and is WGN. The AR coefficients are determined using the following methods – Yule Walker least square Method Burg Method AR model order Initially the RMS (The RMS error between actual series and the series predicted using AR coefficients (given N)) decreases with increase in model order and then the RMS flattens i.e. increasing model order has no effect. It may so happen that the selected model order leads to an underfit or overfit situation, this should be avoided. Model order selection criterion – AKAIKE Information Criterion In filter design, AR models are like IIR filters or all pole filters. Q. What is the basic difference between FIR and IIR filters? Analog filters are IIR but Digital filters can be IIR or FIR. IIR Impulse response is recursive and hence infinite Non linear phase Filter response may last indefinitely
FIR Impulse response is finite Linear phase Constant group delay
Q. What two PSK modulation orders differ exactly by a factor of two in spectral efficiency? Q. Under what conditions is the available bandwidth of a digital system Fs Hz instead of Fs/2 Hz? Q. What is the difference between DFT and DTFT? DFT is applicable to discrete periodic signals whereas DTFT is applicable to discrete aperiodic signals. DSP uses DFT only. Q. FFT is in complex domain how to use it in real life signals optimally? Imaginary input for the real signal is set to 0 and FFT is calculated just as in case of complex signals.
Q. What is Gibbs phenomenon? When signals with sharp discontinuities are transformed into frequency domain then it leads to ringing effect known as Gibbs phenomena. This arises due to the fact that sharp signal discontinuity implies infinite energy and hence it is expressed as a sum of infinite terms. In reality we try to express the same as a sum of finite terms therefore the Fourier transform serves only as an approximation. The approximation gets better as the number of terms increases i.e. the ripples get closer to the point of discontinuity but they never completely die out. The overshoot due to Gibbs phenomenon can be reduced by using suitable window functions. Q. Suppose we have a system with transfer function H(z) = 1 / ((z – 1.1)*(z – 0.9)). Is the system stable or unstable? All poles should lie within the unit circle for the system to be stable. For the above z = 1.1 and 0.9 hence system is unstable.
Q. Differences b/w butterworth chebyshev? Butterworth Filter Broader transfer region Faster response Flat pass band and stop band
Chebyshev Filter Narrower transfer region Slower response Ripples in pass band and flat stop band (Type I) Ripples in stop band and flat pass band (Type II)
Q. How do you reduce spectral leakage? Windowing is used to reduce spectral leakage. Spectral leakage arises due to signal discontinuities on either end. Windows are smoothening functions which apply a weighting to the signal amplitude such that signal samples smoothly reduces to zero on either end, instead of the abrupt discontinuities as in the case of default (rectangular) window.
Q. Why is FFT faster than DFT? What is the actual concept behind this? FFT is carried out in the following manner a. N point signal is split into N single point signals. This process takes place in log2N stages and is termed as interlaced decomposition. At each stage the even and odd numbered samples are placed in two separate groups. This process can be simply carried out by bit reversal operation. 1 0001 1000 8 2 0010 0100 4 3 0011 1100 12 4 0100 0010 2 5 0101 1010 10 6 0110 0110 6 7 0111 1110 14
8 9 10 11 12 13 14 15
1000 1001 1010 1011 1100 1101 1110 1111
0001 1001 0101 1101 0011 1011 0111 1111
1 9 5 13 3 11 7 15
b. The N single point time domain signals are converted to N frequency spectrums c. N frequency spectrums are combined and arranged in their original order to obtain N point frequency spectrum. This is done using butterfly operation. Thus FFT splits the DFT operation into smaller simpler operations which are quick to perform. As a result its computational efficiency is higher than DFT. Q. What is the concept of stability of an LTI system? How to check if a given system is stable? LTI system is stable if its impulse response is absolutely summable.
Q. How does polyphase filtering save computations in an interpolation filter?
Q. If a have two vectors how will I check the orthogonality of those vectors? The dot product of two orthogonal vectors is zero.
Q. Can IIR filters be Linear phase? how to make it linear Phase?
Q. How is the non-periodic nature of the input signal handled? The finite length signal can be repeated periodically in time thus producing an infinite length signal with periodicity. Or zeros can be appended to the end of a non periodic signal. The former helps in DFT and latter in DTFT.
Q. What is aliasing and how do we prevent it? If a continuous signal is sampled at
Then the sampling rate is not sufficient to capture the signal variations in time and hence when the sampled signal is used to reconstruct the continuous signal, it produces a false representation. Aliasing can be avoided by either choosing sampling frequency to be
Or the maximum frequency is restricted by using BPF. Q. What is the need of Digital Signal Processing?
Easy reconfiguration High precision and accuracy Easy implementation Easy storage
Q. Why do we need I&Q signals? A signal can be expressed as a sum of in phase and quadrature phase components. These two components have a phase shift of 90 degrees. IQ signals are an easy way to obtain both amplitude and phase of a signal. Amplitude is √(I2 + Q2) and phase is arctan(I/Q).
Q. What do you mean by spectral resolution? Minimum frequency separation such that the corresponding sinusoidal peaks can be distinguished in a frequency spectrum is called spectral resolution. Spectral Resolution has a finite limit due to the fact that only finite duration signals are available for analysis. Q. What is the special about minimum phase filter? A filter is said to be minimum phase if all its zeros and poles lie inside the unit circle (excluding the unit circle). Both the filter (poles inside unit circle) and its inverse filter (zeros of H(z) are poles of 1/H(z)) are stable. The filter is causal since non causal terms correspond to poles at infinity
Q. How can you compute fourier transform from Z-transform ? Q. Why after DCT we use a zig zag manner for run length coding? Q. Why we use DCT extensilvely in compression? Q. What is the difference between DSPs and microprocessors? Microprocessors like Pentium used in our computers is used for handling data manipulation task which mainly includes data storage, data organization and data retrieval. These tasks basically involve data transfer from one point to the other and inequality evaluation (for example writing a word document, storing and printing it). The execution time for these tasks may vary a little. The conditions imposed on their throughput is not so critical. DSPs on the other hand are specifically designed for handling mathematical calculations involved in DSP algorithm. These tasks mainly involve multiplication and addition and less of data transfer or inequality evaluation (for example calculating the output of FIR filter at nth instant means multiplying n-1 previous inputs and the current input by corresponding FIR filter coefficients and finally adding all these products). The execution time is defined and it doesn’t vary otherwise the utility of the
application is rendered futile (for example a hearing aid). As the throughput of the DSP increases, so does the cost and its design complexity. Q. What is circular buffering? Circular buffering can be used to calculate the FIR filter output using DSP in real time (Real time processing). A chunk of continuous memory locations (an array of memory addresses) used for storing input samples where the end of the array is connected to the start of the array is called circular buffer. A circular buffer is managed by 4 parameters namelya. b. c. d.
Pointer indicating the start of circular buffer Pointer indicating the end of circular buffer (or variable holding the length of circular buffer) Step size of memory addressing Pointer indicating the latest sample. The first three parameters are constant but this one changes every time a new sample is acquired.
Every time the latest sample is acquired it replaces the oldest sample and the pointer is moved one address ahead. For example calculating FIR filter output (8 filter coefficients) 20041 to 20048 holds the coefficients. Initially x[n] is stored at 20044 and x[n-7] is at 20045 (The pointer points to 20044 as the most recent sample). As the newest sample is acquired it gets placed at 20045 and the pointer now points to 20045 as the latest sample. 20044 holds x[n-1]. Q. Name DSP Architectures a. Von Neumann Architecture – Single memory to store program instructions and data. Simple in design but the processing speed is low. Most computers use this architecture. b. Harvard Architecture – Separate memories to store program instructions and data. Used in DSPs c. Super Harvard Architecture (SHARC) – Separate memories to store program instructions and data like in Harvard architecture. Special features of SHARC
Instruction cache in CPU - The amount of data transferred from program memory to CPU is less in comparison to the amount of data transferred from data memory to CPU (addition of two numbers means two binary values are transferred from data memory and one binary value corresponding to instruction code is transferred from program memory). Therefore a part of program memory is used to store secondary data. Further DSP programs often contain loops (same set of program instructions executed repeatedly). The CPU contains instruction cache – a small memory used to store instruction set in a loop. The first time a loop is executed, the instructions are fetched from program memory hence the execution slows down a bit as both data and program instructions are being transferred from program memory to CPU but from the second iteration onwards, the program instructions are directly fetched from instruction cache and the data is transferred from both program and data memory to the CPU. This increases the execution speed of the DSP several times. IO controller – It enables high speed input and output of data.
DAG (Direct Address Generator) – The CPU contains 2 DAGs, one for program memory and the other for data memory. The DAG’s indicate the address in program or data memory where data should read or written. It also helps in efficient FFT.
Q. What are the two types of arithmetic in DSP?
Number of bits used to represent the number Range of values
Representation
Fixed Point 16 Smaller range – Total number of levels that can be represented using 16 bits are 216 (unsigned integers 0 to 65535 and signed integers 32767 to 32768). The numbers have equal spacing between them.
2’s complement
Floating point 32 (Single precision) 64 (Double precision) The largest possible number and the smallest possible number that can be represented is much higher /smaller since the spacing between numbers is unequal. Larger numbers have larger spacing and smaller numbers have smaller spacing. For any number, the gap is 106 times smaller than the number. For single precision (32 bits) 0 to 22nd bit – mantissa as a binary fraction. 23rd to 30th bit – exponent in offset binary with an offset of 127. 31st bit – sign.
Questions on Digital Filters Q. What are the possible ways of characterizing a filter? The filter behavior can be completely described by any of the following:
Impulse Response Step Response Frequency Response
Impulse and Step response describe a filter in time domain (Step function is obtained from the integration of Impulse function) and frequency response describes a filter in frequency domain. If anyone response is defined, the other two are fixed. Q. In which two domains can we evaluate the performance of a digital filter? The performance of digital filter can be evaluated either in Time domain or in Frequency domain. Q. What parameters are used to analyze the filter performance in time domain? Parameters for evaluating time domain performance are as follows:
Transition Speed of Step Response – The step response should be faster than the change in input.
Overshoot – The step response should not have overshoot since it becomes confusing if the overshoot is due to signal behavior or filter behavior Phase linearity –Upper half of the step response should be symmetrical to its lower half.
Q. What parameters are used to analyze the filter performance in frequency domain? Parameters for evaluating Frequency domain performance are as follows:
Roll of rate – The transition edge between pass band and stop band should be sharp in order to effectively stop the undesired frequencies and pass the desired ones. Ripples in Pass band – The pass band should not have ripples so that the desired frequencies pass through the filter unaltered. Stop band attenuation – The stop band should have high attenuation in order to effectively block the undesired frequencies.
Q. How to design HPF using LPF? A high pass filter can be obtained from a low pass filter using the below techniques
Spectral inversion – Frequency response of LPF is flipped top to bottom. This is done by changing the sign of filter coefficients and adding 1 to the filter coefficient at the center of symmetry. The same trick can be used to obtain LPF from HPF, BPF from BSP and vice versa. (Note HPF output is obtained when the LPF output is subtracted from the original signal)
Spectral Reversal – Frequency response of LPF is flipped left to right. This is done by multiplying every alternate filter coefficient by -1. This is equivalent to multiplying the filter coefficients with a sinusoid of frequency Fs/2. If the frequency is lesser than Fs/2 then the LPF is converted to BPF.
Q. How to design BPF and BSF using LPF and HPF?
BPF – Convolution of h(n) of LPF and HPF BSP – Cascading h(n) of LPF and HPF
Q. How can we classify digital filters?
Time Domain Frequency Domain
Filters implemented by convolution (FIR) Moving Average Filter Windowed Sinc Filter
Filters implemented by recursion (IIR) Single Pole Filter Chebyshev Filter
Q. What is a moving average filter? In a MA filter, the output is obtained by averaging M signal samples. The average can be one side average i.e. M previous input samples are used or symmetrical average where the samples are symmetrical with respect to the output point. MA filter is implemented by using convolution in the simplest term.
[]
∑ [ (
[]
]
)
∑ (
[
]
)
Q. What is the application of MA filter? Moving average filter is used to reduce the random white noise. If the moving average filter uses 100 input samples then the noise is reduced by a factor of 10. Increasing the filter order improves noise reduction but at the same time blurs the sharp signal edges. Q. Comment on the performance of MA filter in time and frequency domain. In time domain the step response is a rectangular function containing M points. Hence the frequency response is a sinc function sin(πfM)/Msin(πf).
MA filter performs well in time domain. It acts as a smoothing filter. MA performs badly in frequency domain. Its frequency response is sinc function hence its roll off rate is very slow and the stop band attenuation is poor. (Note a filter can never perform equally well in both time and frequency domain) The frequency domain response can be improved by using multiple passes of MA filter. Thus using 2 or 4 passes , the resulting stop band attenuation is much higher and the roll off rate is also quicker. (Multiple pass MA filter is slightly slower than single pass MA filter)
Q. Why is MA filter much faster than all the other filters? The MA filter output can be calculated by simply adding the latest sample and subtracting the oldest sample from the previous output. Only the first output needs averaging of M samples. Therefore the filter is much faster than other filters. Q. Write the equation of a recursive filter. Recursive Filter – The output is equal to sum of input samples (current input sample and N-1 previous input samples) weighted by ‘a’ coefficients and previous N – 1 previous outputs weighted by ‘b’ coefficients. [ ]
[ ]
[ [
] ]
[ [
] ]
[ [
] ]
……………………………………+ …………………….
Analog to Digital Converters a. Resolution can be defined in the following ways M Bits – An ADC with M bit resolution can encode an analog signal into 2M discrete levels. LSB voltage – The least amount of voltage that needs to be applied at the ADC input in order to guarantee a change in the output code level.
Resolution of ADC is limited by SNR of the digitized signal. An ADC can resolve a signal to only certain number of bits of resolution called effective number of bits (ENOB). If ENOB increases by 1 bit, the SNR increases by 6 dB. b. Sources of error in ADC are as follows: Quantization Error is due to the finite resolution of ADC and is unavoidable. It varies between 0 and LSB/2. Non linearity is the non linear relation between input and output of ADC. It reduces the dynamic range of ADC and also its possible resolution. It can be corrected by calibration. Aperture Error is due to clock jitter Quadrature Modulation
Quadrature Modulation or IQ modulation can be used to alter the phase, frequency and amplitude of carrier frequency. I signal (0 phase shift)
Signal Splitter (Hilbert Transform)
Carrier Frequency
Output Signal
∑
Q signal (90 phase shift)
Altering phase of the input signal Signal Splitter (Hilbert transform) is used to split the carrier frequency into two components – cosine wave(same phase as input signal) and sine wave (90 phase shifted from input signal) The cosine wave and sine wave components are scaled in amplitude. The scaling is done by feeding weighting factors to the mixers. Notice I and Q data fed to the mixers is only a DC level hence there is no change in frequency after the mixing process. The scaled cosine and sine waves having the same frequency are added together to generate the output signal. Thus the phase of the output signal changes depending on the scaling factors used for I and Q components. The amplitudes for I and Q components is kept constant therefore no AM. Only the phase changes depending on the weighting factors of I and Q. Altering frequency of the input signal I and Q data are cosine and sine waves with frequency foffset. The I and Q signals are mixed with cosine and sine components of the input signal (frequency f). The resultant outputs are cosine and sine waves with frequency . The output signal frequency is thus shifted from the input signal frequency by foffset. Altering amplitude of the input signal. The amplitude of I and Q signals can be varied in order to amplitude modulate the input signal. The initial phase of the output signal is 0 if only the amplitude of I signal is being varied and the initial phase can be 45 if both the amplitudes of I and Q are being varied PM
FM
AM
Weighting factors of I and Q changed. I and Q are fixed DC levels. The relative percentage of I and Q determines phase I and Q are frequency modulating signals which shifts frequency of input signal. Amplitude of I and Q is held constant. Initial phase of the output depends upon the point in time when the signal is observed. Amplitude of I and Q are varied. Initial phase depends on the ratio of I and Q components.
FIR Filters Larger the number of filter coefficients, sharper the filter transition from PB to SB.
For designing LP FIR filter. Choose cutoff frequency. This defines the LP filter response in frequency domain i.e. FFT of the filter response. The number of FFT points should be much larger than the number of filter coefficients. The larger the FFT size, the more accurately the filter coefficients are calculated. Choose number of filter coefficients. Perform IFFT to obtain the filter coefficients. Window function is applied to the filter coefficients in order to obtain better stop band attenuation. Windows also alter the transfer region. For designing HP FIR filter High pass filter can be obtained from the LPF simply by multiplying the alternate coefficients by -1. For designing BP FIR filter Choose cutoff frequency and number of filter coefficients like in LPF design. Window the filter coefficients Frequency shift the filter coefficients - Multiply by cosine wave in time domain. The frequency of the cosine wave decides how much the LPF response is shifted. If the frequency of the cosine is too high then we obtain a HPF. Multiplication in time domain is convolution in frequency domain. Therefore the frequency response of LPF is convolved with the frequency response of cosine wave which is a dirac delta function. So the convolution result i.e. the shape of BPF response is same as the LPF response but only shifted in frequency.