Sunteți pe pagina 1din 10

MDSP LAB REPORT

Experiment 1 SAMPLING THEOREM


AIM Sample a band limited continuous time signal under the following conditions 1. Under sampling 2. Nyquist rate 3. Over sampling MATLAB CODE %Sampling theorem clear all; close all; clc; tf = 0.05; t = 0 : 0.00005 : tf ; %f = input('enter the analog frequency,f = '); f = 50; xt = cos(2*pi*f*t) fs1 = 1.3*f; n1 = 0: 1/fs1 : tf; xn = cos(2*pi*f*n1); subplot(311); plot(t,xt,n1,xn); title('Under sampling plot'); xlabel('time'); ylabel('amplitude'); fs2 = 2*f; n2 = 0: 1/fs2 : tf; xn = cos(2*pi*f*n2); subplot(312); plot(t,xt,n2,xn); title('Nyquist plot'); xlabel('time'); ylabel('amplitude'); fs3 = 6*f; n3 = 0: 1/fs3 : tf; xn = cos(2*pi*f*n3); subplot(313);

DEPT. OF ECE, CMRIT

MDSP LAB REPORT

plot(t,xt,n3,xn); title('Over sampling plot'); xlabel('time'); ylabel('amplitude'); INPUT: Enter the analog frequency: f = 50Hz

OUTPUT: It can be observed from the plots that for sampling frequencies below 2f ,the original signal cannot be recovered. The recovered signal does not match with the original signal. For sampling frequencies at 2f, the recovered signal has certain points in the original signal but here complete recovery is not possible. As the sampling frequency increases, the signal recovered will be same as the original signal.

DEPT. OF ECE, CMRIT

MDSP LAB REPORT

For fs = 3 * f

For fs = 10 * f

DEPT. OF ECE, CMRIT

MDSP LAB REPORT

EXPERIMENT 2

AIM: Design a band pass filter with Fo = 125Hz and sampling frequency of 1000Hz MATLAB CODE: %Sampling period is <= 1/1000 gamma = 0.96; num = [ 1 0 -1]; den = [ 1 -sqrt(2)*gamma gamma]; W = -pi : pi/1000 : pi; H = freqz (num,den,W) ; mag = abs(H); phase =(180/pi)*unwrap(angle(H)); subplot(211); plot(W,mag);grid on ; subplot(212); plot(W,phase);grid on ; figure; zplane(num,den); hold on

OUTPUT: Gamma= 0.96 When poles lie close to the unit circle then the frequency response has a large value at w which are close to the poles.

DEPT. OF ECE, CMRIT

MDSP LAB REPORT

DEPT. OF ECE, CMRIT

MDSP LAB REPORT

Gamma = 1 The poles lie on the unit circle and magnitude plot is discontinuous since magnitude is infinity.

DEPT. OF ECE, CMRIT

MDSP LAB REPORT

Gamma= 0.66

DEPT. OF ECE, CMRIT

MDSP LAB REPORT

Gamma= 1.5

We observe that, both the magnitude plots for gamma = 0.66 and 1.5 resembles , since the distance is same. But Zplane plot is different for gamma=0.66 the poles lie inside the unit circle whereas, for gamma =1.5 poles lie outside the circle

DEPT. OF ECE, CMRIT

MDSP LAB REPORT

EXPERIMENT 3
AIM: Design a Band reject filter with zero transmission at 250Hz and sampling frequency of 1000Hz. MATLAB CODE: %Sampling period is <= 1/1000 gamma = 0.98; k=(1+((gamma)^2))/2; num = k*[ 1 0 1]; den = [ 1 0 gamma^2]; W = -pi : pi/1000 : pi; H = freqz (num,den,W) ; mag = abs(H); phase =(180/pi)*unwrap(angle(H)); subplot(211); plot(W,mag);grid on ; subplot(212); plot(W,phase);grid on ; figure; zplane(num,den); hold on OUTPUT: Gamma=0.98 When a pole lies close to a zero inside a unit circle ,the frequency response is zero at w=wo, but the effect of zero is cancelled by the pole when w moves away from w0 and the magnitude of the frequency response will be unity.

DEPT. OF ECE, CMRIT

MDSP LAB REPORT

DEPT. OF ECE, CMRIT

10

S-ar putea să vă placă și