![]() |
![]() |
|
|
| <<Home | Lab 2 | |||
|
Discrete time sinusoid
Exercise 1a Compute the following discrete time sinusoid y[n]=sin(0.1лn) Where n is an integer. Plot the signal for 0<=n<=22 seconds. Estimate the time period of the signal. Solution n=0:1:22; y=sin(0.1*pi*n); stem(n,y) grid Result
Discrete time sinusoid
Exercise 1b Repeat (a) for z[n]=sin(0.3лn) What is the difference b/w y[n] and z[n] Solution n=0:1:22; z=sin(0.3*pi*n); stem(n,z) grid Result
Signal y[n] is expanding and z[n] is not expanding (and found symmetry in +ve and -ve direction). Discrete time signal
Exercise 2 A discrete time signal x[n] is defined as x[n] = [1 1 1 1 0.5 0.5] sketch the following (a) x[n] (b) x[n-2] (c) x[n+2] (d) x[n2] (e) even part of x[n] Solution % a t=-1:1:4; x = [1 1 1 1 0.5 0.5 ]; stem(t,x) axis([-8 8 -2 2]) grid on % b figure x = [1 1 1 1 0.5 0.5 ]; t2 = t-2; stem(t2,x) axis([-8 8 -2 2]) grid on % c figure x = [1 1 1 1 0.5 0.5 ]; t1 = t+2; stem(t1,x) axis([-8 8 -2 2]) grid on % d figure x = [1 1 1 1 0.5 0.5 ]; t3 = t.^2; stem(t3,x) axis([-20 20 -2 2]) grid on % e (even part of x[n]) figure x = [1 1 1 1 0.5 0.5 ]; x1 = [0.5 0.5 1 1 1 1 ]; y = 1 /2 * (x+ x1) ; stem(t,y) axis([-20 20 -2 2]) grid on Result (a) x[n]
(b) x[n-2]
(c) x[n+2]
(d) x[n2]
(e) even part of x[n]
Discrete time sinusoid
Exercise 3 Consider the following sinusoid x[n] = coswon where the frequency varies from 0 to л radians per second. Plot this signal at f=1/16, 1/8, 1/4 and 1/2 Hz. Use the MATLAB function subplot. At what value of f, the highest rate of oscillation is attained. Is this result true for all discrete time sinusoids? Continuous time sinusoids? Solution y = cos( 2 * pi * f * n ); %plot(n,y) stem(n,y) grid on axis([-12 12 -5 5])
figure f = 1/8; y1 = cos( 2 * pi * f * n ); stem(n,y1) grid on axis([-12 12 -5 5])
figure f = 1/4; y2 = cos( 2 * pi * f * n ); stem(n,y2) grid on axis([-12 12 -5 5])
figure f = 1/2; y3= cos( 2 * pi * f * n ); stem(n,y3 ) grid on axis([-12 12 -5 5]) Result f = 1/16
f = 1/8
f = 1/4
f = 1/2
Highest rate of oscillation is attained at f = 1/2 (w0= л) and the result is true for all discrete time sinusoids and continuous time sinusoids. Analog signal
Exercise 4 Consider the following analog signal xa(t) = 3sin(100лt) Sketch the signal xa(t) for 0<=t<=30 ms. The signal is sampled with a sampling rate Fs = 300 samples per second. Determine the time period of the discrete time signal. Sketch x[n] for 0<=t<=10. Solution t=0:.00001:.03; x =3 * sin(100 * pi * t); plot(t,x) grid on % x[n] figure n=0:1:10; y =3 * sin( 2* pi * 1/6 * n); stem(n,y) grid on Result Signal xa(t) for 0<=t<=30 ms.
Signal x[n] for 0<=t<=10
Continuous time sinusoid
Exercise 5 Consider the following continuous time sinusoidal signal x0(t) = sin2Ftл -∞ < t < ∞ The corresponding sampled signal is described by the formula x[n] = xa[nT] = sin[2л(F/Fs)n] Where Fs= 1/T is the sampling frequency. Plot the signal x[n], 0<=n<=99 for Fs=5kHz and F=0.5, 2, 3 and 4.5 kHz. Explain the similarities and differences b/w various plots. Solution n=0:1:99; fs = 5; f=0.5; x = sin( 2 * pi * (f/fs) * n ); stem(n,x); grid
figure fs = 5; f=2; x1 = sin( 2 * pi * (f/fs) * n ); stem(n,x1); grid
figure fs = 5; f=3; x2 = sin( 2 * pi * (f/fs) * n ); stem(n,x2); grid
figure fs = 5; f=4.5; x3 = sin( 2 * pi * (f/fs) * n ); stem(n,x3); grid Result for F=0.5
for F=2
for F=3
for F=4.5
Continuous time sinusoid
Exercise 5a Suppose that F=2 kHz and Fs =50 kHz (i) Plot the signal x[n]. What is the frequency of the signal x[n]? (ii) Plot the signal y[n] created by taking the even numbered samples of x[n]. Is this a sinusoidal signal? Why? If yes, what is its frequency? Solution n=0:1:99; fs = 50; f=2; x = sin( 2 * pi * (f/fs) * n ); stem(n,x) grid
figure n=0:2:99; fs = 50; f=2; y = sin( 2 * pi * (f/fs) * n ); stem(n,y) grid Result x[n]
y[n]
HELP AXIS
FIGURE
FIGURE Create figure window. DSP Lab 1 DSP Lab2 DSP Lab 3 DSP Lab4 DSP Lab 5 DSP Lab 6 DSP Lab7 DSP Lab8 DSP Lab9 DSP Lab10 DSP Lab 11 Other material |
||||
| <<Home | ||||
|
||||||