Vous êtes sur la page 1sur 2

Simulation exercises using MATLAB/SIMULINK

A. DISCRETE-TIME SIGNALS & SYSTEMS


Objective: i. Study of basic properties of discrete time signals ii. Study of effects of sampling and quantisation iii. Time domain representation of discrete-time systems

Properties of signals
1. Plot the following signal Sum of sinusoids of the form x(n) = Ak Cos (k k n + k ) where
k =0 3

k 0 1 2 3

Ak 2 4 3 4

kk 0 /20 3/40 3/20

k 0 -/5 -/2 -/3

Is the signal periodic? If so find the fundamental period. Use stem to plot discrete-time signals. 2. Listen to the following signal

x(t ) = Re X 2 e j 2 2 f ot + X 4 e j 2 4 f ot + X 5e j 2 5 f ot + X 16 e j 2 16 f ot + X 17 e j 2 17 f ot

fo=100Hz, X2=771+j12202, X4=-8865+j28048, X5=48001-j8995, X16=1657-j13520, X17=4723, Fs = 10kHz 3. Suppose you sample an analog signal x(t) = 1 t during the interval 0 t 1sec with a sampling period of 0.125s to generate x(n). Plot x(n), x(-n), xeven(n), xodd(n). 4. Let x(n) = [ 2, 4, -3, 1, -5, 4, 7] -3 n 3. Generate and plot the samples of the following sequences using stem function (i) x1(n) = 2x(n-3) + 3 x(n+4) x(n) (ii) x2(n) = 4x(4+n) + 5 x(n+5) + 2x(n) (iii) x3(n) = x(n+3)x(n-2) + x(1-n) x(n+1) (iv) x4(n) = 2e 0.5n x(n) + cos(0.1n) x(n+2) -10 n 10

Effect of Sampling and quantisation


5. Sample the analog signal x(t)=sin(10t) at i) 1000Hz ii) 15 Hz and iii) 7.5 Hz. Plot the discrete time signal and observe the effect of aliasing.
Sample Solution
% Demo of sampling t=0:0.001:2; xa=sin(2*pi*5*t); plot(t,xa); hold on; %% fs=15; ts=0:1/fs:2;

Dept. of E&C, NITK Surathkal

Simulation exercises using MATLAB/SIMULINK

xs=sin(2*pi*5*ts); plot(ts,xs,'ro-'); %% fs=7.5; ts=0:1/fs:2; xs=sin(2*pi*5*ts); plot(ts,xs,'go-');

6. Modify the code to sample the analog signal x(t)=3cos(100t) at i) 400Hz ii) 100 Hz and iii) 60 Hz. Plot the discrete time signal and observe the effect of aliasing. 7. Consider the discrete time signal x(n) = cos (2n/7). (i) Obtain and plot the downsampled(decimated) signal y(n) = x(2n) along with x(n) (ii) Obtain and plot the upsampled (interpolated) signal z(n) = x(n/2) for n even and z(n) = 0 otherwise along with x(n) 8. In DTMF dialling a number is represented by a dual frequency tone. (i) Do a web search and find the frequencies of each digit (ii) Generate DTMF tones corresponding to the telephone number 0824-2474040 by sampling the sum of simusoids at the required frequencies at Fs = 8192 Hz. Concatenate the signals by putting 50 zeros between each signal (to represent silence) and listen to the signal. 9. Record your own voice for half a minute and observe the time-domain waveform. i) Find the average value and energy of the entire signal. ii) Split the signal into segments of 20ms long and compute the energy of each segment and plot it. 10. Run the following demos.
a) Demo to illustrate analog, discrete time and digital signals cd d:\dsp_lab\demo\sig_1_comp gui

Try for sine wave of frequency 10Hz sampled at 80Hz, 20Hz, 15 Hz and 65Hz. Observe the effect of aliasing
b) Hear the effects of aliasing on a sinusoid cd d:\dsp_lab\demo\sig_3_comp gui c) Sampling and quantisation of audio signals cd d:\dsp_lab\demo\sig_2_comp gui

Select any audio signal available in d:\dsp_lab\demo\sound\wav_files as *.mat file.


d) Reconstruction using ZOH, linear, cubic interpolation cd d:\dsp_lab\demo\1D gui

We wish to acknowledge Dr. Umesh Rajashekar (BE 1998 KREC), Laboratory for Computer Vision, New York University for the demonstration programs

Dept. of E&C, NITK Surathkal

Vous aimerez peut-être aussi