0% found this document useful (0 votes)
2 views

Lab3

The document outlines Lab 3 of the ELG4177 Digital Signal Processing course, focusing on sampling, A/D conversion, and D/A conversion. It discusses the concepts of sampling and aliasing, including the Nyquist interval and the effects of aliasing on output signals. The lab includes simulations for A/D and D/A conversions, filtering, and plotting frequency responses.

Uploaded by

waleed ali
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Lab3

The document outlines Lab 3 of the ELG4177 Digital Signal Processing course, focusing on sampling, A/D conversion, and D/A conversion. It discusses the concepts of sampling and aliasing, including the Nyquist interval and the effects of aliasing on output signals. The lab includes simulations for A/D and D/A conversions, filtering, and plotting frequency responses.

Uploaded by

waleed ali
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

ELG4177 - DIGITAL SIGNAL PROCESSING

Lab3

By:Hitham Jleed

http://www.site.uottawa.ca/~hjlee103/
© H. Jleed: 2018 ~
Assignment 03

SAMPLING, A/D CONVERSION


AND D/A CONVERSION

© H. Jleed: 2018 ~
Sampling
(1) Time domain representation of sampling and aliasing

Sampling Process

Among the frequencies, there is a unique one that lies within the Nyquist
interval. It is obtained by reducing the original f modulo-fs, that is, adding to or
subtracting from f enough multiples of fs until it lies within the symmetric
Nyquist interval [−fs/2, fs/2].

© H. Jleed: 2018 ~
Aliasing

Fa=f mod(fs)

© H. Jleed: 2018 ~
Sinusoid Signal
f
xn = sin( 2 0 n +  ) fs = 8 kHz By varying the value f0
fs

When f0=300 Hz

Can you predict in advance if the frequency will increase or decrease ? Why/How ?

© H. Jleed: 2018 ~
(2) Frequency domain representation of sampling and
aliasing, A/D and D/A conversions

function freqmagplot(x,dt)
x(t ) = cos(2f 0t )  cos( 2f 0 n t ) L=length(x);
Nfft=round(2.^round(log2(5*L)));
X=fft(x,Nfft);
n=0,1,2,... f0 =2kHz f=((1/dt)/Nfft)*(0:1:Nfft/2-1);
plot(f,abs(X(1:Nfft/2)));
t =1/80000 title('Magnitude of Fourier Transform’);
xlabel('Frequency'),grid;
end

dt = 1/80000; n = 1:1000; f0 = 2000;


x = cos(2*pi*f0*n*dt);

© H. Jleed: 2018 ~
Simulate the A/D conversion
- we need to keep one sample in every 10 samples.

Plot the resulting discrete time signal and its discrete time Fourier transform
(freqmagplot can be used, but with the appropriate value for dt !).

© H. Jleed: 2018 ~
Simulate the D/A conversion
Two Steps: (1) convert it into an analog pulse signal. To simulate the analog pulse signal, 9 zeros are
added between each sample of the discrete time signal. (2). filter (interpolate) the signal

Filter this part

© H. Jleed: 2018 ~
Filtering
[b, a] = cheby2(9, 60, fs*1/80000);

[H,w]=freqz(b,a); plot(w/pi,abs(H)); fvtool(b,a)

y = filter(b,a,x);

© H. Jleed: 2018 ~
The effect of aliasing

When does aliasing occur? What is the effect of aliasing on the output signal of the
D/A converter (found in i) ) ?
© H. Jleed: 2018 ~
Complete all the assignment. Submit it the Brightspace

© H. Jleed: 2018 ~

You might also like