lab5

5
ENEL 593 -- Digital Filters Laboratory #5 Digital Filters in a Simple Digital Communication Systems c L.T. Bruton. All rights reserved. 1 Objectives In this laboratory, we will again make use of the many useful tools available in MAT- LAB’s Signal Processing Toolbox for analyzing signals and designing digital filters. Here, you will pursue an application in a simple communication system. You will explore using digital filters to suitably combine two different speech signals (the same two as used in Lab #4) over a single communication channel, and then separate them. There are two main components of the system. The Transmitter: two speech signals are combined to send over a communication channel. They are combined in such a way that they can be easily separated at the receiver. The Receiver: the two speech signals are recovered. 1.1 The Audio Files For this experiment, you will be operating on the set of pre-recorded digital audio files which contain the uncontaminated speech signals first tested in Lab #4. As before, these file are found in the Linux directory:

description

lab

Transcript of lab5

Page 1: lab5

ENEL 593 -- Digital Filters

Laboratory #5

Digital Filters in a SimpleDigital Communication Systems

c© L.T. Bruton. All rights reserved.

1 Objectives

In this laboratory, we will again make use of the many useful tools available in MAT-LAB’s Signal Processing Toolbox for analyzing signals and designing digital filters.Here, you will pursue an application in a simple communication system. You willexplore using digital filters to suitably combine two different speech signals (the sametwo as used in Lab #4) over a single communication channel, and then separate them.There are two main components of the system.

• The Transmitter: two speech signals are combined to send over a communicationchannel. They are combined in such a way that they can be easily separated atthe receiver.

• The Receiver: the two speech signals are recovered.

1.1 The Audio Files

For this experiment, you will be operating on the set of pre-recorded digital audio fileswhich contain the uncontaminated speech signals first tested in Lab #4. As before,these file are found in the Linux directory:

Page 2: lab5

ENEL 593 Lab #5 (FDM Filtering Application) – Fall, 2012 2

/local/courses/ENEL/593

or on Windows systems on the N: drive. The two files of interest there are ‘talk1.mat’and ’talk2.mat’. Each audio clip is approximately 5 seconds long, recorded at asample rate of 8012 Hz, corresponding roughly to a total of 40,000 samples. For thisexperiment, it’s also important to observe that they are not exactly the same size.

As before, use MATLAB’s load command to read these files; for example:

load /local/courses/ENEL/593/talk1

MATLAB will load a column vector named talk1 from the talk1.mat file. Similarly it willload a column vector named talk2 from the talk2.mat file.

1.2 Listening to the Speech Clips

You will need to listen to these speech clips before transmission and after recovery throughthe channel to judge how well your system is working. Follow the tips given in the instruc-tions to Lab #4 for listening to the sound clips using MATLAB’s sound command.

2 Frequency Division Multiplexing (FDM)

2.1 Speech Compression

Our goal here is to design a system that is capable of transmitting two speech signals (eachhaving a sample frequency of 8012 Hz) simultaneously over a single channel at the same8012 Hz sample frequency, and with a minimal loss of fidelity. This corresponds to a 2:1compression ratio of each speech signal.

A simple block diagram of the system is shown in Fig. 1.

Combiner Separatortalk1.mat

talk2.mat

talk1out.mat

talk2out.matlosslesschannel

Fig. 1. Compression of two speech signals over a lossless channel

Page 3: lab5

ENEL 593 Lab #5 (FDM Filtering Application) – Fall, 2012 3

2.2 FDM - Quick Review

For this experiment, we will employ FDM such that the two signal spectra share the available4006 Hz channel bandwidth.

You may recall from your earlier undergraduate courses that such a system can beimplemented using a simple amplitude modulation (AM) scheme to shift the signal spectraaround in the frequency domain. AM makes direct use of the very important convolutionproperty given by

x[n]y[n]←→ X[k] ∗ Y [k] (1)

for the Discrete Fourier Transform, where the left-hand side is multiplication in the timedomain, and the right-hand side is convolution in the frequency domain.

Also recall that a pure cosine function in the time domain is represented in the fre-quency domain precisely by a pair of impulse functions at positions on the frequency axiscorresponding to the frequency ±f1 of the cosine function. The principle idea of AM isthen to multiply a signal by a pure cosine function in the time domain. As a consequence,the signal’s spectrum is convolved with the impulse functions in the frequency domain. Thisconvolution is very simple; the result is to simply shift identical copies of the signal’s fre-quency spectrum from the origin to positions centered about ±f1, as illustrated in Fig. 2.(Note also the reduction in amplitude by one-half.)

|X(f)|

MM/2

f f

f1-f1

AmplitudeModulation

|X(f)|Basebandsignal

Modulatedsignal

Fig. 2. Shifting frequency spectra using AM

The goal of FDM therefore is to exploit this property by shifting the spectra of thesignals to different regions of the available frequency band, and to do our best to avoid anyoverlap of the signal spectra. Each signal must therefore have a unique “carrier frequency”(e.g., f1), and will need to be suitably bandlimited to avoid spectral overlap. The combinedtime-domain signal will simply be the sum of the suitably bandlimited modulated signals.This is the signal you transmit.

Page 4: lab5

ENEL 593 Lab #5 (FDM Filtering Application) – Fall, 2012 4

3 Building and Testing the System

3.1 The Transmitter

Begin with the transmitter stage. Decide first how to divide the channel bandwidth betweenthe two signals and what range of frequencies you wish to employ for each. You have tocram them both into a total of just 4006 Hz, so clearly you should expect some loss offidelity.

HINTS: There are many ways to do this; feel free to ex-periment, and anything goes! For example, you may chooseto leave one signal at “baseband,” and also perhaps experi-ment with single-sideband (SSB) AM. See if you can eke outthe best audio fidelity you can given the tight bandwidth con-straints.

Proceed as follows:

1. First, you will need to make the speech clips the same length since you will ultimatelybe adding them together after modulating. You may choose to truncate the largerone, or pad the shorter one with zeros.

2. Examine the frequency spectra of the two signals using MATLAB’s fft command,and decide on appropriate bandlimiting filters for each. As in Lab #4, you may useanything available in the Signal Processing Toolbox. You may wish to experimentwith the various filter types and parameters in this and later steps to ultimatelymaximize the fidelity of the recovered signals.

3. Now implement your AM scheme to shift the frequency spectra to their designatedspots in the available 4006 Hz range. Confirm this part of it by plotting the signalspectra using MATLAB’s fft command. Then, add the two signals in the timedomain, and again confirm that the signal spectra are where they should be, andwith minimal overlap.

3.2 The Receiver

In this stage, it is required to separate the two signals by filtering and demodulating torestore all of the signals to baseband. You may do the steps in any order you wish, andonce again with anything available in the Signal Processing Toolbox.

1. Listen to the two recovered signals, and comment on your results. Plot their spectraand compare them with the spectra of the signals prior to combining them in thetransmitter stage (but after bandlimiting).

2. To test your overall system design, measure and comment on the magnitude frequencyresponse from each of the two inputs to each of the two outputs. You may use anymethod to do this, but perhaps the easiest is to proceed as follows.

Page 5: lab5

ENEL 593 Lab #5 (FDM Filtering Application) – Fall, 2012 5

(a) Give a unit impulse function in place of the original talk1 signal, with a zerosequence in place of the talk2 signal. Plot the magnitude spectrum at bothreceiver outputs. The talk1 output will be the in-channel frequency response,and the talk2 output will be the cross-channel frequency response.

(b) Repeat step (a) by giving in a unit impulse function in place of the talk2 signal,and use a zero sequence in place of the talk1 signal. Here, the talk2 output will bethe in-channel frequency response, and the talk1 output will be the cross-channelfrequency response.

Modified by Norm, November 18, 2012.