Walter Scott, Jr. College of Engineering



SIGNALS AND SYSTEMS LABORATORY 2:

Sampling and Reconstruction of Continuous Signals in MATLAB/SIMULINK

Introduction

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, we’ll sample and reconstruct some continuous signals using Simulink to understand the effects of sampling.

Periodic Sampling

The typical method of obtaining a discrete-time representation of a continuous-time signal is through periodic sampling, wherein a sequence of samples, [pic], is obtained from a continuous-time signal [pic] according to:

[pic]

T is the sampling period, and its reciprocal, [pic], is the sampling frequency, in samples per second (Hz). We also express the sampling frequency as [pic]when we want to use frequencies in radians per second.

Frequency Domain Representation of Sampled Signals

The frequency spectrum of a sampled signal is also periodic in frequency with period [pic]. In fact, the frequency spectrum can be represented as a summation of copies of the original continuous-time frequency response:

[pic]

Note that, for the bandlimited signal, within each frequency period, the frequency spectrum of the sampled signal has the same distribution as the frequency spectrum of the original signal. The process of sampling has resulted in the frequency spectrum of the original signal being repeated around every integer multiple of [pic]. This leads to the phenomenon of aliasing, whereby, after sampling, high frequencies can alias down to lower frequencies.

Sampling Frequency Selection

For complete reconstruction of a continuous signal from it’s samples, the sampling frequency should be selected according to the Nyquist-Shannon Sampling Theorem which can be stated as follows:

Let [pic]be a bandlimited signal with

[pic] for [pic]

Then [pic] is uniquely determined by its samples [pic], provided we sample faster than:

[pic]

The frequency [pic]is commonly referred to as the Nyquist frequency, and the frequency [pic]that must be exceeded by the sampling frequency is called the Nyquist rate.

Simulink Investigation

The above theory will be developed in class in detail. This will allow for a precise understanding of the frequency content of sampled signals. For the moment we can study the effects of this by looking at sine waves in the time domain (the connection to frequency domain is clear). We will use Simulink to simulate several sampled data systems (i.e., systems containing both continuous-time and discrete-time pieces). Note 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 A/D) if a continuous-time signal is fed into a digital system. It will also automatically reconstruct the signal (i.e., append a virtual D/A) 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. Note that passing through a unity discrete-time system, and then a unity continuous-time system, effectively samples and then reconstructs the signal.

[pic]

Figure 1: Sampling and Reconstruction in Simulink (recon)

[pic]

Figure 2: Moving Average Filter Simulink Model (movavg)

-----------------------

Assignments:

1. Download the Simulink model recon.mdl from the website. It is shown below in figure 1. Note that it cascades a discrete-time and a continuous-time system to effectively sample and reconstruct the input. Double click the Signal Generator to see what the frequency of the input (continuous-time) sine-wave is, and double click the Discrete-Time Transfer Function to see what it’s sample time is (from which you can easily compute the sample frequency). Run it to see the (time domain) Scope plot(s) and the (frequency domain) Power Spectral Density graphs, compare them, and explain what you see. Double click the Discrete-Time Transfer Function and change the sample time to 1/500, 1/100, 1/50, 1/30, 1/20, 1/15, 1/7.5, 1/5. Run the program at every case and explain what you see – how good a job of approximating the original signal does the reconstructed signal do? Explain the connection between the time and frequency domain content of the signals, and the effects of sampling. Note what happens above and below the Nyquist rate (think about the periodicity of the signal and where the samples occur). Bonus: try experimenting with non-trivial continuous-time and discrete-time transfer functions (i.e., not simply unity) and explain what you see.

2. Download the Simulink model movavg.mdl from the website. It is shown in figure 2. The input consists of a noisy sine wave (made by superposing two signals). Run the filter and explain what you see. Note that you can double click on all the components to check their properties (sample rate, frequency, amplitude, etc.). Now change the input section so that the input is (effectively) an impulse (e.g., you can use the Pulse Generator Source) and hence simulate the impulse response of this system. Does it correspond to what you would calculate from the theory we have done in class? Is it an FIR filter? Bonus: try experimenting with different inputs (e.g., sine waves of various frequencies), and replace the output Scope with a Power Spectral Density block. Try to empirically determine the frequency response of this filter (what type of filter is it?).

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download