Sei sulla pagina 1di 6

FATIMA JINNAH WOMEN UNIVERSITY

BSE-VI (A+B)----DIGITAL SIGNAL PROCESSING MATLAB PRACTICE SESSION Instructor: Sidra Minhas

INSTRUCTIONS: Perform the given exercises. Make a separate .m file for each exercise. Make functions where specified. Save each .m file with exercise name and keep them in a single directory. Copy this directory in your USBs or laptops from where you will give the viva. Printed hard copy is NOT required. Submission/VIVA Date: 17th April, 2012 Submission Time: During class timings according to roll call.

EXERCISE 1 OBJECTIVE: Signal synthesis and plotting PART- A 1. Plot x(t)= sin(2t), 0 t 2 2. Sample x(t) with the sampling period TS=0.2, and print the values of the sampled result X(n) 3. Plot the sampled result X(n). Use black squares as markers 4. Save the figure as PDF PART- B 1. Evaluate a sine wave (y = sin(x)) at 1,000 points (x) between 0 and 2*pi. 2. Whats the value at a. Index 55 b. Indices 100 through 110 3. Find the index of a. the minimum value, b. the maximum value, and c. values between -0.001 and 0.001

EXERCISE 2

OBJECTIVE: Implement discrete time convolution. Use of conv() and write user defined functions. 1. Create and display the following discrete time signals: X = [-1 0 1 2 3 4] Y = [-1 -2 3] 2. Using the inbuilt MATLAB function, create a convolved signal Z= Y*Y i.e. convolution of the above signals. 3. Display the signal Z. Be clear regarding the indexes. 4. Verify that X*Y = Y*X 5. Now convolve the signal X and Y without using the inbuilt function. i.e. Write your own function of convolution.

EXERCISE 3

OBJECTIVE: Hands on with MATLAB GUI. Use of uigetfile and global functions Make a GUI with two push buttons and two axes which does the following actions: 1. 2. 3. 4. 5. 6. Explore the function uigetfile. Read an RGB image that is located on the desktop using a push button. Display this image on a new figure. Display this image on the axes of the GUI. Using another push button, convert this RGB image to gray scale. Show this gray scale image on new axes besides the previous one.

EXERCISE 4

OBJECTIVE: Recording voice signals with microphones and displaying results. 1. Record a voice signal for 10 seconds using microphone. Set sampling frequency 50000Hz and quantization level 32 bits/ sample. 2. Display the stem plot of samples of the first 5 seconds. 3. Multiply the amplitude of these samples by 2. 4. Display the stem plot of these samples. 5. Extract the value of 100,000th sample. To which class of integers does it belong?

Potrebbero piacerti anche