lab 1

4
COMSATS Institute of Information Technology Park Road, Islamabad Department of Electrical Engineering Course Title: Digital Communications Course code: EEE353 Semester: BS Electrical (Telecom) Engineering – 6 Course Instructor: Mr. Naeem Maroof Lab 1 Signal Generation, Convolution, FFT (Frequency analysis) and Filtering Marks(2+3+5) Student’s Name: Reg. No ( ) _________________ ____________________ _________________ Date ____________________ Signed By

Upload: rahehaqguests

Post on 01-Sep-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

  • COMSATS Institute of Information Technology Park Road, Islamabad

    Department of Electrical Engineering

    Course Title: Digital Communications Course code: EEE353 Semester: BS Electrical (Telecom) Engineering 6 Course Instructor: Mr. Naeem Maroof

    Lab 1

    Signal Generation, Convolution, FFT (Frequency analysis) and Filtering

    Marks(2+3+5) Students Name: Reg. No

    ( )

    _________________

    ____________________

    _________________

    Date

    ____________________

    Signed By

  • Overview: In this lab you will process signals in time domain and frequency domain. Also you will

    apply implement filters for signals.

    Any Linear Time Invariant (LTI) system is described by property of convolution.

    Convolution is the process by which input signal is modified by LTI system to produce

    output. Thus, output signal is convolution of input and impulse response of the system.

    So, in time analysis of signals and systems, output = input * impulse response, or

    y (t) = x (t) * h (t) When we view of system in frequency domain, convolution is transformed into

    multiplication. Thus, in Fourier domain, output spectrum is input spectrum multiplied

    with systems frequency response, i.e.

    Y(f) = X(f) H(f) Both processes are equal and valid; the only difference is domain of operation.

    In following lab, you will process signals in time as well as frequency domain. Few

    helpful functions to be used in this lab are:

    fft fftshift abs real conv If you dont know any of these functions, just type help in command

    window. Take care while dealing with imaginary numbers, you can not directly plot

    them. Either you plot their magnitude or real part, as per requirements.

    Lab Tasks: TASK A

    1. Initialize amplitude and frequency vectors as

    a. A=[2 3 1 1.5 2.5]

    b. f= [1 10 2 5 12]

    2. Create an appropriate time vector as t=start:increment:end; Choose your starting,

    incremental and ending time according to frequency, so that graphs are visible.

    3. Generate 5 different signals with above amplitudes and frequencies.

    4. Plot these signals on one figure using subplot function. You may use axis

    function to properly set the axis of figure.

  • 5. Add up all these signals to get a composite signal.

    6. Plot this signal on that figure too, using subplot.

    Task-B 1. Generate two rectangular pulses of duration 1msec in time domain, plot them

    properly (properly define time index, their axis, title, and labels)

    2. Convolve these two signals, and properly plot the result.

    3. By processing in frequency domain, multiply both signals. You will have to

    convert both signals into Fourier domain, using fft function. 4. Convert back the output signal into time domain, and compare both outputs.

    5. What is default value of samples taken by FFT?

    6. What is zero padding?

    7. What is relation between frequency resolution and number of samples?

    8. How can we determine signal frequency from normalized spectrum produced by

    fft() functions.

    Task-C 1. Write your own convolution function, myconv. Compare results of your written

    code, and available function conv. You will write your script in m-file and have to

    save it with the same name as of function name, e.g. myconv.m. For more help,

    see help function.

    Task-D 1. Take sound input from microphone. Store it in computer (up to 2 seconds), with

    *.wav extension.

    2. Read this file in MATLAB.

    3. Play the sound file

    4. Low pass filter this sound, and play again.

    5. What has happened to the sound?

    6. How much part of this sound you can filter?

    Helpful functions are wavread, wavein, sound.

  • Lab Report:

    After completion of laboratory work, you will write up a formal report, explaining each

    and every task, how you performed it, your code, your results, and comments. You have to submit hardcopy of report before next laboratory session.

    Best report will get maximum marks. Your report should contain at least:

    Front page

    Introduction to this lab session

    Task A

    How you approached this task, your paper work, design or algorithm

    Your MATLAB code

    Results

    Conclusion / Comments

    Task B

    How you approached this task, your paper work, design or algorithm

    Your MATLAB code

    Results

    Conclusion / Comments

    And so on, you will write up for all the tasks given in lab session.