main content

hdl ofdm receiver -凯发k8网页登录

this example shows how to implement an ofdm-based wireless receiver by using simulink® blocks optimized for hdl code generation and hardware implementation.

the model shown in this example receives data and decodes it based on the orthogonal frequency division multiplexing (ofdm). the main purpose of this example is to model a custom hdl ofdm wireless communication receiver that can recover information in a real-time scenario and supports data rates up to 3 mbps. this model enables you to configure parameters: symbol modulation types such as bpsk, qpsk, 16-qam, and 64-qam and code rates 1/2, 2/3, 3/4 and 5/6 through punctured convolution encoding. this model enables you to control impairments such as carrier frequency offset (cfo), carrier phase offset (cpo), and rayleigh fading channel, which significantly affect an ofdm-based communication system.

the receiver in this example works in conjunction with the transmitter in the hdl ofdm transmitter example. the receiver in this example has a matlab® floating point equivalent function described in the example.

model architecture

the following figure shows the architecture of an ofdm receiver. the receiver samples the input at 1.92 msps. these samples stream into the rx filter. the output from the rx filter stream into the frequency estimator and the frequency corrector. the frequency estimator and the frequency corrector estimate and correct cfo respectively and the samples stream into the synchronizing sequence (ss) detector. the output of the ss detector is used for the time synchronization. the time synchronized samples stream into the ofdm demodulator, which demodulates the input and generates the frequency-domain subcarriers. the subcarrier parser parses the channel reference subcarriers, header subcarriers, and data subcarriers. the channel reference subcarriers stream into the channel estimator, which estimates the channel frequency response. the channel equalizer uses these estimates to equalize the header and data subcarriers in the frequency domain. the header recovery recovers the header information using the channel-equalized header subcarriers. the cpe estimator estimates the common phase error (cpe) in the data sub carriers that get corrected by cpe corrector. the data recovery uses the header information and the cpe-corrected data subcarriers to decode the data bits.

file structure

two simulink models and three matlab files are used to construct this example.

  • whdlofdmreceiver.slx — top level ofdm receiver simulink model

  • whdlofdmrx.slx — reference model used by the whdlofdmreceiver.slx model

  • whdlexamples.ofdmreceiverinit.m — initialization script for whdlofdmreceiver.slx initialized in the model's initfcn callback.

  • whdlexamples.ofdmrxparameters.m — initialization function for whdlofdmrx.slx initialized in the model workspace and model's initfcn callback

  • whdlexamples.ofdmtx.m — matlab floating-point equivalent transmitter function for generating a transmitter waveform. the generated transmitter waveform is used in the whdlexamples.ofdmreceiverinit.m script

receiver interface

this figure shows the top-level model in this example.

model inputs:

  • datain — input data, specified as a complex signed 16-bit signal sampled at 1.92 msps.

  • validin — control signal to validate the datain, specified as a boolean scalar.

  • impairmentcontrol — bus signal to control the channel impairments.

the impairmentcontrol bus comprises following signals:

  • frequencyoffsetcorrectiontype — control signal to indicate whether to select use internally estimated frequency offset or use externally provided frequency offset option for offset correction, specified as a boolean scalar.

  • externalfrequencyoffset — real signed 14-bit cfo with range from -7400 hz to 7400 hz provided externally for cfo correction.

  • channelequalizercontrol — control signal to indicate whether to enable or disable channel equalization, specified as a boolean scalar.

  • cpecorrectioncontrol — control signal to indicate whether to enable or disable cpe correction, specified as a boolean scalar.

model outputs:

  • dataout — decoded output data bits, returned as a boolean scalar.

  • validout — control signal to validate the dataout, returned as a boolean scalar.

  • diagbus — status signal with diagnostic outputs, returned as a bus signal.

structure of the receiver

the ofdm receiver subsystem performs a set of operations in a sequence. this subsystem uses the whdlofdmrx.slx reference model. this reference model is initialized in its model workspace and in the model initfcn callback using the whdlexamples.ofdmrxparameters function. the following figure shows the top-level subsystems in the reference model.

synchronization and ofdm demodulation

the synchronization and ofdm demodulation subsystem performs frequency and time synchronization and ofdm demodulation.

the frequency and time synchronization subsystem comprises timing adjust subsystem and cfo estimation and correction and ss detection subsystem.

the cfo estimation and correction and ss detection subsystem comprises cfo estimation and ss detection subsystem and frequency correction nx subsystem, which perform frequency correction for the input signal. the estimate from the cfo estimation and ss detection subsystem is used for frequency correction if the frequencyoffsetcorrectiontype signal on the top-level model interface is set to use internally estimated frequency offset. the externalfrequencyoffset is used for frequency correction if the frequencyoffsetcorrectiontype signal is set to use externally provided frequency offset.

the cfo estimation and ss detection subsystem comprises cfo estimation subsystem, start controller subsystem, sync signal search subsystem, and frequency correction 1x subsystem that perform frequency correction on input signal.

the cfo estimation subsystem uses the cyclic prefix correlation technique to estimate the cfo of the input signal. the cyclicprefixcorrelator subsystem estimates one cfo value for every six ofdm symbols by averaging all the estimates in six ofdm symbols. the angleatmaximum subsystem selects the strongest correlation peak for every six ofdm symbols and records its phase angle. the anglefilter subsystem implements an averaging filter to average all the recorded phase angles for a duration of 12 ms. the resulting phase angle serves as a final cfo estimate.

the sync signal search subsystem implements the ss correlation. ss detection is performed by continuously cross-correlating the received signal with the ss signal in the time domain. in addition, the energy of the signal in the span of the correlator is computed on each time step and then scaled to generate a threshold. the max peak searcher subsystem begins searching for the maximum correlation peak after 12 ms and searches for every 3 ms time window. the subsystem records the timing offset of the synchronization. the start controller function block indicates to the max peak searcher subsystem the end of the 12 ms duration.

the timing offset recorded at the maximum correlation value by the max peak searcher is transferred to the timing adjust subsystem to synchronize timing.

the block demodulates the synchronized samples and generates subcarriers.

channel and cpe estimation and correction

the channel and cpe estimation and correction subsystem estimates the channel frequency response, equalizes the channel, performs cpe estimation, and corrects the cpe.

the reference signal parsing matlab function block separates the ofdm symbols reserved for computing channel estimates.

the ofdm symbols reserved for computing channel estimates are streamed through channel estimation subsystem. the block averages the estimates from the two symbols and outputs the final channel estimates. the estimates are streamed into the channel equalization subsystem that stores the estimates in a ram and performs frequency-domain channel equalization using the block for all the remaining ofdm symbols in the frame.

the header and data parsing matlab function block separates the ofdm symbols corresponding to header and data symbols.

the frequency domain channel-equalized data subcarriers stream through the common phase error estimation and correction subsystem. in the frequency estimation process, there is always a small estimation error due to the channel impairments. this estimation error results in a residual frequency offset in the channel-equalized subcarriers. this results a cpe in all the subcarriers in an ofdm symbol and changes from symbol to symbol. the cpe estimation subsystem estimates the cpe on each ofdm symbol using the 12 pilot subcarriers. the pilots are the known subcarriers and any phase rotation in the received symbols is estimated by using the pilots. the estimates drawn from the same symbol are averaged to get the final estimate. the symbol is stored in the symbol buffer matlab function block during estimation. once the estimate is ready, the symbol is read from this buffer block and the cpe correction subsystem corrects the cpe in the data subcarriers with that estimate.

header and data recovery

the header and data recovery subsystem recovers header information and data bits.

the header recovery subsystem recovers the header information to decode data bits. the frequency domain channel-equalized header subcarriers stream into the header recovery subsystem. the block performs bpsk soft symbol demodulation. the channel coding subsystem is equipped with a deinterleaver subsystem and block. the deinterleaver subsystem performs deinterleaving with a maximum block size of 72 and the number of columns as 18. the viterbi decoder block performs 1/2 rate viterbi decoding. for more information about the deinterleaver subsystem, see the example. the block uses a 16-bit crc checksum to validate the decoded bits from the viterbi decoder block. if the crc checksum fails, the general crc syndrome detector hdl optimized block generates an error signal.

the data recovery subsystem uses header information to decode data bits. the header information is stored in the registers. these registers are used to access the header information. the block performs soft bit bpsk, qpsk, 16-qam, or 64-qam symbol demodulation associated with the modulation type retrieved from the header information. the channel coding subsystem is equipped with the deinterleaver, , and blocks. each code rate is assigned a predefined punctured vector pattern. based on the code rate retrieved from the header information, the channel coding subsystem performs deinterleaving and depuncturing followed by viterbi decoding. for more information on the deinterleaver block, see the example. the decoded bits are streamed through the descrambler subsystem. the block uses a 32-bit crc checksum to validate the descrambled bits. if the crc checksum fails, the general crc syndrome detector hdl optimized block generates an error signal.

diagnostic bus formation

the diagnostic bus formation subsystem creates a bus signal for some status signals of the receiver. this bus can be used to analyze the receiver when deployed onto the hardware.

the data bits are decoded in the data recovery subsystem. the decoded bits stream out of the receiver and stored to workspace in the capture data bits subsystem in the top-level receiver model. the diagnostics decoder subsystem decodes the source-coded header information and counts the number of synchronized frames, number of header crc passes and failures, and the number of data crc passes and failures in the bus signal formed in the diagnostic bus formation subsystem. the simulink display blocks display the diagnostics decoder information.

run the receiver

connect the receiver back-to-back with the transmitter in the hdl ofdm transmitter example and run the simulink model. for more information on how to connect the transmitter and the receiver simulink models back-to-back see the example.

the following files describe a procedure to initialize, generate inputs, run, and verify the whdlofdmreceiver.slx model using the whdlexamples.ofdmreceiverinit.m initialization script. you can choose a custom transmitter waveform and a channel impairment of your choice from the custom frame configuration section in these files.

  • ofdmrxrealtimesimulationdisplay.m — this script mimics a channel in a real-time scenario. you can choose any available channel impairment and run the script. the script displays the outputs and generates plots of estimated frequency offset and ss correlation.

  • ofdmrxfadingchannelresponsedisplay.m — this script mimics only the fading channel. you can choose only the fading channel impairment and run the script. the script displays the outputs and generates the plots of channel impulse response and the comparison of estimated frequency response with the frequency response, derived from the impulse response.

note: these files are not available on the matlab search path. to copy these files locally to the user path, you must open this example.

verification and results

the whdlexamples.ofdmrx.m script is a matlab floating point equivalent of the reference model whdlofdmrx.slx. the simulink model and matlab floating point equivalent script are compared in the example.

run the ofdmrxrealtimesimulationdisplay.m script to run the receiver.

>> ofdmrxrealtimesimulationdisplay
### starting serial model reference simulation build.
### model reference simulation target for whdlofdmrx is up to date.
build summary
0 of 1 models built (1 models already up to date)
build duration: 0h 0m 0.70282s
 number of header crc failed = 0 per 4
 number of bit errors = 0 per 15208

run the ofdmrxfadingchannelresponsedisplay.m script to run the receiver.

>> ofdmrxfadingchannelresponsedisplay
### starting serial model reference simulation build.
### model reference simulation target for whdlofdmrx is up to date.
build summary
0 of 1 models built (1 models already up to date)
build duration: 0h 0m 0.52644s
 number of header crc failed = 0 per 1
 number of bit errors = 0 per 3162

you can see the constellation plot on the constellation scope. the scopes can be activated by using the control scope button in the whdlofdmreceiver.slx model.

hdl code generation

to generate the hdl code for this example, you must have hdl coder™. use makehdl and makehdltb commands to generate hdl code and hdl testbench for the ofdm receiver subsystem. the testbench generation time depends on the simulation time.

the resulting hdl code is synthesized for a xilinx® zynq®-7000 zc706 evaluation board. the post place and route resource utilization and are shown in the table below. the maximum frequency of operation is 202 mhz.

       resources       usage
    _______________    _____
    slice registers    46642
    slice lut          38457
    ramb36             14   
    ramb18             12   
    dsp48              88   

see also

blocks

  • | | | | |

related topics

网站地图