Вы находитесь на странице: 1из 9

# DSP LAB-Experiment 4

## Ashwin Prasad-B100164EC(Batch A2) 18th September 2013

Aim
1. Determine the spectra of the signals x1 (n)=cos( (2)n) and x2 (n) =cos(n/3). Compare the spectra generated with matlab function generated spectra. 2. Determine the Fourier transform of the signal x(n) = u(n). 3. Illustrate convolution theorem by dening two signals in time and frequency domain. 4. Let us consider a signal with period N (x(n) = x(n + N )). The spectrum of such a signal would be periodic with period N . Focusing on a single period k = 0 N-1, corresponding to a frequency range 0 < F < Fs ,Fs being the sampling frequency.Show the eects of undersampling, sampling at Nyquist rate and oversampling by looking at the spectrum.

Theory

The Fourier tools include the Fourier Transform (FT), Fourier Series (FS), Discrete Fourier Transform (DFT) and Discrete Time Fourier Transform (DTFT). All these strive under the basic idea that any naturally occuring waveform can be broken down into a simple sum of sines and cosines. When this can be done so, the signal expression can be replaced with this alternate value and the signal can be analysed, teated as well as be processed anyway required. The superposition principle can be used in almost all of the real life scenarios since the Linear TIME Invariance (LTI) can be assumed or properly approximated for most of the practical systems. Thus is considering the output, it can be regarded as summation of the individual output of all the component sine or cosine parts. The ability of mere sinosoidals to represent the whole univeral set of signals has always been doubted, however they have overcome all that with strong mathematical backing and successful physical realization. An example of a square wave being continuosly approximated is shown: The various forms of this one basic idea can be used to realise the fourier analysis of the entire signal world and that is what exactly makes this whole scheme real powerful.These conversions between the frequency and time domain are considerably one to 1

0.PNG

one mappings since they adhere to the Parseval theorem. The Parseval theorem states such that the sum or integral of the square of a function is equal to the sum or integral of the square of the frequency spectrum. The method of Fourier Transform is mainly used in the case of aperiodic continuos real time signals, these are converted into an equivalent representation in the frequency domain. Thus any portion of the signal when appropriately subjected to Fourier transformation gives us its frequency composure.
+

F ( ) =

f (t) exp(jt)dt

The tool used for periodic scenario for signal decomposition is the Fourier Series, enabling us to represent any periodic signal eectively as a sum of sines and cosines , consisting of a fundamental frequency and its harmonics. g (t) = 1 c+ an sin(2f t) + bn cos(2f t) 2 n=1 n=1 an = bn = 2 T 2 T
T + +

g (t)sin(2nf t)dt
0 T

g (t)cos(2nf t)dt
0

c= where f =
1 T

2 T

g (t)dt
0

The discrete time methods have also been developed that allows the use of fourier concepts to translate into discrete signals and obtain their equivalent

representation and frequency contents. The Discret Fourier Transform (DFT) is given by:
N 1

Xk =
m=0

xn exp(i2n/N )

Finally we have the method of Discrete Time Fourier Transform (DTFT) for the case of discrete and non periodic signals. The quantitaive representation is
+

X ( ) =
m=

x[n] exp(in)

Thus we have the fourier techniques to cover all kinds of signals in the time domain and get their eeective frequency content. The question always was there as to why the frequency domain. It is so due to a variety of reasons.The signal spectra resolves its frequency components.Since a reasonable amount of systems have a ltering or similar amount of action their study on the signal can be really eective if the wholoe scenario is in the frequency domain.Morevor operations like convolution, used to evaluate the output of a LTI system to a bounded input, turns out to be mere multiplication in the frequency domain. This greatly eases up the process of computing the output as well as system design in the frequency domain.

Procedure
1. The required signals,x1 (n)=cos( (2)n) and x2 (n) =cos(n/3) were generated by dening concerned matrices, their spectra determined and compared with the spectra generated by using Matlab inbuilt function. 2. The signal x(n) = u(n) was generated and spectra determined using Matlab code as well as Matlab inbuilt function. 3. Two signals with well dened spectra were dened to illustrate convolution theorem. Thereafter, the signals were convolved in time. The spectra of the resultant signal after convolution was compared with the signal obtained after multiplication of the spectra of the signals used for convolving and satisfactorily matched. 4. A signal with period N (x(n) = x(n+N )) was considered and then sampled at below Nyquist rate, above Nyquist rate and at Nyqist rate and the spectra of the resulting signal after sampling was studied.

## Observations and Inferences

The spectra of these signals were plotted by two means the transform algorithm and the inbuilt matlab FFT method and compared. x1 (n)=cos( (2)n)

Spectrum of x1 (n)=cos(

(2)n)

The two spectra plotted by matlab inbuilt function are much closer to the theoritical expectation than by the algorithm one. This can be attributed 4

to the more robust and eective nature of the matlab FFT method compared to the brute force summation method that was employed. The signal u(n) was dened and its spectrum was also found it. The result is depicted in Figure shown below.

The function is the step input. The transform is taken and it has exponential dying out frequency response. This is exactly the behavoir of unit step functions. The convolution theroem proof was constructed using the available tools. i.e the ability to take transform. Two signals x1 (n)=cos( (2)n) and x2 (n) =cos(n/3) dened for this process.The signals are then convolved in the time domain. The output of the convolution is subjected to transformation and its frequency spectra is obtained.The convolution in time domain is equivalent to multiplication in the frequency domain.

These spectra are similar and nearly the same. Hence the convolution in time domain can be accepted to be equal to multiplication in the frequency domain. Thus convolution theorem is proved. A signal x(n) =sin(2 100t) was considered. It is periodic with fundamental period of 2 .It is then undersampled, oversampled and sampled at Nyqusit rate and the spectra of the sampled signals are obtained as in Figures 6-8.

Nyquist rate can be treated as the reference for reconstruction after sampling. Anything below this rate cannot be reconstructed and anything above can be easily reconstructed. In the oversampled case , more spacing has been provided between the samples repeating. This reconstruction provides no distortion. In the case of undersampling , the signal spectrum distortion is explicitly evident and it is quite unfeasible for loseless recovery of signal.

Results

The frequency spectrum obtained by the in-built FFT algorithm and by us were similar but with slight variation in the location of the peaks. The fourier trasform of the unit step function is found to have a large peak at dc and the amplitude goes on decreasing for higher frequency components.Since the unit step function is of nite length,We get innite sidebsnds The frequency spectrum obtained fortime domine convolution of signals and frequency domain multiplication of signals are found to be identical It is observed that for the unedrsampled signal,there is an overlapin the frequency spectrum .For the nyquist sampled signal there is no overlap.For the over sampled signals,ther is a signicant gap between the two peaks

Bibliography
1. Modern Digital and Analog Communication Systems,3rd Edition, B.P.Lathi 2. J.G Proakis, D.G Manolakis, Digital Signal Processing (2007), 4th edition, Pearson 3. https://en.wikipedia.org/ 4. Haykin S. and Veen B.V., Signals and Systems, John Wiley,1999.