打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Receiver Simulink Study

Receiver Simulink Study

Objective

Building on your knowledge of the transmitter system, in this labyou will study the operation of the receiver subsystem using Simulink.Combined with your transmitter, this will form a completecommunications chain. This lab will also teach you why propersynchronization is a critical component of a practical communicationssystem. You will become acquainted with the following operationsin the receiver:

  • Down conversion
  • Matched filtering
  • Decision rules
  • Carrier and symbol timing recovery (synchronization)

Pre-lab

Again, for the pre-lab, just read through this lab outline so that you havean idea of what you will be doing. Especially make sure you understandthe background section.


Background

In the last lab, we created a transmitter that took binary information,converted this to symbols, generated pulses that were weighted bythe complex baseband symbol weights, and up-converted this toa carrier frequency. The receiver must now "undo" these operations,or downconvert back to baseband, sample at the appropriate times,and make a decision which symbols were transmitted. The figure belowshows a diagram of a generic receiver chain:

For simplicity, the chain has been drawn using complex signals, andrealize that for real processing, we would just have two branchespresent for I and Q processing. The basic operation of the receiverchain is

  1. Multiply by the conjugate of the carrier to shift the signalback to baseband (zero center frequency).
  2. Apply a (matched) filter to remove the image at doublethe carrier frequency.
  3. Sample at the optimal points to obtain estimates ofI/Q symbol weights.
  4. Based on these samples, make a decision which symbolwas transmitted.
  5. Covert symbols back to bits.
Each of blocks is described in more detail below:

Multiply Block

In the transmitter the signal was shifted up to a convenienttransmit frequency suitable for the physical channel. In thereceiver, we need to shift this back to baseband (zero centerfrequency), which is accomplished by multiplying by the conjugateof the carrier used for up-conversion. For a real input signal,we have identical images at frequency f and -f.The multiply operation shifts the one at f to 0,but shifts the other image to -2f, which is removedby subsequent filtering.

Matched Filter

In a simple communications link, we could just use anylow pass filter with a suitable passbandto remove the doubled frequency componentfrom the multiply operation, yielding an estimate of thebaseband signal. In real systems where noise is present,this filter should be designed to provide optimal signal-to-noiseratio. It can be shown mathematically that the optimaloperation is to use a filter that is identical to thetransmit pulse-shaping filter, hence the name "matchedfilter."

We will see later in the lab that we can get a raisedcosine response having the desirable zero-ISI property byusing a root raised cosine filter in thetransmit and receive. In this way, the cascaded responseis a raised cosine filter and both transmit and receivehave identical (matched) filters.

Sampler

The job of the sample block is to sample the receivewaveform at the optimal points to get an estimate of theoriginal I/Q symbol weights that were generated in thetransmitter. In simulation it is easy to compute thedelay required for optimal sampling. In a real communicationssystem, the sampler block will need to be told when tosample by the synchronization blocks.

Decision

Due to noise, the I/Q symbol weight estimates will notbe exactly what we set in transmit system. The decision blockneeds to decide what symbol was most likely transmittedbased on the received I/Q sample. For lower-ordermodulation, this is usually just comparing the value toa threshold (like 0).

Symbols to Bits

This operation is just the reverse of what we didin the transmitter. We take a single symbol and map thisto multiple bits.

Carrier Recovery

Unless we run a long cable from the transmitter toreceiver having the carrier frequency, or use some kind ofultra-stable atomic clock, the two carriers at transmitand receive will not be identical. In wireless RF systems,the offset can typically be 10s to 100s of kHz, which willcreate significant error in our receiver chain.

To remove carrier offset, we can recover the carrier byremoving the modulation from y[n] and lockingan oscillator to this signal. Alternatively, we can puta "pilot tone" in the transmit signal that is an unmodulatedcarrier whose phase and frequency are directly relatedto the modulated transmit signal. By isolating thiscarrier, we can easily generate the carrier forthe modulated signal as well.

Carrier recovery usually uses a phase-locked loop (PLL)which can be thought of as a tracking algorithm forsinusoidal signals.

Symbol Timing Recovery

In simulation, we can compute how much delay is in oursystem and sample at exactly the right times to recoverthe transmitted symbols. In a real system, the symbolclocks will not be exactly the same at transmit andreceive. Also, we do not know how much relative delay thereis between transmit and receive.

To obtain the optimal sample points, we can exploitexcess bandwidth of the transmit signal to "see" the optimalsample points in the I/Q waveforms. This can be done automaticallyby locking a PLL to the rising and falling edges of these waveforms.In the lab, you will gain some intuition how this works.


Procedure

To complete this lab, you again need access to a computer with MATLAB andSimulink. Make sure you have your transmit designs from last time, since wewill use this in this lab as a starting point. You should probably createa new directory for lab 2 to help you manage things, too.

Creating a Subsystem

Maybe you noticed that once you have added very many blocks to yourSimulink model, that things start to look pretty ugly (complicated). We can bettermanage complicated designs by using "subsystems." In this lab, we willput the whole transmitter inside a single subsystem block to allow usto concentrate on the receiver.

Get your final BPSK design for the transmitter from the last lab andsave this under the name bpsk_rx1.mdl. Take the scope out ofthe design, and instead put the output ports (found under Ports & Subsystems)as shown below:

You should also give useful names to these output ports. The actual transmitsignal is called "IF" for "intermediate frequency". This is the signal that yourreceiver will need to decode, and which models what would actually be received ina real communications system. The other "bundle" of signals coming out of the MUXis just called "debug", and contains the pulse train, the baseband signal, andthe carrier, which will be useful to check correct operation of the decoding atthe receiver.

To create a subsystem, select all of the transmit blocks (draw a box around them),right click, and then select "Create Subsystem." You should now see just oneblock with the output ports you specified:

Now you can delete the ports that have been propagated to this higher level designand connect this to the receiver that you will design next. Note that you can modifythings inside your transmit subsystem by simply double clicking on that block.

Basic BPSK Receiver

Next, create a basic BPSK receiver as depicted below.

Make sure you understand what this chain is doing by comparing it to thereceiver chain explained in the background section!

Notes:

  • The sin() block should be the same frequency as in your transmitter. I usedan amplitude of 2 for this block to undo the factor of 1/2 caused by the downconversion.
  • The RECT filter is a new block used here as a low-pass filter to remove thedouble frequency component. Since the bandwidth of your transmit signal is around1/sample_rate = 1/50 = 0.02, you just need to make sure the upper cut-off frequencyis above this. For parameters, I used f0=0 (low-pass), f1=0.1, and taps=32.
  • The low-pass filter introduces an additional 16 samples of delay, so take thisinto account!
  • The decision block is implemented with the Fcn block taken fromthe User defined functions library.

The decision block needs to take a baseband sample, and decide which symbol thisis closest to. For BPSK, we can just check if the signal is positive or negative,and assign this to the bits (or symbols) 1 and 0, respectively. For example,we might do something like

if (input > 0),  output = 1;else  output = 0;end
In MATLAB, a TRUE expression evaluates to 1 and a FALSE expression evaluates to 0.So, we can do the decision operation with a compact expression like:
(u(1)>0)*1 + (u(1)<=0)*0
Here, u(1) is the input sample. If it is greater than a threshold of 0, the output is 1.If it is less than (or equal to) zero, we set the output to zero. Note that the second termis actually not needed.

Once your BPSK receiver is configured and you undestand basically how it is supposedto work, try running it for 1000 samples and see if it gives what you think it should.Make sure you understand all the signals you are seeing!

Matched Filtering

Remember that we will have optimal noise performance if the receive filter isthe same as your transmit filter. Try modifying your BPSK design and use thesame raised cosine filter as in your transmitter. Remember, you will probablyhave to change the delay of the signals for sampling / plotting since thisfilter gives a 64 sample delay.

After making the change, rerun your design. Do you still have the zero ISI property?

Root Raised-Cosine Matched Filter

The usual way to maintain the raised cosine response (and thezero-ISI property) is to use a root raised cosine filter at thetransmit and receive. "Root" means that we take the square root ofthe RC response in the frequency domain. This way if wecascade two root RC filters, we get the RC shape. One problem with theroot raised cosine (RRC) filter is that the time response is muchlonger than the RC filter. So, to support the RRC filter you need todo the following:

  1. Change the transmit and receive filters to root filters (check the box in the parameters)
  2. Make the filters 512 taps long to support the longer time response
  3. Since each filter now creates 256 samples of delay, make changes to any delay blocksthat depend on this.

I would like to point out that in a real system, we would not create such a longfilter (512 taps) for this simple RRC operation. The reason we have to make it solong is because we are using a fixed (high) sample rate throughout our whole system.A real system would typically use the high sample rate only for the upconversion/downconversionparts and then use perhaps 1/10 of the rate for the baseband processing. In that case,the filter would be more like 64 samples long, which is more reasonable.

After making the changes, rerun your system. You should see something very similar towhat you had with just one RC filter on the transmit and no matched filter at the receiver.Also, check to make sure the outputs of the sample block look correct.

Carrier Recovery

In a practical communications system, the receiver oscillator will not be the sameas the transmit one. To see the effect of carriers that are not the same. Modify yourtransmitter so that the sin() block is driven with a modified clock as depictedbelow:

You can change the sin() block to use an external time reference by simply changinga box in its parameters. The clock block is found in the sources library. Also, I have foundusing the transport delay gives smoother plots on the oscilloscope than the discrete delayblock, so that is why I used it instead.

Now, run your communications chain and see what happens to your received symbols. Canyou figure out why having a delay does this? What does a delay mean in terms of the phaseof the oscillators?

To make it easy for the receiver to recover the carrier, we will add a pilot toneto the transmit signal, which is simply an unmodulated component that in this casehas half the frequency of our carrier. The receiver can then isolate this toneand double the frequency to get the carrier back. Any delay or frequency shiftin the transmit carrier will be completely reflected in the pilot tone, allowingthe receiver to track these differences.

Modify your transmit design as depicted below.

The sine wave (pilot tone)that is added to the output signal should have

  • frequency = 2*pi*0.05 (discrete freq=0.05, which is half the frequency of the modulated carrier)
  • amplitude = 0.05
  • phase = 0
The amplitude is somewhat arbitrary, but usually we do not want to make it toohigh in a real system, since it wastes available transmit power. Since it isvery narrowband, we can make it have fairly low amplitude and use a tightfilter to remove noise.

In the receiver, we need to first isolate the pilot tone using a narrowbandpass filter. For this, you can again use the RECT filter as depicted below:

For the filter, I have used 80 taps and f0=0.03 and f1=0.07. I chose 80taps so that the delay of the filter (40 samples) is an integer multiple ofthe carrier period (10 samples), making it so we don't have to adjust the phaseoutput of the PLL.

Now put a scope on the output of the RECT filter as shown and run your chain. Do yousee your carrier at f=0.05? If you can't really tell, you could also use the PSDblock from before and check this way, since this shows frequency directly.

PLL-based Synchronization

Now, how do we use this carrier signal in our receiver? One idea would beto amplify the signal and use it directly instead of the sin(). This isnot usually done, for a number of reasons:

  1. The amplitude of the pilot signal changes as the channel between transmit andreceive changes.
  2. For an I/Q system, we need to also derive a signal that is 90 degrees out ofphase from this.
  3. Here the pilot is half the frequency of what we need. How do we doublethis? Squaring and filtering?!

A much more flexible way to generate our carrier from this signal is to usea phase-locked loop (PLL). This is a device that takes a sine wave as input and tracksits phase using a loop. The PLL generates its own sine wave internally, whose phaseis locked to the incoming signal. The PLL is also free to generate any otherclock or sine wave signals that are needed based on this phase. For example,the PLL can generate a carrier with double or half the frequency, apply a constantphase shift, etc.

In a later lab you will learn the details of what is inside a PLL. For now, a blockhas already been created for you in the DSP Blocks->Timing menu. To understandhow the PLL works, create a new empty design and put the PLL block in it with a sourceas shown below:

The key parameters are shown on the PLL block in the figure. What it means is that thePLL is expecting a nominal input frequency of 0.05 and will generate an output of the samefrequency (0.05) locked to the input. The Tl value is the time constant of the PLL that controlshow quickly the PLL should track. This should be many sinusoidal cycles to make the carriersteady (here I picked 500 samples, which means 25 periods of the carrier).Try the following things:

  1. Make the source frequency 0.05 and run it. How do the input and PLL output sine wavecompare?
  2. Change the amplitude of the input source. Does this affect the output of the PLL?
  3. Make the source frequency 0.055 or 0.45. What happens at the output of the PLL?
  4. Try changing the output frequency of the PLL from 0.05 to 0.1 or 0.025. What doyou see at the output? Can you see how this might be useful?

You should now be convinced that the PLL is a versatile block for synchronizing thingsin a communications system. We will now use it to do the carrier recovery.Place the PLL with the shown parameters in your receiver as depicted below:

You can see that the PLL is set to double the frequency of the isolated pilottone. The amplitude of 2 is to overcome the factor of 1/2 that occurs from the downconversion.The output of the PLL now is the carrier that we use for downconversion. The idealcarrier (the sin() block) is now just used to check if the PLL is putting out theright signal by feeding it to the scope.

Try running your receiver chain now. First look at the scope at the output of the PLL.Did the doubling operation work? Then look at the output of the receiver. Thins should looklike they did before. Finally, try putting a delay in your transmit subsystem or a frequencyoffset. Things should still work correctly!

Symbol Timing Recovery

The final thing that the communications system has to worry about is sampling thematch-filtered signal at the optimal points. As stated before, in a simulation we canjust tweak these to match by considering all the delays that happen. In a real system,the clocks will be different, the transmit and receive will be powered on at different times,the channel will cause delay, etc. How do can we know the delay?!

We will learn more details about symbol timing recovery in a later lab. For now, I havecreated a block to hide most of the details from you, which can be found in the DSP blocks->Timingmenu. Place it in your design as shown below, and note that the lines going down are just for debugging (theygo to an oscilloscope):

If you are curious, you can see what is inside by right-clicking on the block and selectinglook under mask. It basically works by multiplying the baseband signal with a copy of itselfshifted by half of the symbol time. This creates a sinusoid that has a frequency equal to the symbolrate where the zero-crossings of the sinusoid happen at precisely the optimal sample points. Cool, huh?!The PLL is then used to generate a sine wave locked to this carrier. The final delay block allows thetiming to be slightly adjusted as needed. Finally, we just check for a positive zero crossing of thesine wave, which is where we should sample. This block creates a train of pulses at the optimal samplepoints.

The other block that is new here is the sampler block with an external enable that can be foundin the DSP Blocks. We need this instead of the periodic sampler, since we now need to beable to have arbitrary sample points.

You might have noticed that the time constant is much longer for the PLL used for symboltiming recovery (here I picked 10000 samples). Can you think why this is needed? Remember we neededmany sinusoidal cycles. What do you think we need to consider here?

Run your design with the symbol timing recovery. You will find it helpful to add the output of thesymbol timing recovery block (the sample pulse train) to your scope to help you see if it is working.First run it for around 10k samples. Is it tracking yet? Now try running for a much larger valuelike 200k. Inspect the waveform near the end. Does it look right?

Noise

We can't leave our high-level overview of communication systems without considering noise. Noiseis unwanted changes in our signal due to external sources, such as other in-band transmitters, orinternal sources like thermal amplifier noise. The noise must be sufficiently small compared tothe signal in order to confidently decode the transmitted signal. Noise level is usually quantifiedindirectly using the signal-to-noise ratio (SNR), where values like 10dB or better are normallyrequired.

Add a small amount of noise using the bandlimited noise block (Simulink Sources menu), as shown:

Make sure you set the sample time to 1, and I have picked a value of 0.001 for the noise variance.This gives an SNR out of the matched filter around 15dB or so. Rerun your design and look atthe decoding of the symbols. What do you notice that is different from before? Are the symbolsstill decoded properly (once the symbol timing is synchronized that is)?

Try making the noise higher (like 0.01). What happens?

Check-off

Get the TA and show the following things:

  1. Show your BPSK receiver with ideal synchronization (idealseparate oscillators at transmit and receive). Explainhow it works. Run it and show that the symbols (bits) aredecoded correctly.
  2. Show the TA your PLL testing model and show that you can double orhalf the frequency with it. Also show and explain the effect ofchanging the input frequency slightly.
  3. Explain how the pilot tone is used to do carrier recovery. Show howyou modified your design to support the pilot tone. Run your design withcarrier recovery and show it works.
  4. Explain why symbol timing recovery is needed and how your designwas modified to support this. Run your design with the symbol timingrecovery and show it works.
  5. Answer any additional questions the TA asks.

Lab Write Up

For the write-up, provide the following things:

  1. Explain briefly how the receiver works. Also,please highlight anything that was new that you didn't know before!
  2. Explain how we can get a RC response by using root filters at thetransmit and receive. Explain why this is preferable to using justa single (non root) RC filter somewhere.
  3. Explain the need for synchronization in communications systems,and how this was accomplished in this lab. Also describe what a PLLis and what it can do. What are carrier and symbol timingrecovery for?
  4. Give plots showing the output of your communications system fortwo cases: (i) with perfect ideal synchronization, and (ii) withthe synchronization blocks. Circle and label points the printoutto "prove" to the TA that it is working.
  5. Describe any difficulties you experienced in getting your design to work andhow you fixed these problems.
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Using the DFT as a Filter: Correcting a Misconception
Sea/Underwater水声通信机
Telecom Cellular Technology Concepts: Modulation
What is I/Q Data?
ASEMI-ADI亚德诺ADAU1701JSTZ-RL车规级芯片规格书
A short review of antenna and network analyze...
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服