You are on page 1of 16

Applications of signal processing

Spectral analysis of sinusoidal signals:


An Important applications of digital signal processing methods is in determining in the discrete time domain .the frequency content of a continuous time signal is more commonly known as spectral analysis. It involves the determination of either energy spectrum or the power spectrum . Discrete fourier transform can be employed for the spectral analysis for a finite length signal composed of sinusoidal components as long as the frequency , amplitude and phase of each sinusoidal components are time invariant and independent of the signal length. There are practical situations where the signal to be analysed is instead of non-stationary for which these signals parameters are time varying. Eg: chip signal,speech,radar,sonar,speech,sesmic,music For an example , chirp signal can be represented as X[n]=A cos (on2) Where, = 1010-5

here, instantaneous frequency of X[n] is given by 2on2 which increases linearly with time. A description of such signals in frequency domain using simple DFT of the complete signal will provide misleading results. To overcome this time varying nature of the signal parameters, an alternative approach would be. 1- To segment the sequence into a set of sub-sequences of short length 2- with each subsequence centered at uniform intervals of time 3- Its DFT computed separately. If the subsequence length is reasoably small , It can be safely assumed to be stationary for practical purposes. As a result, frequency domain representation of long sequence is given by a set of shot-length DFTs, i.,e a time dependent DFT. Here, the signal may be considered as quasistationary To represent the non stationary signal , X[n]in terms of a set of short length subsequences, we can multiply it with a window w[n] that is stationary with respect to time and move the signal through the window. For example, fig (2) shows four segments of the chrip signal of fig (1) seen through a stationary rectangular window of length 200.

Fig.1

Fig.2
As shown in fig, segments can be overlapping in time. A discrete time fourier transform of the short sequence obtained by windowing is called the short term Fourier transform , which is thus a function of the location of the window relative to original long sequence and the frequency.

short term Fourier transform (STFT) (or) Time Dependent Fourier Transform:
It is also called GABOR TRANSFORM (or) SLIDING WINDOW FOURIER TRANSFORM

XSTFT(ej,n) =

) ( )

W[n] is a suitably chosen window sequence. If w[n] =1, the definition of STFT equation reduces to conventional discrete time fourier transform of x[n]. In the conventional fourier transform , the STFT is a function of two variables: 1- Integer variable time index n 2- Continuous frequency variable Thus , the equation can be defined as XSTFT(e ,n) is a periodic function of with a period of 2. In most cases, magnitude of STFT is of interest and magnitude of STFT is usually referred to as the specrogrram. It is a function of two variables and display In 2 dimensions would be with magnitude represented by darkness of the plot.
j

Spectrogram of chirp signal

Here,

white areas represents zero valued magnitudes gray areas represents non zero magnitudes black areas represents largest magnitudes.

Vertical axis represents frequency variable , Horizontal axis represents timeindex n. As the instantaneous frequency of the signal chirp signal increases linearly, the short black line move up in vertical direction and eventually because of aliasing , the black line starts moving down In the vertical direction. As a result, the spectrogram of the cir signal essentially appears as a thick line In the form of a triangular shape. =================================================================================

MUSICAL SIGNAL PROCESSING:


Musical programs are produce in basically two stages. 1- Sound form each individual instrument is recorded in an acoustically inert studio on a single track of a multi track tape recorder. 2- Then, signal from each track are manipulated b the sound engineer to add special audio effects and are combined in a mix-down system to finally generate the stereo recording on a two track tape recorder. The audio effects are artificially generated using various signal processing circuits and devices. Limitations of dsp: Bandwidth limitations Speed limitations Finite word length problem role of filter: Filter is main component of dsp.it has 2 main uses

1. Signal separation 2. Signal restoration Signal separation is used when contaminated with interference (or) noise (or) other signal Signal restoration is when signal is distorted in some way or other. Eg: 1. Audio recording made with poor equipment may be filtered to get the original sound. 2. Debugging of an image occurred with improperly focused lens or shaky camera. Different types of operations can be performed in musical processing such as.. Time domain operations Frequency domain operations Time domain operations: Commonly used oprations in musical sound signals are 1. Echo generations 2. Reverberation 3. Flagging 4. Chorus generation 5. Phasing Echo generation: Echos can be generated using filters such as 1. Single echo filtters 2. Multiple echo filters

Echoes can be generated using delay units .Echo is simply an identical copy original audio signal but delaed by fixed account in time. Single echo filtters: consider the signal Y[n] = x[n]+x[n-R] , || < 1

Here, single echo appearing R sampling periods later can be simply generated b the FIR filter of fig shown below.

Figure 1 : signle echo filter : (a) filter structure (b) typical impulse response (c) magnitude response for R = 8 and = 0.8 Here R is the time the sound wave takes to travel from source to listener. is the loss caused by propagation or reflection The delay parameter R denotes the time the sound wave takes to travel form the sound source to the listener after bouncing back from the reflecting wall. represents the signal loss caused by propagation and reflection. Figure b shows the response impulse response of the single echo filter. Figure c shows the magnitude response of a single echo FIR filter for =0.8 and R = 8. Because of the comb like shape of the magnitude response, the filter is also called comb filter. peaks occur at

= =
( )

Dips occurs at

Multiple echo filters: To generate a fixed number of mmultiple echoes spaced sampling periods apart with exponents decaying amplitudes , one can use an FIR filter with a transfer function of the form

H(z) = 1+z-R +2 z-2R+3 z-3R+.N-1 z - (N-1)R

FIG 2: (a)IIR filter structure (b) impulse response with = 0.8 for N = 6 and R = 4

For infinite number of echoes spaced R sampling periods apart with exponentially decaying amplitudes can be created b an IIR filte with a transfer function of the form.

H(z) = 1+z-R +2 z-2R+3 z-3R+.N-1 z - (N-1)R

Fig3: IIR filter generating an infinite number of echoes (a) shows one possible realization of the above IIR filter (b) shows first 61 impulse response samples for R= 4 (c) shows magnitude response of this this IIR filter for R= 7 The maximum and minimum values of the magnitude response are given by =5 and
.

= 0.5556.

The fundamentalrepetition frequenc of the IIR multiple echoe filetr of is given by FR =

Reverberation:
The sound reaching the listener in a closed space, such as a concert hall, consists of several components: direct sound early reflections reverberation. Early reflections consistes of spaced echoes hat are basically delayed and attenuated copies of the direct sound Reverberation is composed of densely packed echoes.

The sound recorded in a n inert studio is different from that recorded inside a closed space , and a a result, the former does not sound natural to the listener. however, digital filtering can be employed to convert the sound recoded in an iner tudio ino a natural sounding one b artificially creating the echoes and artificially adding them to the original signal. Fig 3 shows IIR comb filter by itself does not provide natural surrounding reverberation for two reasons 1. fig 3 (b) its magnitude response is not constant for all frequencies resulting in a coloration of man musical sounds that are often unpleasant for listening purposes. 2. fig 3 (c) The output echo density , given by the number of echoes per second, generated by a uunit impulse at the input , is much lower than that observed in real room, thus causing fluttering It has been observed that approximately 1000 echoes per second are necessary to create a reverberation that sounds free of flutter. To develop a more realistic reverberation ,l a reverberator with an allpass structure ,is indicated in fig 3 (a).its transfer function is given by H(z) =

||<1

In steady state , the spectral balance of the sond signal remains unchanged due to the unit magnitude response of the allpass reverberator. The IIR comb filter and allpass reverberator are basic reverberator units that are suitably interconnected to develop a natural sounding reverberation.

Fig 4: all pass reverberator (a) Block diageram representation (b) Impulse response with = -0.8 for R = 4

Fig 5: a proposed natural sounding reverberator scheme with interconnection composed of a aarallel connectionof four IIR echo generators in cascade with two allpass reerberators.

Flanging: It was created by feeding the same musical piece to two tape recorders and then combining their delayed outputs while varying the difference t between their delay times. One way to slow down one of the tape recorders by placing the operators thumb on the flange of the feed reel,which led to the name flanging. It is one of the special sound effects that are often used in the mix down process. The FIR comb filters can be can be modified to create the flanging effect. Fig 6: generation of a flanging effect here, the unit generating the delay of R samples T is sampling period (n) is time-varying delay. Input-output relation is y(n) = x[n] + x[n- (n)] periodically varying the delay (n) between 0 and R ith a low frequency 0 such as (n) = ( ( )). Chorus generator: The chorus effects achieved when several musicians are playing the same musical piece at the same time nut wit small changes in the amplitudes and small timing differences between their sounds. Such an effect can also be generated synthetically by chorus generator from the music of single musician. fig 7: generation of a chorus effect it can produce chorus of four musicians from the music of a single musician. To achieve this effect, the delays i (n) are randomly varied with very slow variations.

Phasing effect: It is produced by processing the signal through a narrow band notch filter with variable notch characteristics and adding a scaled portion of the notch filter output to the original signlal. Fig 8: generation of phasing effect The phase of the signal at the notch filter output can dramatically alter the phase of the combined signal, particularly around the notch frequency when it is varied slowly. The notch filter can be replaced with a cascade of tuneable notch filters to provide an effect similar to flanging. Frequency domain operations: The frequency responses of individually recorded instruments or musical sounds of performers are frequently modified by the sound engineer during the mix-down process. These effects are achieved b passing the original signals through an equalizer. The purpose of the equalizer is ot provide presence by peeking the mid-frequency components in range of 1.5 to 3 kHz and to modify the bass-treble relationships by providing boost or cut to components outside this range.

Many of the low order digital filters employed for implementing these functions have been obtained by applying the bilinear transformation to analog filters and then develop their digital equivalents. Analog filters: Analog flters take the analog signal as input and process the signal as input and process the signal and finally gives the analog output.an analog filter is constructed using resistors, capacitors , etc. Simple low pass and high pass analog filters with a butterworth magnitude response are usually employed in anlaog mixers.

digital filter: a digital filter processes and generates digital data. a digital filter consist of elements like adder, multiplier and delay units .digital filters are vastly superior in the level of performance in comparison to analog filters.

=================================================================================

SIGNAL COMPRESSION:
The signals carry information .most digital signals encountered in practice contains a huge amount of data . For example, A gray-level image of size 512512 with 8 bits contains (512)2 8 =2,097,152 bits. A colour image of same size contains 3 times asmany bits. For efficient storage of digital signals, it is often necessary to compress the data into smaller size requiring few number of bits. A signal in compressed form requires less bandwidth for transmission. The signal compression is concerned with reduction of amount of data, while preserving the information content of the signal with some acceptable fidelity i.,e. loyalty or truthfulness 3 types of data reductancies are usually encountered inpractice. 1. Coding reductancy 2. Intersample reductancy 3. Psycho visual reductancy

input sequence to energy compression block. x transformed into another sequence in very few samples y quantizer block develops an approximate representation of in the form of integer valued sequence by adjusting the quantizer step size to control the trade off between distoration and bit rate. d entropy coding block variable length entropy coding to encode the integers in sequence q into a binary bit stream d Entropy Decoding block regenerates the integer vlaude sequence q from the binary bit stream d. Inverse quantizer develops for a given level of accuracy

x y q

Reconsruction block develops

Coding Reductancy:
Let us assume that each sample of x(n) is ri .

ri = each sample of x(n) with one of q distinct values with probabilities pi 0<i<Q-1
where, Pi 1 and Each possible value of ri is called symbol. Thus , if the signal conaikns total of N samples with mi denoting dthe totlal number of samples taking value ri .

Pi =

o<i<Q-1

Where, bi is length of I the code word = n total number of bits necessary to represent the value of ri Measure of coding reductancy is given by the average no of bits needed to represent each sample of signal [x(n)]. Bav = =

= Total number of bits required to represent the signal is NBav

Entropy:
The goal of the compression method is to reduce the volume of data while retaining the information content of the original signal with some acceptable fidelity. Note: information content represented by symbol can be informally related to its unexpectedness. If a symbol that arrives is expected, contains less information If a symbol that arrives is unexpected, contains much information. For a discrete time- sequence x(n) , with samples taking one of q distinct symbols ri with probability Pi measure of information content of ith symbol ri is given by..

Ii = -log2(Pi) From above equation , Ii 0 .and is very large


Where as, Pi is very small. The measure of average information content of signal is given by Hx = Example: fig 9:grey level image (a) original gold hill image. (b) Subimages after one level haar wavelet decomposition = -

( ) bits per second.

For the energy compression stage, we make use of haar wavelets. Since the image is 2 dimension, wavelet decomposition is first applied row wise and then column wise.

Applying haar transform H to the input image x, first row wise and then column wise , we get, Y=HHT Where, H=

( X=(

) ) )

To understand the feeect of the decomposition on the image, consider a 22 two dimensional sequence given by

Then, Y=

LL: at the top left position of is the 4-oint average of x and therefore contains only the verticaland horizontal low frequency components of x. HL : at the top right position of is obtained by forming the difference of the horizontal components and the sum of the vertical components and hence contains the vertical low and horizontal high frequency components. LH : at the bottom left position of y is obtained forming the sum of the horizontalcomponents and the differences of the ertical components and hence contains the horizontal low and vertical high freqenc components. HH : at the bottom right is obtainded by forming thedifferene between both the horizontal and vertical components and therefore contains only the vertical and horizontal high frequency components of x. Applying a one level haar wavelet decompositionto the image , down sampling the outputs of all filters by a factor of 2 in both horizontal and vertical directions, we obtain four sub images shown in fig 9: (b). Original images is 512512 pixels. Sub images are of size 256256 pixels . Total energy of the sub-images and their percentages of the total energy of all sub-images are now as follows

The sum of energies of all subimages is equal to 3935.54106 and also the total energy of the original image. To evaluate the entropies , we use unifom scalar quantities with a quantization step size Q= 15. original signal HX = 3.83 bits / pixels after scalar quantization.

Entropies after a one level haar decomposition is Sub images total entropies is 2.016 bits /pixels and the compression ratio is 1.78 % to 1.0 % . Measure of quality of the reconstructed image compared to original image is PSNR peak signal to noise ratio. Let x[m,n] denote the image signal. PSNR =20 log 10
dB

RMSE =root mean square error=

MSE =

))

Here , PSNR of the image is 34.42 dB. Similarly, two level haar wavelet decomposition is applied gives the following fig and is of size is 128128 and contains only low frequencies labelled LLL.

TRANS MULTIPLEXING:
Basic multi rate operations: The most basic operations in multirate digital signal processing are 1. decimation 2. interpolation .

Decimation :
M fold decimator : m folded decimator which takes an input sequence x(n) and produces the output sequence Y(n) = ( ) { ( )

Where M is an integer. only those samples of x(n) which occur at time equal to multiples of M are retained by decimator. decimator is also called downsampler or subsampler, salmpling rate compressor or merely compressor. X(n)

y(m)

Interpolator:
L folded expander takes an input x(n) and produces an output sequence Y(n) = ( ) { ( )

Here, L is an integer. We can recover the input x(n) from ye (n) by L fold decimation.other names of interpolation are sampling rate expander, expander ,upsampler. X(m) y(n)

N
Transmultiplexing:

Fig 11

In a digital telephone networks, it is some times necessary to convert between two formats called time division multiplexing format and frequency division multiplexing format.to describe TDM format, where three signals are passed through 3 folded expanders and added through a delay chain .it can be shown that y(n) is aninterleaved version the 3 signals , that is it has the form

x0(0) x1(0) x2(0) x0(1) x1(1)..


this is the RDM version of 3 signals .we can recover the 3 signals from y(n) by using the time domain de multiplexer show in figure. TDM FDM TDM converter is called transmultiplexer.

To explain clearly , consider following example.

Fig 12 operation of frequency dividion multiplexing circuit

Here ,, transforms of 3signals x0(n) x1(n) x2(n) are shown. the FDM signal y(n) is a signal composite signal, whose transform y(e ) is obtained by pasting the transforms of the individual signals next to each other. Note that each individual spectrum has to be compressed by 3 to make enough room for all 3 signals in the range 0 < < 2. T he FDM operation can be performed sing the circuit show in fig 11.each individual signal is passed through an expander to obtain a 3 fold compression for the transform.the interpolation filter FK(Z) is assumed to be ideal retains one out of three images which appear in XK(ej3) .the shaded portion in fig 12 (d),(e),(f) are the retained images from each signal.the filter responses are shifted with respect to each other so that the retained images from XK(ej3) mk. if we add the outputs of the 3 filters, the result is the FDM.
j

The input output relation of transmultiplexer is therefore given by ( ) ( ), o k Yk (z) = L-1 denoting Y (z) =[ Y0 (z ) Y1 (z) Y2 (z). YL-1 (z)]t X (z) =[ X0 (z ) X1 (z) X2 (z). XL-1 (z)]t we can re write , Ykk(z) = kz-nk, o k 1 Where, F(z) is an L L matrix, whose (k,l) th element is given by Fkl (z) .the objective of the trans multiplexer is to ensure yk[n] is a reasonable rplica of xk(n).

Fkl [z] = (

)L

If Fkm (z) is diagonal matrix and crosstalk is totally absent. Yk(z) = Fkk(z) xk(z) But, in case of QMF bank I,.e quardrature miror filter bank. We can define 3 types of multiplexer systems. 1. Phase preserving system 2. Magnitude presetcing system 3. Perfect reconstruction multiplexer Phase preserving system: If F KK(z)is linear phase transfer function for all values of k Magnitude presetcing system If F KK(z)is all pass function perfect reconstruction multiplexer Ykk(z) = kz-nk, o k M-1 Where nk is an integer k is non zero constant.