Matlab Program for Discrete Convolution and Correlation Without Using Inbuilt Functions

Only available on StudyMode
  • Download(s): 410
  • Published: May 4, 2011
Read full document
Text Preview
ECE 204 AND 254– UEL 1 Laboratory Manual

Draft copy for adoption:

LABORATORY MANUAL OF ECE 204 AND 254 UNIFIED ELECTRONICS LAB 1

Prepared at Lovely Professional University With Participation & Valuable contributions from Er.Gurpreet Saini Er. Kawanpreet Kaur Er. Asha Rana

Reviewed by.

Rajeev Kr Patial Sr lect., off. HOL, ECE (B. Id. 12301)

OFF HOD ECE

(Dean Labs )

DEPARTMENT OF ECE, LPU, PHAGWARA (PUNJAB), INDIA.

1

ECE 204 AND 254– UEL 1 Laboratory Manual

ECE204 and ECE254: UNIFIED ELECTRONICS LAB I Sr. No. Topic

1. 2. 3. 4. 5. 6.

To perform sampling and explain the concept of aliasing using MATLAB. To perform convolution between two continuous time signals using MATLAB. To perform correlation and autocorrelation using programming in MATLAB. To perform Fourier Series Analysis and Find Fourier coefficients from a complex signal in MATLAB. To plot frequency response of LPF, HPF, BPF filters in MATLAB.

*To design and realize on a breadboard MOD 10 UP/DOWN Counter. 7. *To design and realize on a breadboard a 7-segment code converter (driver). 8. *To design and realize on a breadboard an A/D converter. 9. *To design and realize on a breadboard a D/A converter. 10. *To design and implement an emitter follower circuit on a breadboard. 11. 12. *To design and implement on a breadboard an amplifier using transistor in CE and CB configuration. Find its gain, input impedance and output impedance. *To design and implement on a breadboard an amplifier using JFET. Find its gain, input impedance and output impedance.

DEPARTMENT OF ECE, LPU, PHAGWARA (PUNJAB), INDIA.

2

ECE 204 AND 254– UEL 1 Laboratory Manual

EXPERIMENT NO 1 Aim: To perform sampling and explain the concept of aliasing using MATLAB. ALGORITHM STEPS: Generate a continuous signal

Sample the continuous signal with some sample rate Plot the sampled signal Program code: x= -pi:0.01:pi; y= sin(x); %generate continuous sinusoidal signal figure: subplot(2,1,1); plot(y); % plot the continuous signal title('Original Signal') z= decimate(y,50); %sample the sinusoidal signal with sample rate 50 subplot(2,1,2); % plot the discrete signal stem(z); title('Sampled Signal') RESULTS:

DEPARTMENT OF ECE, LPU, PHAGWARA (PUNJAB), INDIA.

3

ECE 204 AND 254– UEL 1 Laboratory Manual

EXPERIMENT NO 2 Aim: To perform convolution between two continuous time signals using MATLAB. ALGORITHM STEPS: Get the signals x(n) and y(n) in matrix form

The convolved signal is given by y(n) which can be calculated by formula

Plot the convolved signal y(n) Program code: clc disp('Convolution Function'); u=input('1st input sequence'); v=input('2nd input sequence'); w=conv(u,v); figure: subplot(3,1,1); stem(u); subplot(3,1,2); stem(v); subplot(3,1,3); stem(w); disp('Convolution between the is');w Result: Convolution Function 1st input sequence[1 2] 2nd input sequence[1 2 3] Convolution between the is w= 1 4 7 6

DEPARTMENT OF ECE, LPU, PHAGWARA (PUNJAB), INDIA.

4

ECE 204 AND 254– UEL 1 Laboratory Manual

EXPERIMENT NO 3 Aim: To perform correlation and autocorrelation using MATLAB. ALGORITHM STEPS: Get the signals x(m) and h(p) in matrix form

The convolved signal is given by y(n) which can be calculated by formula where n= - [max(m,p)-1]to [max(m,p)-1]

Plot the convolved signal y(n)

DEPARTMENT OF ECE, LPU, PHAGWARA (PUNJAB), INDIA.

5

ECE 204 AND 254– UEL 1 Laboratory Manual

Program code: disp('Cross- Correlation & Auto-Correlation Function'); x=input('1st input sequence'); h=input('2nd input sequence'); y=xcorr(x,h); a=xcorr(x,x); figure:subplot(4,1,1); stem(x); title('input x'); subplot(4,1,2); stem(h); title('input h'); subplot(4,1,3); stem(y); title('cross correlation'); subplot(4,1,4); stem(a); title('auto correlation'); disp('The resultant signal for Cross-Correlation is');y disp('The resultant signal for auto-Correlation is');a Result: Cross- Correlation & Auto-Correlation Function 1st input sequence[1 2 3 4]...
tracking img