Multimedia Processing-Digital Signal Processing-Lab Mannual, Exercises of Digital Signal Processing

This file is manual for Digital Signal Processing lab. In this lab manual some useful matlab functions are mentioned. Sir Pranav Boparai gave this in class as lecture handout and lab manual. It includes: Multimedia, Processing, Captureing, Voice, Image, MATLAB, linear, Toolbox, Enhance, Voice

Typology: Exercises

2011/2012

Uploaded on 07/26/2012

parivita
parivita 🇮🇳

4.6

(9)

72 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Digital Signal Processing
Multimedia Processing
1. Objective
1.1 Capturing and Processing voice in MATLAB
1.2 Capturing and Processing image/video in MATLAB
2. Overview
The information contained in the spoken word is conveyed by the speech signal.
Because we shall analyze several speech transmissions and processing schemes, we need
to understand the speech signal's structure and how we can model and process speech
signal. The naturalness of linear system models for speech does not extend to other
situations.
The Image Processing Toolbox of MATLAB provides a comprehensive set of
reference-standard algorithms and graphical tools for image processing, analysis,
visualization, and algorithm development. You can restore noisy or degraded images,
enhance images for improved intelligibility, extract features, analyze shapes and textures,
and register two images. Most toolbox functions are written in the open MATLAB
language. This means that you can inspect the algorithms, modify the source code, and
create your own custom functions.
MATLAB tools provide engineers and scientists with a complete environment for
processing, analyzing, and visualizing medical images. These tools are used in a wide
range of medical applications, including computer-aided diagnosis, modality design,
micro array analysis, gel imaging, and microscopy.
Using MATLAB and companion toolboxes, you can:
Read and write DICOM images
Acquire images from PC-compatible frame grabber cards and video devices
Visualize images, video sequences, and volumes
3. MATLAB Command
3.1 Voice Capturing Commands
3.1.1 Y=wavread(‘filename.wav’)
MATLAB capture recoded speech file (.wav) using wavread() command.
By default, it read from current directory otherwise complete path could be
docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Multimedia Processing-Digital Signal Processing-Lab Mannual and more Exercises Digital Signal Processing in PDF only on Docsity!

Multimedia Processing

1. Objective

1.1 Capturing and Processing voice in MATLAB 1.2 Capturing and Processing image/video in MATLAB

2. Overview

The information contained in the spoken word is conveyed by the speech signal. Because we shall analyze several speech transmissions and processing schemes, we need to understand the speech signal's structure and how we can model and process speech signal. The naturalness of linear system models for speech does not extend to other situations. The Image Processing Toolbox of MATLAB provides a comprehensive set of reference-standard algorithms and graphical tools for image processing, analysis, visualization, and algorithm development. You can restore noisy or degraded images, enhance images for improved intelligibility, extract features, analyze shapes and textures, and register two images. Most toolbox functions are written in the open MATLAB language. This means that you can inspect the algorithms, modify the source code, and create your own custom functions. MATLAB tools provide engineers and scientists with a complete environment for processing, analyzing, and visualizing medical images. These tools are used in a wide range of medical applications, including computer-aided diagnosis, modality design, micro array analysis, gel imaging, and microscopy. Using MATLAB and companion toolboxes, you can:

  • Read and write DICOM images
  • Acquire images from PC-compatible frame grabber cards and video devices
  • Visualize images, video sequences, and volumes

3. MATLAB Command

3.1 Voice Capturing Commands 3.1.1 Y=wavread(‘filename.wav’) MATLAB capture recoded speech file (.wav) using wavread() command. By default, it read from current directory otherwise complete path could be

specified. wavread returns a 1-D matrix. This matrix contains sampled value of speech signal. Amplitude values are in the range [-1, +1]. 3.1.2 [Y ,Fs,NBits]=wavread(‘filename.wav’) Fs is the sampling frequency in Hz and NBits are number of Bits per sample used to encode the data during sampling process. 3.1.3 wavwrite(Y, Fs, NBits,'filename.wav') This command is the reverse of wavread command. This command writes Y to the current directory as a .WAV file specified by the file name. Fs is sample rate in Hz and NBits are number of bits. Nbits must be 8, 16, 24 or 32. 3.1.4 sound(Y, fs) sound(Y,fs) generates a signal Y as a sound file and send Y out to the speaker. fs is the sampling frequency of Y. The values of Y are assumed to be between 1 and –1 otherwise values greater than threshold are clipped. wavplay(Y, Fs) command is similar to sound(Y, Fs). Both commands work in the same fashion. 3.2 Analysis of voice signal in Time-domain Speech signal captured from wavread() command can be viewed in time domain by plotting vector Y using plot() command. The resulting graph will show sampled data at time axis. 3.3 Analysis of voice signal in Frequency-domain Yf=fft(Y) returns all frequency component present in the Yf. Plot of Yf is frequency spectrum of Y. A normal human speech has frequency component not greater a 4 kHz this can be viewed in frequency domain. Use fftshift() to analyze Fourier spectrum from -π to π. 3.4 Image processing 3.4.1 imread() X=imread() returns a matrix form of image in X. [X, map]=imread() return intensity level of image.

3.4.2 imshow()

subplot(211); plot(n,x);xlabel('T(sec)');title('Time Domain Analysis'); %Frequency Domain Analysis xfft=abs(fft(x)); shiftxfft=fftshift(xfft); lenxfft=length(xfft); Nxfft=linspace(1,4e3,lenxfft/2); subplot(212); plot(Nxfft,shiftxfft(1:lenxfft/2)); xlabel('Frequency(Hz)');title('Frequency Domain Analysis');

a=0.5; R=ceil(fs100e-3); y=zeros(size(x)); d=zeros(size(x)); for(i=1:1:R+1) y(i)=x(i); end for(i=R+1:1:xlen) y(i)=x(i)+ax(i-R); d(i)=a*x(i-R); end wavwrite(y,fs,nbits,'test1.wav'); figure(2); subplot(311),plot(x);xlabel('Time'); title('Original Signal'); subplot(312),plot(d);xlabel('Time'); title('Attenuated Signal'); subplot(313),plot(y);xlabel('Time'); title('Delayed Signal'); sound(y,fs);

4.2 Image Processing Example Y=imread('ee.jpg'); z=double(Y); figure(1); imshow(Y,[]); figure(2); imshow(z(:,:,1),[]); figure(3); imshow(z(:,:,2),[]); figure(4); imshow(z(:,:,3),[]); This program reads a ‘RGB’ image from workspace and shows each individual layer separately. 4.3 Video processing Example a = aviread('test.avi'); [r,c]=size(a); hold on; for i=1:c imshow(frame2im(a(i),[])); pause ; end

This program read avi file from workspace or specified directory and show frames of video file.