Fa09 147, Fa08 141

You might also like

You are on page 1of 6

DSP LAB Assignment # 1

To Implement Audio Effects Using Matlab

Comsats Institute of Information Technology Wah Cantt Sadaf Gulshad Naila Iqbal Reg# FA09-BS(CE)-147 Reg# FA08-BS(CE)-141 BS(CE)-5A Submitted to Hassan Farooq

ASSIGNMENT # 1 REPORT
Objective: To Implement Audio Effects Using Matlab Wave Read: Wavread supports multichannel data, with up to 32 bits per sample, and supports reading 24- and 32-bit .wav files. y = wavread('filename') loads a WAVE file specified by the string filename, returning the sampled data in y.

Steps For Producing Echo


Load Signal

Plot audio signal

Make Impulse response

Convolve impulse response with input audio signal

Code (Echo in Signal): [x,fs,n]=wavread('C:\Windows\Media\chord') x=x(:,1) n=length(x); t=n/fs; ts=1/fs; t1=1:n; plot(t1,x) % plotting signal % loading file chord

title('Plot of the input audio signal') xlabel('time axis') ylabel('input signal x') d=0.5/ts c=d-2 a=zeros(1 ,d ) a(1)=1 a(d)=0.25 w=conv(a,x) plot(w) %plotting signal with echo

title('Plot of the Echo produced audio signal')

xlabel('time axis') ylabel('convolved signal w')

Steps for Producing Reverberation Effect

Load Signal

Input impulse sequence to a system

Write its difference equation

Use filter command to solve difference equation

Reverberation Effect (code) [x,fs,n]=wavread('C:\Windows\Media\chord') x=x(:,1) n=length(x) t=n/fs ts=1/fs d=0.2*fs c=d-2 n0=0 n1=0 n2=d [q,n]=impseq(n0,n1,n2) b=[1] l=[1 zeros(1,c) 0.8] z=filter(b,l,x) plot(z) % plotting signal having reverberation effect

title('Plot of reverberation effect in audio signal') xlabel(time axis) ylabel('filter signal z')

You might also like