experiment8 sampling theory

Upload: hamouda-azzouz

Post on 03-Jun-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/11/2019 Experiment8 Sampling Theory

    1/12

    Prepared By:

  • 8/11/2019 Experiment8 Sampling Theory

    2/12

    2

    Experiment 8:Sampling

    ObjectiveThe objective of this Lab is to understand concepts and observe the effects of periodically sampling a

    continuous signal at different sampling rates, changing the sampling rate of a sampled signal,aliasing, and anti-aliasing filters.

    Introduction,A typical time-dependent signal, for example AC voltage, is continuous with respect to magnitude and

    time. Such signals are called analog signals. Using a normal (analog) oscilloscope we get an analog

    representation of such a signal.

    Today mainly digital equipment is used for electrical measurements. The original analog signal is

    converted to a digital signal. A digital signal is discrete with respect to the magnitude as well as to the

    time. Therefore, conversion of an analog to a digital signal means the value of the analog signal

    function F(t) is measured at discrete times

    Sampling

    In order to store, transmit or process analog signals using digital hardware, we must first convert them into

    discrete-time signals by sampling.

    The processed discrete-time signal is usually converted back to analog form by interpolation, resulting in a

    reconstructed analog signalxr(t).

    The sampler reads the values of the analog signalxa(t) at equally spaced sampling instants. The time interval

    Tsbetween adjacent samples is known as the sampling period (or sampling interval). The sampling rate,measured in samples per second, isfs =1/Ts.

    x[n]= xa(nTs) , n=, -1, 0, 1, 2, .

    Also it possible to reconstructxa(t) from its samples: xa(t) =x[tFs].

    Figure 4.1: Sampling and Reconstruction process

  • 8/11/2019 Experiment8 Sampling Theory

    3/12

    3

    Sampling Theorem

    The uniform sampling theorem states that a bandlimited signal having no spectral components abovefm hetez can be determined uniquely by values sampled at uniform intervals of :

    The upper limit on Tscan be expressed in terms of sampling rate, denoted fs=1/Ts. The restriction,

    stated in term of the sampling rate, is known as the Nyquist criterion. The statement is :

    The sampling rate is also called Nyquist rate.The allow Nyquist criterion is a theoreticallysufficient condition to allow an analog signal to be reconstructed completely from a set of a uniformly

    spaced discrete-time samples.

    Impulse Sampling

    Assume an analog waveformx(t),as shown in figure 4.2(a), with a Fourier transform,X(f)which is

    zero outside the interval (fm

  • 8/11/2019 Experiment8 Sampling Theory

    4/12

    4

    Using thefrequency convolution propertyof the Fourier transform we can transform the time-domain

    product to the frequency-domain convolution ,

    whereis the Fourier transform of the impulse train . Notice that the Fourier transform ofan impulse train is another impulse train; the values of the periods of the two trains are reciprocally

    related to one another. Figure 4.2(c) and (d) illustrate the impulse train and its Fourier transform, respectively.We can solve for the transformof the sampled waveform:

    *[ ]

  • 8/11/2019 Experiment8 Sampling Theory

    5/12

    5

    Figure 8.2: Sampling theorem using the frequency convolution property of the Fourier transform

    We therefore conclude that within the original bandwidth, the spectrum is, to within a constantfactor (1/Ts) , exactly the same as that ofx(t) in addition, the spectrum repeats itself periodically in

    frequency everyfshertz.

  • 8/11/2019 Experiment8 Sampling Theory

    6/12

    6

    Aliasing

    Aliasing in Frequency Domain

    If fsdoes not satisfy theNyquist rate, , the different components ofoverlap and willnot be able to recoverx(t)exactlyas shown in figure 8.3(b). This is referred to as aliasing in frequencydomain.

    Figure 8.3: Spectra for various sampling rates. (a) Sampled spectrum (b) Sampled spectrum

    :ampling theoryS

    let

    ( ) : analoge signal

    ( ) ( ) : discrete signal

    : analoge frequency Hz

    : discrete frequency Hz

    : analoge frequency rad/sec

    : discrete frequency rad/sec

    : sampling

    ( ) ( )

    let the analoge signal

    s s

    s

    s s

    x t

    x nT x n

    F

    w

    T period

    x n x nT

    ( ) cos(2 )

    sampling ( ) cos(2 ) ( ) cos(2 )

    Didital frequency (discrete frequency )=analoge frequency x sampling

    s s s

    s

    t

    nT

    x t F

    x nT F x n fn

    period

    f FT

  • 8/11/2019 Experiment8 Sampling Theory

    7/12

    7

    Figure 1shows a simple example .The solid linedescribes a 0.5Hz continuous-time sinusoidal signal and the

    dash-dot line describes a 1.5 Hzcontinuous time sinusoidal signal. When both signals are sampled at the rate

    of Fs =2 samples/sec, their samples coincide, as indicated by the circles. This means thatx1[nTs] is equal to

    x2[nTs] and there is no way to distinguish the two signals apart from their sampled versions. This phenomenon

    is known as aliasing.

    Figure 1: Two sinusoidal signals are indistinguishable from their sampled versions

    ( )

    (

    )

  • 8/11/2019 Experiment8 Sampling Theory

    8/12

    8

    Practical Partsf0=1000;%Freqyency of sin

    fs1=10000;%Sampling Frequency Fs>2Fm

    fs2=1500;%Sampling Frequency Fs2Fm

    Sampling With Fs

  • 8/11/2019 Experiment8 Sampling Theory

    9/12

    9

    Do you now that the human voice bandwidth lay between 0-4.5K Hz , Try different Fs in the

    following code and see the effect of aliasing .

    % Record your voice for 5 seconds.

    fs=1000;

    recObj = audiorecorder(fs,16,1);disp('Start speaking.')

    recordblocking(recObj, 5);

    disp('End of Recording.');

    % Play back the recording.

    play(recObj);

    % Store data in double-precision array.

    myRecording = getaudiodata(recObj);

    % Plot the waveform.

    plot(myRecording)

  • 8/11/2019 Experiment8 Sampling Theory

    10/12

    1

    HomeworkThe signal can be sampled at the rate to yield Aliasing will be observed for various a) Let =10 kHz and =1 kHz. plot x[n] usingstem.m.

    b) Use subplot to plotx(t)for =300 Hz, 700 Hz, 1100 Hz and 1500 Hz. and =10 kHz

    try using for loop

    Comment on the result figure in (b):

    c) Use subplot to plot x[n] for =10300 Hz, 10700 Hz, 11100 Hz and 11500 Hz..

    Comment on the result figure in (c):

    (1) The period:

    (2) Aliasing

  • 8/11/2019 Experiment8 Sampling Theory

    11/12

    Question 2:

    Consider an analog signal x(t) consisting of three sinusoids

    x(t)= cos(2t)+cos(8t)+cos(12t)

    Using Matlab,(a)Show that if this signal is sampled at a rate of Fs = 5 Hz, it will be aliased with the

    following signal, in the sense that their sample values will be the same:

    xa(t)= 3cos(2t)

    Part 2: Aliasing in Frequency Domain:

    a) Construct the simulink model shown in Figure 8.6.b) use the attachment files of the spectrum analyzer and put it in you current diroctory

    c)

    Input a sine wave ofFo=5 Hz frequency from the signal generator1 and a sine wave ofFo=50 Hz frequency from the signal generator2. Choose a samplingtime of 0.001 sec for the pulse generator with pulse duration of 1% of the sampling

    period. Choose the cut-off frequency of 120 for the Butterworth low-pass filter.

    d) Start the simulation for 10sec and notice all visualizers(included them in your report).

    e) Repeat steps 2 and 3 for a sine wave different sampling frequency Comment.

    Figure 8.6: Simulink model to implement aliasing in frequency domain

    Spectrum

    Analyzer1

    Signal

    Generator2

    Signal

    Generator1

    Scope4

    Scope3Scope2

    Scope1

    Scope1

    Pulse

    Generator Product

    Mux

    butter

    Analog

    Filter Design

    Add

  • 8/11/2019 Experiment8 Sampling Theory

    12/12

    2

    Why does a wheel seem to move backwards as it speeds up?

    Try to answer in the light of aliasing theory