+ All Categories

Download - new dsp lab

Transcript

MORADABAD INSTITUTE OF TECHNOLOGY

MORADABAD INSTITUTE OF TECHNOLOGY

Ram Ganga Vihar Phase-II, Moradabad

DEPARTMENT OF ELECTRONICS &COMMUNICATION ENGINEERING

LAB MANUALDIGITAL SIGNAL PROCESSING LAB

(EEC-652)

INDEX

1. VISION MISSION

2. ORGANIZATION CHART

3. LIST OF EQUIPMENTS

4. LIST OF EXPERIMENTS PERFORMED5. LIST OF EXPERIMENT AS PER UPTU LIST

6. SYLLABUS

7. GENERAL INSTRUCTION

8. MANUALSa) Experiment No. 1

b) Experiment No. 2

c) Experiment No. 3

d) Experiment No. 4

e) Experiment No. 5

f) Experiment No. 6

g) Experiment No. 7

h) Experiment No. 8

i) Experiment No. 9

j) Experiment No. 10OUR VISION

A technical education system producing skilled manpower of highest quality to meet complex technology needs for economic development of the country.

OUR MISSION

To transform the institute into one of the leading technical institution of the country with the aim of producing engineers of high caliber having technical competence of internationally accepted levels with high professional ethics, national and human values and responsive to community needs.

MORADABAD INSTITUTE OF TECHNOLOGY

MORADABAD

ORGANISATION CHART

DIGITAL SIGNAL PROCESSING LAB (EEC-652)

LAB O.C.

Mr. MANAS SINGHAL

LAB ASSISTANTLOVELY CHOUDHARY

LAB ATTENDANTSANJEEV KUMAR

Mr. KSHITIJ SHINGHAL

H.O.D.

ELECTRONICS & COMMUNICATION ENGG.

DEPTT.

MORADABAD INSTITUTE OF TECHNOLOGY

MORADABADDEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

DIGITAL SIGNAL PROCESSING LAB (EEC-652)

EXPERIMENT LIST

1. With the help of Fourier series, make a square wave from sine wave and cosine waves. Find out coefficient values.2. Evaluate 4 point DFT of and IDFT of x(n) = 1, 0 n 3; 0 elsewhere.3. Implement the FIR Filters for 2 KHz cutoff frequency and 2 KHz bandwidth for band pass filter.4. Design FIR filter using Fourier series expansion method.5. Implement IIR low pass filter for a 4 KHz cutoff frequency and compare it the FIR filter with the same type use chirp as input signal.6. Verify Blackman and Hamming windowing techniques for square wave as an input which window will give good results.7. Implement the filter functions.8. Generate DTMF sequence 1234567890*# and observe its spectrogram.9. Generate an Amplitude Modulation having side low frequencies 1200 Hz and 800 Hz. Observe and verify the theoretical FFT characteristics with the observed ones.10. Generate Frequency Modulation having carrier frequencies 1 KHz and modulating frequency 200 Hz with the modulation index of 0.7. Observe and verify the theoretical FFT characteristics with the observed ones.11. Generate an FSK wave form for transmitting the digital data of the given bit sequence. Predict and verify the FFT for the same one.12. To study the circular convolution.EXPERIMENT NO.2OBJECT:- Evaluate 4 point DFT of and IDFT of x(n) = 1, 0 n 3; 0 elsewhere.APPARATUS REQUIRED :- TMS320 6713 DSP Processor kit.

THEORY: THEORY OF DFT & IDFT:-In mathematics, the discrete Fourier transform (DFT) is a specific kind of discrete transform, used in Fourier analysis. It transforms one function into another, which is called the frequency domain representation, or simply the DFT, of the original function (which is often a function in the time domain). But the DFT requires an input function that is discrete and whose non-zero values have a limited (finite) duration. Such inputs are often created by sampling a continuous function, like a person's voice. Unlike the discrete-time Fourier transform (DTFT), it only evaluates enough frequency components to reconstruct the finite segment that was analyzed. Using the DFT implies that the finite segment that is analyzed is one period of an infinitely extended periodic signal; if this is not actually true, a window function has to be used to reduce the artifacts in the spectrum. For the same reason, the inverse DFT cannot reproduce the entire time domain, unless the input happens to be periodic (forever). Therefore it is often said that the DFT is a transform for Fourier analysis of finite-domain discrete-time functions. The sinusoidal basis functions of the decomposition have the same properties.

The input to the DFT is a finite sequence of real or complex numbers (with more abstract generalizations discussed below), making the DFT ideal for processing information stored in computers. In particular, the DFT is widely employed in signal processing and related fields to analyze the frequencies contained in a sampled signal, to solve partial differential equations, and to perform other operations such as convolutions or multiplying large integers.

Definition

The sequence of N complex numbers x0, ..., xN1 is transformed into the sequence of N complex numbers X0, ..., XN1 by the DFT according to the formula:

Where j is the imaginary unit and is a primitive N'th root of unity.

Theinverse discrete Fourier transform (IDFT)is given by

A simple description of these equations is that the complex numbersXkrepresent the amplitude and phase of the different sinusoidal components of the input "signal"xn. The DFT computes theXkfrom thexn, while the IDFT shows how to compute thexnas a sum of sinusoidal componentsPROGRAM :- DFT PROGRAM-

#include

#include

short x[4];

void dft(short *x, short k, int *out); //function prototype

#define N 4

//number of data values

float pi = 3.1416;

int sumRe,sumIm;

short x[N] = {1,1,1,1}; //1-cycle cosine

//short x[N]={0,602,974,974,602,0,-602,-974,-974,-602,

//

0,602,974,974,602,0,-602,-974,-974,-602};//2-cycles sine

int out[2] = {0,0};

//init Re and Im results

void dft(short *x, short k, int *out) //DFT function

{

int sumRe = 0, sumIm = 0; //init real/imag components

float cs = 0, sn = 0; //init cosine/sine components

int i = 0;

for (i = 0; i < N; i++) //for N-point DFT

{

cs = cos(2*pi*(k)*i/N); //real component

sn = sin(2*pi*(k)*i/N); //imaginary component

sumRe = sumRe + x[i]*cs; //sum of real components

sumIm = sumIm - x[i]*sn; //sum of imaginary components

}

out[0] = sumRe; //sum of real components

out[1] = sumIm;

//printf("\n%d",sumRe);

//printf("\n%d",sumIm);

printf("\n%d",out[0]);

// printf("\n%d",out[1]); //sum of imaginary components

}

void main()

{

int j;

for (j = 0; j < N; j++)

{

dft(x,j,out); //call DFT function

}

}

IDFT PROGRAM-

#include

#include

short x[4];

void dft(short *x, short k, int *out); //function prototype

#define N 4

//number of data values

float pi = 3.1416;

int sumRe,sumIm;

short x[N] = {4,0,0,0}; //1-cycle cosine

int out[2] = {0,0};

//init Re and Im results

void dft(short *x, short k, int *out) //DFT function

{

int sumRe = 0, sumIm = 0; //init real/imag components

float cs = 0, sn = 0; //init cosine/sine components

int i = 0;

for (i = 0; i < N; i++) //for N-point DFT

{

cs = cos(2*pi*(k)*i/N); //real component

sn = sin(2*pi*(k)*i/N); //imaginary component

sumRe = (sumRe + x[i]*cs); //sum of real components

sumIm = (sumIm + x[i]*sn); //sum of imaginary components

}

out[0] = sumRe/4; //sum of real components

out[1] = sumIm;

printf("\n%d",out[0]);

}

void main()

{

int j;

for (j = 0; j < N; j++)

{

dft(x,j,out); //call DFT function

}

}

PROCEDURE:-

1. Open code composer studio , make sure the DSP kit is turned on.

2. Start a new project using Project-new pull down menu , save it in a separate directory (c:\ti\my projects) with name dft.pjt.

3. Add the source files dft.c to the project using project-add files to project pull down menu.

4. Add the linker command file hello .cmd.

(Path: c:\ti\tutorial\dsk6713\hello1\hello.cmd)

5. Add the run time support library file rts 6700.lib.

(Path: c:\ti\c6000\cgtools\lib\rts6700.lib)

6. Compile the program using the Project-compile pull down menu or by clicking the shortcut icon on the left side of program window.

7. Build the program using the Project-build pull down menu or by clicking the shortcut icon on the left side of program window.

8. Load the program (dft. out) in program memory of DSP chip using the file load program pull down menu.

9. Run the program and result display in result window.

FLOW OF CODE:

1. Codec configuration settings initialize the DSP codec.

2. Main program starts initialize the variable.

3. Initializations of the dsp kit.

4. Opening the codec (reading the data) set the page.

5. Read the output data.

6. Process the data.

7. Write the output data.

8. Close the codec.RESULT:

Output DFT

, the computed DFTs are shown for N=1024, and zero-padded versions with N = 2048 and N = 4096PRECAUTIONS:

EXPERIMENT No. 3AIM

Implement the FIR Filters for 2 KHz cutoff frequency and 2 KHz bandwidth for band pass filter.EQUIPMENTS:

Operating System Windows XP

Constructor

- Simulator

Software

- CCStudio 3

THEORY:

A Finite Impulse Response (FIR) filter is a discrete linear time-invariant system whose output is based on the weighted summation of a finite number of past inputs. An FIR transversal filter structure can be obtained directly from the equation for discrete-time convolution.

(1)

In this equation, x(k) and y(n) represent the input to and output from the filter at time n. h(n-k) is the transversal filter coefficients at time n. These coefficients are generated by using FDS (Filter Design Software or Digital filter design package).

FIR filter is a finite impulse response filter. Order of the filter should be specified. Infinite response is truncated to get finite impulse response. placing a window of finite length does this. Types of windows available are Rectangular, Barlett, Hamming, Hanning, Blackmann window etc. This FIR filter is an all zero filter.

PROGRAM:

#include

#include

#define pi 3.1415

int n,N,c;

float wr[64],wt[64];

void main()

{

printf("\n enter no. of samples,N= :");

scanf("%d",&N);

printf("\n enter choice of window function\n 1.rect \n 2. triang \n c= :");

scanf("%d",&c);

printf("\n elements of window function are:");

switch(c)

{

case 1:

for(n=0;n


Top Related