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

Lab Notes 2

The document discusses sampling and reconstruction of continuous signals in MATLAB/Simulink. It introduces periodic sampling and how it relates to the frequency domain representation of sampled signals. It describes an assignment to use Simulink models to sample and reconstruct sine waves and investigate a moving average filter.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Lab Notes 2

The document discusses sampling and reconstruction of continuous signals in MATLAB/Simulink. It introduces periodic sampling and how it relates to the frequency domain representation of sampled signals. It describes an assignment to use Simulink models to sample and reconstruct sine waves and investigate a moving average filter.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

SIGNALS AND SYSTEMS LABORATORY 2: Sampling and Reconstr ction o!

"ontin o s Signals in MATLAB#SIM$LIN%


Introd ction
Continuous signals are often sampled to obtain discrete-time values, which can be represented digitally for computer processing or transmitting the data over a digital communication system. In this lab, well sample and reconstruct some continuous signals using Simulink to understand the effects of sampling.

&eriodic Sampling
The typical method of obtaining a discrete-time representation of a continuous-time signal is through periodic sampling, wherein a se uence of samples, x" n! , is obtained from a continuous-time signal x $t # according to% x" n! = x $t # t =nT T is the sampling period, and its reciprocal, f s = ' & T , is the sampling fre uency, in samples per second $()#. *e also e+press the sampling fre uency as s = , & T when we want to use fre uencies in radians per second.

're( enc) Domain Representation o! Sampled Signals


The fre uency spectrum of a sampled signal is also periodic in fre uency with period s = , & T . In fact, the fre uency spectrum can be represented as a summation of copies of the original continuous-time fre uency response%

X dig $# =

' T

n =

cont

$ ns #

-ote that, for the bandlimited signal, within each fre uency period, the fre uency spectrum of the sampled signal has the same distribution as the fre uency spectrum of the original signal. The process of sampling has resulted in the fre uency spectrum of the original signal being repeated around every integer multiple of s . This leads to the phenomenon of aliasing, whereby, after sampling, high fre uencies can alias down to lower fre uencies.

Sampling 're( enc) Selection


.or complete reconstruction of a continuous signal from its samples, the sampling fre uency should be selected according to the Nyquist-Shannon Sampling Theorem which can be stated as follows% /et x $t # be a bandlimited signal with

X $# = 0 for N Then x $t # is uni uely determined by its samples x" n! , provided we sample faster than% s = , & T ,N

The fre uency N is commonly referred to as the Nyquist frequency , and the fre uency , N that must be e+ceeded by the sampling fre uency is called the Nyquist rate.

Sim lin* In+estigation


The above theory will be developed in class in detail. This will allow for a precise understanding of the fre uency content of sampled signals. .or the moment we can study the effects of this by looking at sine waves in the time domain $the connection to fre uency domain is clear#. *e will use Simulink to simulate several sampled data systems $i.e., systems containing both continuous-time and discrete-time pieces#. -ote that Simulink allows for the interconnection of continuous-time and discrete-time pieces directly. The simulation is smart enough to automatically sample the signal $i.e., append a virtual 1&2# if a continuous-time signal is fed into a digital system. It will also automatically reconstruct the signal $i.e., append a virtual 2&1# if a digital signal is fed into a continuous-time system. This makes it very easy to build sampled-data system interconnects that allow us to see the effects of sampling and reconstruction. -ote that passing through a unity discrete-time system, and then a unity continuous-time system, effectively samples and then reconstructs the signal.

Assignments: '. 2ownload the Simulink model recon.mdl from the website. It is shown below in figure '. -ote that it cascades a discrete-time and a continuous-time system to effectively sample and reconstruct the input. 2ouble click the Signal 4enerator to see what the fre uency of the input $continuous-time# sine-wave is, and double click the 2iscrete-Time Transfer .unction to see what its sample time is $from which you can easily compute the sample fre uency#. 3un it to see the $time domain# Scope plot$s# and the $fre uency domain# 5ower Spectral 2ensity graphs, compare them, and e+plain what you see. 2ouble click the 2iscrete-Time Transfer .unction and change the sample time to '&600, '&'00, '&60, '&70, '&,0, '&'6, '&8.6, '&6. 3un the program at every case and e+plain what you see 9 how good a :ob of appro+imating the original signal does the reconstructed signal do; <+plain the connection between the time and fre uency domain content of the signals, and the effects of sampling. -ote what happens above and below the -y uist rate $think about the periodicity of the signal and where the samples occur#. Bon s% try e+perimenting with non-trivial continuous-time and discrete-time transfer functions $i.e., not simply unity# and e+plain what you see. ,. 2ownload the Simulink model movavg.mdl from the website. It is shown in figure ,. The input consists of a noisy sine wave $made by superposing two signals#. 3un the filter and e+plain what you see. -ote that you can double click on all the components to check their properties $sample rate, fre uency, amplitude, etc.#. -ow change the input section so that the input is $effectively# an impulse $e.g., you can use the 5ulse 4enerator Source# and hence simulate the impulse response of this system. 2oes it correspond to what you would calculate from the theory we have done in class; Is it an .I3 filter; Bon s: try e+perimenting with different inputs $e.g., sine waves of various fre uencies#, and replace the output Scope with a 5ower Spectral 2ensity block. Try to empirically determine the fre uency response of this filter $what type of filter is it;#.

1 1 Sine Wave Discrete-T ime T ransfer Fcn

1 1 Continuous-T ime T ransfer Fcn Scope

Power Spectral Density Cont-Time

Power Spectral Density Disc-T im e

.igure '% Sampling and 3econstruction in Simulink $recon#

1 Signal Generator Sum1 z Unit Del ay1

1 z Unit Delay3

1 z Unit Delay2 1/4 Gain Scope2

Sum 2 Scope1 Random Num ber

.igure ,% =oving 1verage .ilter Simulink =odel $movavg#

You might also like