· web viewrecd = received code word vector plus errors index_of[] = antilog table of gf(2**6)...

141
Simulation Code December 23, 2009 Prepared by: Dr. James Neel Cognitive Radio Technologies, LLC [email protected] 540-230-6012 Prime Contractor: Diversified Technology, Inc Principal Investigator: Bill Bolick Subcontractor: Cognitive Radio Technologies, LLC Subcontract Title: Development of SDR, CR, and Software Controlled Antenna Systems Subcontract #: SCWA 11449 Deliverable 3: Updated Simulation Code

Upload: vuonghanh

Post on 11-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Simulation Code

December 23, 2009

Prepared by: Dr. James NeelCognitive Radio Technologies, LLC

[email protected] 540-230-6012

Prime Contractor: Diversified Technology, IncPrincipal Investigator: Bill Bolick

Subcontractor: Cognitive Radio Technologies, LLCSubcontract Title: Development of SDR, CR, and Software Controlled

Antenna SystemsSubcontract #: SCWA 11449

Deliverable 3: Updated Simulation Code

Page 2:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

TABLE OF CONTENTSChange History...............................................................................................................................ivDocument Scope.............................................................................................................................ivAcronyms........................................................................................................................................iv1 Introduction..............................................................................................................................1

1.1 Modeled system................................................................................................................11.2 Document Organization....................................................................................................3

2 Simulation of FSK PHY..........................................................................................................42.1 Scope.................................................................................................................................42.2 General Simulation Information.......................................................................................5

2.2.1 Data Structures...........................................................................................................52.2.2 System Requirement and Running Environment......................................................52.2.3 General Component Design.......................................................................................52.2.4 Program Flow............................................................................................................6

2.3 Functional Architecture.....................................................................................................62.3.1 System Overview.......................................................................................................62.3.2 Decomposition of Primary AMPS FSK (Data) Blocks.............................................7

2.4 File Listing........................................................................................................................92.5 Build Environment..........................................................................................................102.6 Functional Component Descriptions...............................................................................10

2.6.1 Bit Voter..................................................................................................................102.6.2 BCH Encode / Decode.............................................................................................112.6.3 Channel....................................................................................................................142.6.4 CMA Equalizer........................................................................................................152.6.5 FM Modulator..........................................................................................................162.6.6 Frequency Lock Loop..............................................................................................172.6.7 Initial Frame Synchronization.................................................................................182.6.8 Maintenance Frame Synchronization......................................................................212.6.9 Framing....................................................................................................................222.6.10 Manchester Encoding / Decoding............................................................................242.6.11 Phase Lock Loop (PLL)...........................................................................................26

2.7 System Testing Results...................................................................................................262.8 References.......................................................................................................................29

3 Simulation of FM PHY..........................................................................................................293.1 File Listing......................................................................................................................323.2 General Design Considerations.......................................................................................333.3 References.......................................................................................................................333.4 Routine References.........................................................................................................34

3.4.1 Audio Filter..............................................................................................................343.4.2 Audio Source...........................................................................................................363.4.3 Channelizer..............................................................................................................373.4.4 Compressor / Expander............................................................................................403.4.5 Demodulator............................................................................................................443.4.6 Deviation Limiter.....................................................................................................443.4.7 FM Modulation........................................................................................................453.4.8 Phase Locked Loop..................................................................................................46

ii

Page 3:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

3.4.9 Post Deviation-Limiter Filter...................................................................................523.4.10 Pre-emphasis / De-emphasis....................................................................................543.4.11 SAT Detection / Reception Block...........................................................................583.4.12 SAT / ST Generation...............................................................................................623.4.13 Squelch....................................................................................................................633.4.14 ST Detect.................................................................................................................663.4.15 Upconversion...........................................................................................................67

3.5 Simulation Block References..........................................................................................683.5.1 Forward Link Test (AMPS_forward_link_test.m)..................................................683.5.2 AMPS BS Transmitter (AMPS_BS_TX_PHY_FM.m)..........................................693.5.3 AMPS Mobile System Receiver (AMPS_MS_RX_PHY_FM.m)..........................703.5.4 Channel....................................................................................................................713.5.5 Reverse Test (AMPS_reverse_link_test.m).............................................................733.5.6 AMPS Mobile System Transmitter (AMPS_MS_PHY_TX.m)..............................733.5.7 AMPS Base Station Receiver (AMPS_BS_FM_PHY_RX.m)...............................75

4 SCWA Simulation.................................................................................................................774.1 Modeled System..............................................................................................................774.2 Modeling Considerations................................................................................................78

4.2.1 Modeling Tuner Behavior........................................................................................784.2.2 Antenna Behavioral Modeling.................................................................................80

4.3 File Listing......................................................................................................................814.4 Functional Component Descriptions...............................................................................81

4.4.1 Integrated system.....................................................................................................814.4.2 Antenna model.........................................................................................................824.4.3 Tuner model.............................................................................................................82

4.5 Example simulation results.............................................................................................834.6 References.......................................................................................................................84

5 Link Layer Simulation...........................................................................................................855.1 General Simulation Methodology...................................................................................865.2 Link Layer Overview Communications Channels..........................................................87

5.2.1 The Primary Data Channel......................................................................................875.2.2 The Maintenance Channel.......................................................................................87

5.3 Major node processes......................................................................................................875.4 Handoffs..........................................................................................................................90

5.4.1 Measuring Signal Quality........................................................................................905.4.2 Handoff State Machine............................................................................................915.4.3 The Scanning Process..............................................................................................945.4.4 Rendezvous..............................................................................................................95

5.5 Packet Structure..............................................................................................................955.5.1 Link Payload Packet (LPP)......................................................................................955.5.2 Forward Link Maintenance Packet (FLMP)............................................................965.5.3 Reverse Link Maintenance Packet (RLMP)............................................................97

5.6 File Listing......................................................................................................................985.7 Functional Component Descriptions...............................................................................98

5.7.1 Build_Send_FLMP..................................................................................................995.7.2 Build_Send_LPP......................................................................................................99

iii

Page 4:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

5.7.3 Build_Send_RLMP................................................................................................1005.7.4 Destination Payload Processor..............................................................................1005.7.5 Bit Error Count Filters...........................................................................................1005.7.6 Link Integrity.........................................................................................................1015.7.7 Master / Slave Link Controller..............................................................................1015.7.8 Master / Slave Receive Packet...............................................................................1025.7.9 Master / Slave Rx Link Controller.........................................................................1025.7.10 Master / Slave Send Packet....................................................................................1025.7.11 Master / Slave TX Controller................................................................................1025.7.12 Primary / Scan State Machine................................................................................1035.7.13 Read Config File....................................................................................................1035.7.14 Source Payload Processor......................................................................................1035.7.15 Software Init..........................................................................................................1045.7.16 System State Machine............................................................................................104

Change History12/23/09 Initial Release

Document ScopeThis document reviews the simulation code created as part of the development of the SDR and waveform for the SCWA. It covers the simulation of FM and FSK physical layers, which were based on AMPS physical layer functions (see J. Neel, “Advanced Mobile Phone System (AMPS) Specification Document,” version 1.0 Oct 14, 2008), link layer processes intended to support make-before-break handoffs and HF communications using FlexRadio frontends and HPCS for processing, and behavioral modeling for the SCWA in transmit mode. To gain a complete understanding of the SCWA system, the reader should consult earlier reports. Also note that simulation design and implementation may evolve as prototyping evolves and issues are identified.

AcronymsAMPS Advanced Mobile Phone SystemAPI Application Programming InterfaceARQ Automatic Repeat requestATU Antenna Tuner UnitBCH Bose Chaudhuri Hocquenghem (a forward error correcting code)BS Base StationBSP Board Support PackageCCS TI Code Composer StudioCRT Cognitive Radio Technologies, LLCDMA Direct Memory AccessDSP Digital Signal Processor (Processing)DSP / BIOS TI DSP Basic Input / Output SystemDTI Diversified Technology, IncorporatedEDMA Enhanced Direct Memory Access

iv

Page 5:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

FIFO First In First OutFLL Frequency Lock LoopFLMP Forward Link Maintenance PacketsFM Frequency ModulationFPGA Field Programmable Gate ArrayFRS Family Radio ServiceFSK Frequency Shift KeyingGPP General Purpose ProcessorGUI Graphical User InterfaceHF High Frequency (3 to 30 MHz)HPCS High Performance Computer SystemID IdentifierIDMA Internal Direct Memory AccessISE Xilinx Integrated Software EnvironmentJTAG Joint Test Action GroupLPP Link Payload PacketMPI Message Passing InterfaceMS Mobile StationOS Operating SystemPC Personal ComputerPHY Physical LayerPkt PacketPLL Phase Lock LoopPHY PHYsical layerRCV ReceiveRLMP Reverse Link Maintenance PacketsRF Radio FrequencyRSS Received Signal StrengthRTDX Real Time Data eXchangeRTOS Real Time Operating SystemRX ReceiveSAT Supervisory Audio ToneSCA Software Controlled AntennaSCPI Standard Commands for Programmable InstrumentsSDD Software Design DocumentSDR Software Defined RadioSFF Small Form Factor SDR from LyrtechSMA Surface Mount AssemblySNR Signal-to-Noise RatioSSP Spectrum Signal ProcessingST Signaling ToneTI Texas InstrumentsTX TransmitVAC Virtual Audio Cable

v

Page 6:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

1 IntroductionPhase I of this project developed a FM / FSK simulation and implementation code to support a demonstration of DTI’s software controllable antenna on a single radio (Lyrtech SFF). In Phase II, the waveform is being ported to a multi-radio environment - High Performance Computing System (HPCS) with two FlexRadios – to support a demonstration of HF communications in the HF bands (the SFF had a lower band limit of 200 MHz) with the SWCA. This demonstration will maintain a data link for 24 hours while automatically moving channels with make-before-break handoffs to maintain connectivity as the ionosphere propagation characteristics change during the day. To support the make-before-break handoff requirement and HF operation, we have redesigned the waveform as follows:

Added packet numbers to the data packets and sequence trapping in anticipation of higher layer functionality (ARQ, handoffs)

Received signal strength measurements capability – an earlier SNR capability was implemented for the squelch circuit, but this tied in with the AGC process to estimate signal strength.

Support for multiple (RF) radio chains with mutual control and information sharing between the chains

Adding an auxiliary (scanning) communications channel in addition to the primary (communications) communications channel

Scanning routines to measure channel quality (to guide channel selection in handoffs) A low-bandwidth bursty FSK protocol for link management on the auxiliary channel Support for FlexRadio interface and control Support for HPCS implementation

1.1 Modeled systemThe planned experiment is intended to demonstrate the ability to construct and maintain a reliable long-distance (beyond-the-horizon) communications link in time-varying HF bands. By operating in the HF bands, range can be greatly extended via waveguide effects in the ionosphere. However, these effects vary over time as the solar energy impingent on the earth changes, e.g., due to variances in sun spot activity and the rotation of the earth, so that link propagation characteristics may degrade at one frequency while being enhanced at another frequency. Thus to maintain an uninterrupted stream of communications, it will be necessary to move the link’s operating frequency in response to changing channel conditions.

In the demonstration setup, two communications systems will be used – one stationed in DTI’s facilities in Jackson, MS and another at the end-customer’s premises in Colorado as illustrated in Figure 1. The link will be managed and controlled by the system in Jackson, MS with guidance from the station in Colorado. The system in Jackson, MS will track and store all performance statistics during the demonstration to allow for verification of operation at the end of the 24-hour demonstration. During its operation, it is expected that the communications link’s carrier frequency will need to shift between a 2 MHz band and a 6 MHz band and back again.

1

Page 7:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

Figure 1: An HF communications link will be established and maintained between Jackson, MS and Colorado by leveraging ionospheric propagation effects and high power transmitters.

Each communications system will consist of the following: a High Performance Computing System (HPCS) Two FlexRadio 5000As to facilitate HF communications DTI provided tunable HF antennas Communications software for managing and logging the results of the HF

communications link.

The last (communications system software) is the focus of this effort. The system is made up of two physical full duplex communication links. The primary link carries both payload data and maintenance information. The secondary link scans between the remaining frequency pairs to determine if there is a better choice to become the primary link. Figure 2 shows the functional blocks which make up the FM/FSK data communications system where the Master controller will be based in Jackson and the Slave controller in Colorado. To support two simultaneous links, two FlexRadio 5000As will be needed for each system and two transmit antennas.

Figure 2: Basic components in planned communications system.

2

Page 8:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

1.2 Document OrganizationAs part of the development effort, the blocks shown in Figure 3 have been simulated where the color coding refers to the section in this document where the simulation is discussed. The FM and FSK modems (light red) are discussed in Sections 2 (FSK) and 3 (FM) along with the simulation of various channel models (light red). The antenna behavioral model (grey) is presented in Section 4 and the master and slave processes used for link management (blue) are discussed in Section 5. Each of these sections contains information on the design and execution of the simulated components.

Figure 3: Simulated Components

To access the delivered simulation code, please refer to the following zip files which were included as part of this report.

FM_FSK_SIM.zip => contains FM and FSK code (C / Matlab) used to simulate the PHY SCA_Behavioral_Sim.zip => conains code (Matlab) to simulate the expected behavior

of a tuner / antenna combo in transmit mode HF_link_simulation.zip => contains code (C) used to simulate the link layer operations

for the make-before-break HF link

3

Page 9:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

2 Simulation of FSK PHYIn the first phase, this project developed FM / FSK simulation and implementation code to support a demonstration of DTI’s software controllable antenna. This was originally envisioned as part of a final demonstration intended to be compatible with the unclassified single-channel FM / FSK signals used in SINCGARS, e.g., as used in the Harris RF-5800M-MP Manpack radio. However, because of the current unavailability of an unclassified version of the single-channel, unencrypted SINCGARS standard, the project is proceeding with the AMPS (Advanced Mobile Phone System) standard – an FM/FSK-based cellular standard that may be similar. When an unclassified specification document for SINCGARS becomes available, this document and subsequent work will be revisited.

AMPS is an analog 800 MHz cellular standard first ratified in 1983 (as EIA/TIA-553) to facilitate the use of compatible mobile station (MS) and base station (BS) equipment in the 800 MHz band. It was later amended to support interoperability with other cellular standards and to support E-911 location-based services, with the final revision in 1999 in EIA/TIA-553A. As illustrated in Error: Reference source not found, AMPS connects mobiles ( ) to base stations

(BS) which control the operation of the mobiles. The BSs are connected via the mobile telephone switching office (MTSO) to each other and to the Public Telephone Switched Network (PTSN). The MTSO also controls the operation of the BSs and facilitates handoffs of mobiles between BSs.

BS

BS

BS

MTSO

PTSN

Figure 4: Major components and connections of the AMPS network

This development effort included both a simulation and an implementation phase. The results of the simulation phase were used in the testing of the implementation code. Now, the code implemented and tested on the Lyrtech SFF is being ported and tested for use with FlexRadio 5000A software defined HF radio with all processing to occur on the HPCS. It is expected that the PHY will be modified at a later date to conform to SINCGARS specifications or to a Military standard HF data modem (e.g., MIL_STD-188-110B) though Link layer operations may be preserved.

4

Page 10:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

2.1 ScopeThe AMPS FSK (data) simulation was used to help aid the design of the eventual demonstration by providing a means for refining / evaluating design decisions (filter coefficients, algorithms) and to provide a mechanism for verifying the implementation code (by comparing simulation results with implementation results).

This section reviews the simulation of the AMPS-based FSK PHY, in particular the processes needed to implement simulations of the components that will be used on the “BS” and “MS” in the demonstration experiment for PHY FSK data. It covers the overall functional architecture, the primary functions, the interfaces between those functions, and the expected operation of each function.

2.2 General Simulation Information

2.2.1 Data StructuresAll variables will be vectors/matrices of doubles (Matlab’s native type). The original intent was to use floats in the demonstration, but work transitioned to a fixed point implementation to better model the target platforms and included steps so data-types will have to be recast and steps taken to ensure proper scaling and overflow protection.

No objects will be used in this procedural simulation.

2.2.2 System Requirement and Running EnvironmentProgramming tool: Matlab, C (and compiler)

In theory, since Matlab is an interpretative language and the C code will be compiled on the target platform, the simulation can be executed on any OS. However, it will be developed on a Windows XP platform.

2.2.3 General Component DesignTo simplify the porting process and to increase the fidelity of the modeling, the Matlab components that will be fielded on the radio are coded as Mex files (C code that can be called from within the Matlab environment) and all operations should be written in a procedural format (as opposed to exploiting Matlab’s vector / matrix operators). Thus the PHY and Link layer processes are implemented in C code that can be called from Matlab while the SCWA behavioral model is implemented entirely in Matlab.

5

Page 11:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

Figure 5: General flow for a Mex Function that allows the development effort to use the same C code for both modeling and implementation.

2.2.4 Program FlowThe simulation consists of several different simulations designed to test/validate the behavior of components and to refine the design of the FM voice components and FSK data components as needed. Each simulation is designed to test a component or the interaction of several components and will have a different test script associated with it. A test script is responsible for parameterizing the components, passing the data between the components, and performing the post-processing (e.g., comparing inputs to outputs, aggregating statistics, generating plots) required to complete a test. The test script should log the results and parameters of each test (see Section 2.6.7). These test scripts will implement the test defined in the test specification documents to be developed over the next month as part of the simulation development process.

2.3 Functional Architecture

2.3.1 System OverviewThe simulation is intended to model the physical layer operations of AMPS FSK data communications across various states. There are two links in an AMPS voice system – from BS to MS and from MS to BS and data is transferred over two logical channels – voice and data. Because the SAT tone transmitted by the BS must be looped back from the MS to the BS, an accurate simulation will require both links to be operational as illustrated in Figure 6. In Figure 6, all inputs from the link layer (e.g., setting channel, enabling ST tone) will be treated as a top-level simulation variables and all outputs to the link later as top-level simulation results.

6

Page 12:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

MS RCV MS XMT

BS XMT BS RCV

Channel Channel

Output

Output

Input Source

(Link Layer)

(Link Layer)

(Link Layer)

(Link Layer)

Input Source

SAT

Forward Link Reverse Link

Figure 6: End Simulation System Architecture

However, for purpose of testing and development we will also develop simulations of the Forward Link (BS transmitter to MS receiver), Reverse Link (MS Transmit to BS Receive), and each of the four principle AMPS blocks (BS Transmit, MS Receive, MS Transmit, and BS Receive).

2.3.2 Decomposition of Primary AMPS FSK (Data) BlocksThe following figures show the data flow of the components within each of the primary AMPS FSK voice blocks illustrated in Figure 6 (all except for the channels). Note that many blocks in the BS transmitter are replicated in the MS transmitter and many of the blocks in the BS receiver are replicated in the MS receiver. Functional descriptions of these blocks are given in Section 2.6.

Manchester Encoding / Scale

FM Mod

BS AMPS FSK Transmitter

Modulated Signal

(to Channel)

Word Stream

(From Link Layer)

Carrier

(from Link Layer)

Add FramingControl / Voice

BCH Encode

Upconvert

Frame Select

Figure 7: BS AMPS FSK Transmitter Communications Blocks

7

Page 13:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

FLL

PLL

CMA Equalizer

Symbol Track / DecisionFM Demod

Channelization

MS AMPS FSK Receiver

Sampled Input

(To Link Layer)(from RF)

(From Link Layer)

FrameSynch

BCH Decode

Manchester Decode

Deframe

Bit Vote

Figure 8: MS AMPS FSK Receiver Communications Blocks

Manchester Encoding / Scale

FM Mod

MS AMPS FSK Transmitter

Modulated Signal

Word Stream(from Link Layer)

Add FramingControl / Voice

BCH Encode

Upconvert

Frame Select

Figure 9: MS AMPS FSK Transmitter Communications Blocks

FLL

PLL

CMA Equalizer

Symbol Track / DecisionFM Demod

Channelization

BS AMPS FSK Receiver

Sampled Input

(To Link Layer)(from RF)

(From Link Layer)

FrameSynch

BCH Decode

Manchester Decode

Deframe

Bit Vote

Figure 10: BS AMPS FSK Receiver Communications Blocks

8

Page 14:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

2.4 File ListingThe following gives a listing of the files included in the included release with a brief description of its function. Details on design, use, and testing are given in subsequent sections.

AMPS_MS_RX_PHY_FSK.m PHY FSK block receiver o AMPS_CMA_equalizer.m Restore constant envelopeo AMPS_BS_PLL.m FM demodulation.o AMPS_CMA_equalizer.m Constant Modulus equalizero AMPS_FSK_init_sync.c Achieve initial synchronizationo AMPS_FSK_maint_sync.c Maintain synchronizationo AMPS_FM_demod.m PLL output scalingo AMPS_manchester_decode.c Perform Manchester decodeo AMPS_bch.c Perform BCH decode.o AMPS_bit_voter.c Perform bit voting.o AMPS_fir_filter.c Perform fir filtering.o AMPS_deframer.c De-frame messageso AMPS_correlator_init.c Synch Correlation initialization.o AMPS_rx_PHY.c Main physical layer routineo AMPS_rx_state_machine.c Controls receive processeso AMPS_RX_PHY_FM.c Mex file

AMPS_BS_TX_PHY_FSK.m PHY FSK block transmitter o AMPS_bch.c BCH encodero AMPS_framer.c Frames (FOCC,RECC,FVC,RVC)o AMPS_fm_mod.c FSK modulatoro AMPS_manchester_encoder.c Perform Manchester encodingo AMPS_tx_chan_selects.c Selects channel to frameo AMPS_tx_state_machine.c Controls transmit processeso AMPS_tx_PHY.c Main physical layer routineo AMPS_TX_PHY_FSK.c Mex file

Test scripts and design files o AMPS_link_test.m Forward/Reverse link system testo AMPS_FSK_VC_BER_test.m Collects voice channel BER datao AMPS_FSK_CC_BER_test.m Collects control channel BER datao AMPS_ber_cc.m Displays control channel BER infoo AMPS_ber_vc.m Displays voice channel BER infoo BER_FOCC_curves.m Displays FOCC BER curveso BER_RECC_curves.m Displays RECC BER curveso BER_FVC_curves.m Displays FVC BER curveso BER_RVC_curves.m Displays RVC BER curveso BER_RVC_init_sync_curves.m Displays RVC init synch BER curveo AMPS_BCH_forward_test Tests BCH in forward link in C

9

Page 15:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

o AMPS_BCH_reverse_test Tests BCH in reverse link in C

2.5 Build EnvironmentThe primary Matlab files to begin execution are found in the directory named “AMPS_FSK_BUILD”. The file names are “AMPS_link_test.m” for general testing, and for bit error rate BER testing “AMPS_FSK_VC_BER_test.m” and “AMPS_FSK_CC_BER_test.m”. The receiver and transmitter code is written in a combination of Matlab and C.

To execute C code in a Matlab environment Mex Files are used as an interface between the two languages. The mex files are “AMPS_TX_PHY_FSK.c” and “AMPS_RX_PHY_FSK.c”. The mex files are compiled under Matlab using the “mex AMPS_TX_PHY_FSK.c” or mex “AMPS_RX_PHY_FSK.c” commands. The two BCH tests “AMPS_BCH_forward_test” and “AMPS_BCH_reverse_test” are written in C and found in the directory named “Projects”.

2.6 Functional Component DescriptionsThe following components (functions) are necessary to realize a simulation of AMPS (FSK) data links.

BCH Encode / Decode Bit vote Channel Equalizer (constant modulus) Channel FLL FM Modulator / Demodulator Frame Synchronization Framing Manchester Encoding PLL Symbol Synch / Demodulation

The following gives a brief description of each component (function), its inputs and outputs, and its operation. For relatively simple processes, the operation is described in the following subsections; more complicated processes are referenced to external documents.

2.6.1 Bit VoterThe frame structures of AMPS employ repetition coding in each of the four FSK data channels. The forward control channel (FOCC) contains two words (words A and B), with each word repeating five times. The reverse control channel (RECC) contains up to seven words1 each of which is repeated five (5) times. The reverse voice channel (RVC) contains two words, each repeated five (5) times. The forward voice channel (FVC) contains two words, each word is repeated eleven (11) times.

1 In an variation from the AMPS standard, this implementation uses a fixed, rather than variable number of words, specifically with two words repeated five times instead of 7 words repeated five times. This simplified the implementation as it made all five frame structures similar and allowed for greater code reuse.

10

Page 16:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

The bit voter determines which bits should be passed to the BCH decoder by buffering the repeated words and for each bit of the word, outputting the bits that occur the most frequently (e.g., if 3 words have a 1 and 2 a 0, then a 1 is output).

2.6.1.1 Usagevoid AMPS_bit_voter(int *voter_input_buffer[],

int input_num_repeats, int *rcvr_bit_vector[],

int output_vector_length, int zero_count_vector[])

2.6.1.2 Inputsvoter_input_buffer[] => vector of bits to be voted oninput_num_repeats => number of bits to be voted onoutput_vector_length => length of ouput vector

2.6.1.3 Internal Variablesint i,j ; // general purpose countersint *ptr_input ; // pointer to input vectorint zero_counter ; // counts number of zeros repeatedint bit ; // temporary bit decision register

2.6.1.4 Outputsrcvr_bit_vector[] => vector containing elected bitszero_count_vector[]=> vector containing count of zeros of each elected bit. (used as a signal quality indicator)

2.6.1.5 OperationThis bit voter routine votes on the bits of repeated words and outputs a bit vector containing the elected bits.

This routine counts the number of zeros corresponding to each repeated bit of the received message. The resulting count of zeros is compared with half the number of repeats plus one. If the resulting count is greater, zero is elected; otherwise, a one is elected. The value zero_count_vector [] is passed out of the routine and can be used a signal quality indicator.

2.6.2 BCH Encode / DecodeWords transmitted digitally are formed by encoding the content bits into systematic linear block code implemented as a BCH code with a Hamming distance of 5. The generator polynomial for this BCH code is given by .

12 10 8 5 4 3 0bG x x x x x x x x

When formed into words for transmission, the left-most bits (earliest in time) are treated as content bits and the 12 right-most bits as parity bits with the left-most bit as the most significant bit. For the reverse voice and control channels, 36 content bits are encoded by this polynomial to create a (48, 36; 5) BCH code; for the forward voice and control channels, 28 bits are used to create a (40, 36; 5) BCH code.

11

Page 17:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

2.6.2.1 UsageMultiple functions are employed for this process. See Section 2.6.2.5 (Operation) for more details.

2.6.2.2 Inputs

The first function:read_p((int*)p); /* read generator polynomial g(x) */ Inputs: None

The second function:generate_gf((int) n, (int) m, (int*)p, (int*)index_of, (int*)alpha_to); /* generate the Galois Field GF(2**m) */Inputs: n code word length

m order of the field GFp(x) primitive polynomial

The third function:gen_poly((int) n,(int) k,(int) d,(int*)g,(int*) index_of,(int*) alpha_to); /* Compute the generator polynomial of BCH code */Inputs: index_of[] = antilog table of GF(2**6)

alpha_to[] = log table of GF(2**6)

The fourth function:encode_bch((int)n, (int)k, (int*)data, (int*)bb); /* encode data */Inputs: n = code length

k = n - deg(g(x)) = data bit length data[] = coefficients of data polynomial, i(x)

The fifth function:decode_bch((int)n, (int)k, (int*)recd, (int*) index_of, (int*), (int*) alpha_to &num_errors);Inputs: n = code length

k = n - deg(g(x)) = data bit lengthrecd = received code word vector plus errorsindex_of[] = antilog table of GF(2**6)alpha_to[] = log table of GF(2**6)

2.6.2.3 Internal Variables

m = order of the field GF(2**6) = 6n = length t = 2 = error correcting capability d = 2*t + 1 = 5 = designed minimum distance k = n - deg(g(x)) = 36 = dimension p[] = coefficients of primitive polynomial used to generate GF(2**6)g[] = coefficients of generator polynomial, g(x)alpha_to [] = log table of GF(2**6) index_of[] = antilog table of GF(2**6)data[] = coefficients of data polynomial, i(x)bb[] = coefficients of redundancy polynomial (x**(12) i(x)) modulo g(x)numerr = number of errors

12

Page 18:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

errpos[] = error positions recd[] = coefficients of received polynomial

2.6.2.4 Outputs

The first function:read_p((int*)p); /* read generator polynomial g(x) */ Outputs: p=> polynomial g(x)

The second function:generate_gf((int) n, (int) m, (int*)p, (int*)index_of, (int*)alpha_to); /* generate the Galois Field GF(2**m) */Outputs: index_of[] => antilog table of GF(2**6)

alpha_to[] => log table of GF(2**6)

The third function:gen_poly((int) n,(int) k,(int) d,(int*)g, (int*) index_of, (int*) alpha_to); /* Compute the generator polynomial of BCH code */Outputs: g[] => generator polynomial

The fourth function:encode_bch((int)n, (int)k, (int*)data, (int*)bb); /* encode data */Outputs: bb[] => redundency bits

The fifth function:decode_bch((int)n, (int)k, (int*)recd, (int*) index_of, (int*) alpha_to, (int*) &num_errors);Outputs: recd => decoded code word

num_errors => number of errors detected and corrected.

2.6.2.5 Operation

In this specific case, there is no need to use the Berlekamp-Massey algorithm, since the error locator polynomial is of at most degree 2. Instead, in the case of two errors, two simultaneous equations are simply solved to give the coefficients of the locator polynomial. In the case of one error, the location is given by the first syndrome. There are five functions which make up the AMPS BCH encode/decode operation. The simulation code is written in the C programming language.

The first function:read_p((int*)p); /* read generator polynomial g(x) */ The function reads the polynomial of degree 6 and returns the result in p(x).

The second function:generate_gf((int) n, (int) m, (int*)p, (int*)index_of, (int*)alpha_to); /* generate the Galois Field GF(2**m) */The function generates the Galois Field GF(2m) from the irreducible polynomial p(x) in p[0]… p[m]. The first generated lookup table alpha_to[] contains the elements alphai in polynomial form. The second lookup index_of[] uses alpha_to[] as and index to recover the primitive elements of alphai.

13

Page 19:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

The third function:gen_poly((int) n,(int) k,(int) d,(int*)g, (int*) index_of, (int*) alpha_to); /* Compute the generator polynomial of BCH code */This function computes the generator polynomial for the BCH code.

12 10 8 5 4 3 0bG x x x x x x x x

The generator polynomial given above generates a full length (n, k,t) code of (63,51,2). The value 63 indicates the code word length. The value 51 indicates message length and the value 2 indicates an error correction capability of two bits. The full length code word is shortened to 48 bits in the reverse channel and 40 bits in the forward channel.

The fourth function:encode_bch((int)n, (int)k, (int*)data, (int*)bb); /* encode data */This function encodes the code word to be transmitted.

The fifth function:decode_bch((int)n, (int)k, (int*)recd, (int*) index_of, (int*) alpha_to, (int*) &num_errors);This function decodes the generated code word.

2.6.3 ChannelThe channel block is intended to model the processes that the signal undergoes from transmission to reception. This block models various channel conditions. The first is signal plus Gaussian white noise (AWGN). The second is a faded signal with a line-of-site from transmitter to receiver plus Gaussian white noise (Ricean). The third is a faded signal with no line-of-site plus Gaussian white noise (Rayleigh). The fading is caused by movement of the receiver with respect to the transmitter. The Matlab Communications Toolbox must be installed for fading channel operation. If the toolbox is not installed the block implements an AWGN channel

2.6.3.1 Usage%USAGE: [out_msg] = AMPS_forward_channel(msg, model_name, SNR, Fs, fd)

2.6.3.2 Inputsmsg => input signalmodel_name => channel model name, AWGN, Ricean, Rayleigh (or any other known channel)SNR => output SNRFs => sampling ratefd => absolute value of doppler shift

2.6.3.3 Internal VariablesNone

2.6.3.4 Outputsout_msg => message out of channel (to receive antenna / ADC)

14

Page 20:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

2.6.3.5 OperationThe channel block will model AWGN (LoS) and Rayleigh channels, and varying multipath and Doppler shifts. Since the channel is not an implemented block on the SDR, the simulation block can be implemented using Matlab functions.

This reused the channel coded for the FM simulation. [AMPS_FM]

2.6.4 CMA EqualizerMultipath components can significantly reduce the performance of a communications link. Since FM (and FSK) is a constant amplitude signal, the effect of multipath can be undone by using a blind constant-modulus algorithm (CMA) to adjust a receive filter’s taps to “undo” the effect of the channel. In reality, the CMA equalizer has no actual knowledge of the channel taps; rather it attempts to minimize an error signal defined as the time difference between the filtered signal’s amplitude.

2.6.4.1 Usage%USAGE: [I_msg_out,Q_msg_out] = AMPS_CMA_equalizer(I_msg,Q_msg)

2.6.4.2 InputsI_msg => inphase input messageQ_msg => quadraphase input message

2.6.4.3 Internal VariablesFc => carrier frequencyFs => sampling rateCMA_I_states=> inphase input signal bufferCMA_Q_states=> quadraphase input signal bufferCMA_I_taps => inphase equalizer channel tapsCMA_Q_taps => quadraphase equalizer channel tapsCMA_length => length in samples of the equalizerstep_size => equalizer tap adaptation rate

2.6.4.4 OutputsI_msg_out => equalized inphase out message Q_msg_out => equalized quadraphase output message

2.6.4.5 Operation

The objective of CMA is to restore the faded signal output ( )y n to a constant envelope signal on average. This is accomplished by adjusting the weight vector ( )taps n to minimize the cost function J given by:

( ) [|| ( ) | 1| ]p qpqJ n E y n

In this application p and q are set to (1,2) for high noise tolerance and increased stability. From the above cost function the following equations may be obtained.

15

Page 21:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

1

0

( ) ( )* ( )N

i

y n taps i X n i

*( 1) ( ) * ( )* ( )taps n taps n n X n

( ) ( ) ( ) / | ( ) |n y n y n y n

Where:( )y n => faded signal restored to constant envelope.

=> tracking adaptation rate. ( )n => error signal.

*( )X n => complex conjugate of input signal.( )taps n => CMA filter coefficients.

( )X n => faded input signal.

Equation 3 shows the finite response filter which restores the faded input ( )X n to a constant modulus signal ( )y n . Equation 4 shows the coefficient update equation and Equation 5 shows the error calculation ( )n . The equalizer implementation is written using complex numbers.

0 1 2 3 4 5 6 7 8

x 105

-4

-2

0

2

4Channel Signal

0 1 2 3 4 5 6 7 8

x 105

-4

-2

0

2

4CMA Equalized Signal

Figure 11: CMA Equalizer Output

Figure 11 shows the CMA equalizer output in a Ricean fading channel. The CMA equalizer attempts to restore the constant envelopment of the transmitted signal.

2.6.5 FM ModulatorThe FM modulator modulates the phase of the RF carrier with the as shown in where is the index of modulation, m(t) is the message signal, fc is the RF carrier frequency.

cos 2FMcS t A f t m t

16

Page 22:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

2.6.5.1 UsageAMPS_FM_mod((int) AMPS_number_bits_to_process,

(int*)&manchester_encoded_vector[0],(double*)&FM_modulated_samples[0]) ;

2.6.5.2 Inputs

Inputs: manchester_encoded_vector => input message to modulateAMPS_number_bits_to_process=> bits remaining to modulate

2.6.5.3 Internal Variables

Fc => carrier frequencyFs => Sampling ratefreq_dev => deviation frequencyphase => phase of modulator

2.6.5.4 Outputs

Output: FM_modulated_samples => modulated FM waveform

2.6.5.5 OperationThis function is the same one as used in the FM simulation. [AMPS_FM] The input is the output of the Manchester encoding module .

2.6.6 Frequency Lock LoopWhile higher-order Phase Lock Loops (PLL)s can also perform frequency lock, PLLs have a limited pull-in range and higher-order PLLs are less stable. To address this issue (particularly for hopping systems), a separate loop can be used to correct frequency offset errors.

A simple way to do this is to put two filters where the transition bands of the received signal is expected to lie as shown in Figure 12. Energy levels are evaluated for the two filters where a higher energy level implies the filter is closer to the carrier and a lower energy level implies the filter is further from the carrier. Evaluating the difference between the two filter energy estimations can then be used to increase or decrease the estimation of the carrier.

Signal

Low Filter High FilterFigure 12: : Conceptual Filter Location of a FLL

For signals with symmetric transition bands, the filters should have an equal offset from the carrier; for asymmetric transition bands, the filters could be spaced differently or could have

17

Page 23:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

their energy levels scaled. It will be needed to identify the exact spacing / scaling factors for the filters.

2.6.6.1 UsageNot currently implemented

2.6.6.2 Inputs(double vector) samples from channelizer

2.6.6.3 Internal VariablesFilter stateCarrier estimate

2.6.6.4 Outputs(double vector) samples modulated at the carrier frequency

2.6.6.5 OperationA simple difference between filter power levels run at a downsampled rate and controls the frequency of the channelizer.

2.6.7 Initial Frame SynchronizationThe goal of the frame synchronization routine is to correlate the known dotting sequence and the synchronization word sequences against the incoming signal to identify the correct beginning location of a received message. There are two types of frame synchronization which must be accomplished: initial synchronization (acquisition) and maintenance synchronization. Initial frame synchronization is the process of correlating with the dotting and synchronization word sequences before the signal has been previously acquired. Equation shows the correlation.

( ) ( )* ( )i

y n coef i x n i

Where:( )y n => output correlation and the current sample time.

n => current sample time. i => correlation sample index.

( )coef i =>coefficients of the correlation sequence.

The initial synchronization sequence for the FOCC is the Manchester encoded 10 bits of dotting and 11 bits of word sync. The resulting Manchester encoded sequence is twice the sum of the bit length (42 samples long). The initial synchronization sequence for RECC is the Manchester encoded 30 bits of dotting and 11 bits of word sync. The resulting Manchester encoded sequence is 84 samples long. The initial synchronization sequence for FVC and RVC is the Manchester encoded 101 bits of dotting and 11 bits of word sync. The resulting Manchester encoded sequence is 224 samples long.

18

Page 24:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

Maintenance synchronization (tracking) is discussed as a separate routine in Section 2.6.8.

2.6.7.1 Usageint initial_sync_correlator(double in_sample,

double in_sample_soft_buf[], int in_sample_hard_buf[] ,

int *numOfMatches, double *sum_correlation,

int init_sync_corr_length)

2.6.7.2 Inputs

in_sample => input sample from PLL.init_sync_corr_length = > length in manchester samples of the correlation sequence.

2.6.7.3 Internal Variables double initial_soft_correlation_buf[]; //soft bit corr patternInt initial_hard_correlation_buf[]; //hard bit corr pattern

2.6.7.4 Outputsinput_sample_ptr => ptr to the position of maximum correlation against the synchronization sequence.

2.6.7.5 OperationThe basic operation will be a correlation search over the sequence of half-symbols from the symbol synchronization routine against the dotting and word sequence. Two types of correlation will be used. The output of a soft bit correlation will compared with a fixed threshold to find a possible initial synchronization sequence candidate. The detected candidate must be then validated using the hard bit correlation. The hard bit correlation counts the number of hard bit matches and compares the result against the desired correlation sequence. If the number of matches exceeds the threshold initial synchronization is declared.

19

Page 25:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

Figure 13: : Soft Correlation Output

Figure 13 shows the output of a soft correlation. The point of maximum energy is the position of initial synchronization (sample 1060).

Figure 14: Soft Correlation Output

Figure 14 shows the output of a hard bit correlation over the RVC frame at high signal to noise. The point having the maximum number of matches against the synchronization sequence is the position of initial synchronization. The maximum number of matches is equal to the length of the correlation pattern (dotting = 101 +synch word = 11) times two for Manchester encoding (224 at sample number 1060). The nine smaller peaks are equal to the shorter synchronization patterns in the RVC frame (dotting =37 + synch word= 11) times two for Manchester encoding (96 samples).

20

Page 26:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

Figure 15: Soft Correlation Output

A test is run by continuously reacquiring initial synchronization on the first frame. Figure 15shows a bit error rate comparison of data contained in the first frame assuming perfect initial synchronization verses achieving initial synchronization using the correlation algorithm. The plot above was generated using the Matlab script “BER_RVC_init_sync_curves.m”.

2.6.8 Maintenance Frame SynchronizationThe goal of the maintenance frame synchronization routine is to correlate the dotting sequence and the word sequence against the incoming signal to detect whether or not the sample of peak energy has changed. A change in sampling time could occur because of a difference in reference clocks between the transmitter and the receiver. Should the maintenance correlation detect more energy at an adjacent sample position it will add or subtract a sample position from the counter and then point to the new sample of peak energy.

2.6.8.1 UsagemaintenanceSync((double)in_sample,

(int) &inputSamplePtr,(int) maint_sync_window_ctr,(int) &first_sync_maint_pass,(int) maint_sync_corr_length) ;

2.6.8.2 Inputs

in_sample => input sample from PLL maint_sync_corr_length = > length in manchester samples (2*bit_lenth of the correlation sequence)

2.6.8.3 Internal VariablesNone

2.6.8.4 Outputs

input_sample_ptr => ptr to the position of maximum correlation against the synchronization sequence.

21

Page 27:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

2.6.8.5 OperationThe basic operation will be a correlation search over the sequence of Manchester half-symbols from the symbol synchronization routine against the dotting and word sequence.

This function implements a multiphase correlation. The number of phases are equal to the over sampling rate of each Manchester sample which in this case is five.

( ) ( )* ( )

i

y n coef i x n i

Where:( )y n => output correlation and the current sample time.

n => current sample time. (range 1 thru 5) i => correlation sample index. 2*(length of dotting +synch word)

( )coef i =>coefficients of the correlation sequence.

The function maintains a counter of each sample in the frame to determine the next expected position of maximum correlation. Upon counting down to the expected next position of maximum correlation, the function compares the soft correlation output of each phase of the multiphase correlation. The position of maximum correlation is selected as the optimum sample for bit detection. In addition to the above algorithm, frame to frame averaging of the five correlation phase outputs provides more robust performance in a fading environment. The equation for the leaky integration is shown below.

( ) (1 )* ( 1) * ( )y n y n x n

Where: ( )y n =>represents an averaged phase correlation output.n =>The value range of 1 thru 5 corresponds to each possible phase output. =>integration time constant. ( )x n( )x n =>phase correlation output.

2.6.9 FramingDifferent frame structures are used for the four (4) logical channels (forward voice, reverse voice, forward control, and reverse control). Each of these frames has a different structure and includes synchronization information and an effective repetition code of the transmitted words.

For example the Reverse Voice Channel (RVC) data is formatted using the frame shown in Figure 16 where the dotting sequence is 37 bits of the form (101010…101) and the word

22

Page 28:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

sequence (WS) is the 11-bit word (11100010010). Note that a single frame is repeated 5 times with the second word formed in the same format as the first word.

Figure 16: RVC Frame. From Figure 2.7.2-1 in [AMPS_99]

2.6.9.1 UsageThe prototype for the forward control channel framing function is below.AMPS_focc_frame((FOCC_MESSAGE*) &AMPS_focc_cmd,

(AMPS_FRAME*) AMPS_frame_contents) ;

The prototype for the reverse control channel framing function is below.AMPS_recc_frame((RECC_MESSAGE*) &AMPS_recc_cmd,

(AMPS_FRAME*) AMPS_frame_contents) ;

The prototype for the forward voice channel framing function is below.AMPS_fvc_frame((FVC_MESSAGE*) &AMPS_fvc_cmd,

(AMPS_FRAME*) AMPS_frame_contents) ;

The prototype for the reverse voice channel framing function is below.AMPS_fvc_frame((RVC_MESSAGE*) &AMPS_rvc_cmd,

(AMPS_FRAME*) AMPS_frame_contents) ;

2.6.9.2 InputsThe first function:AMPS_focc_frame( FOCC_MESSAGE *AMPS_focc_cmd,

AMPS_FRAME *AMPS_frame_contents) ;Inputs: AMPS_focc_cmd structure containing message information.

The second function:AMPS_fvc_frame( FVC_MESSAGE *AMPS_fVc_cmd,

AMPS_FRAME *AMPS_frame_contents) ;Inputs: AMPS_fvc_cmd structure containing message information.

The third function:AMPS_recc_frame( RECC_MESSAGE *AMPS_recc_cmd,

AMPS_FRAME *AMPS_frame_contents) ;Inputs: AMPS_recc_cmd structure containing message information.

23

Page 29:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

The fourth function:AMPS_rvc_frame( RVC_MESSAGE *AMPS_rvc_cmd,

AMPS_FRAME *AMPS_frame_contents) ;Inputs: AMPS_rvc_cmd structure containing message information.

2.6.9.3 Internal Variablesint dotting[] = {1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1};// dotting int sync_word[]={1,1,1,0,0,0,1,0,0,1,0}; // sync wordint busy_idle ;// used in FOCC to flag ReCC availability

2.6.9.4 OutputsThe first function:AMPS_focc_frame( FOCC_MESSAGE *AMPS_focc_cmd,

AMPS_FRAME *AMPS_frame_contents) ;Outputs: AMPS_FRAME *AMPS_frame_contents.

The second function:AMPS_fvc_frame( FVC_MESSAGE *AMPS_fVc_cmd,

AMPS_FRAME *AMPS_frame_contents) ;Outputs: AMPS_FRAME *AMPS_frame_contents.

The third function:AMPS_recc_frame( RECC_MESSAGE *AMPS_recc_cmd,

AMPS_FRAME *AMPS_frame_contents) ;Outputs: AMPS_FRAME *AMPS_frame_contents.

The fourth function:AMPS_rvc_frame( RVC_MESSAGE *AMPS_rvc_cmd,

AMPS_FRAME *AMPS_frame_contents) ;Outputs: AMPS_FRAME *AMPS_frame_contents.

2.6.9.5 OperationEach of the framing function builds the corresponding frame in an unpacked format.

2.6.10 Manchester Encoding / DecodingNon-return to zero (NRZ) data are encoded using Manchester encoding such that each NRZ one is transformed to a one-to-zero transition and each NRZ zero is encoded as a zero-to-one transition. The bits encoded by the Manchester encoding need to be modified such that the modulation applied to transmitter carrier results in a direct binary frequency shift keying (BFSK) signal where a one into the modulator corresponds to a nominal peak frequency deviation of 8 kHz above the carrier and a zero to 8 kHz below the carrier frequency.

2.6.10.1UsageEncoder:Functions: AMPS_manchester_encode(AMPS_FRAME*AMPS_frame_contents,

int *AMPS_position_in_frame, int AMPS_number_bits_to_process*2*5,

24

Page 30:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

double *manchester_encoded_vector[]);

Decoder:Functions: AMPS_manchester_decode(int *manchester_encoded_vector[], int *bit_vector[], int output_vector_length)

2.6.10.2InputsEncoder: AMPS_frame_contents => contains input bits to encodeAMPS_position_in_frame => contains pointer to next bit to processAMPS_number_samples_to_process => length(num_bits*2*upsample_rate)

Decoder: manchester_encoded_vector => vector containing encoded bitsoutput_vector_length => number of output bits to decode

2.6.10.3Internal VariablesEncoder:int input_vector_length ; // length of data bits to encodeint *ptr ; // pointer to output vector of encoded bits

Decoder:int i ; // general counterint *ptr_input ; // pointer to manchester encoded vector inputint *ptr_output; // pointer to decoded bit vector

2.6.10.4OutputsEncoder:manchester_encoded_vector => vector containing encoded bits upsampled by five and deviation scaled.

Decoder:bit_vector => contains decoded output bits.

2.6.10.5 OperationEncoding is a straight-forward process, but its output sampling rate and amplitude should match that of the FM modulator. Accordingly, the Manchester encoding function performs the following tasks: Manchester encoding, upsampling by five, and deviation scaling. The length of the output vector is equal to the number of bits to encode times 2 (from Manchester encoding) times 5 (up sample rate before modulation).

Decoding requires help from frame synchronization to ensure proper alignment of Manchester encoded symbols.

25

Page 31:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

2.6.11 Phase Lock Loop (PLL)While the FLL will remove much of the RF carrier, this is a very coarse process (though very useful for initial carrier acquisition). A finer estimation / carrier recovery process can be performed by following an FLL with a PLL.

A PLL is used to recover (and remove) the carrier frequency (and phase) of an incoming signal. It will be important for proper coherent recovery of FSK and is used to demodulate FM (with the phase estimation “errors” being the message signal).The PLL design is described in the document “Advanced Mobile Phone System (AMPS) FM Simulation” [AMPS_FM].

2.6.11.1Usage[phase_diff] = AMPS_PLL(msg, Fc, Fs, enable_bits)

2.6.11.2Inputsmsg => input message to modulate

2.6.11.3Internal Variablesptr_signal_output_vector=> pointer to output demodulated signal vector.hilbert_buf[] =>hilbert transform filter data buffer.delay_buf[] =>inphase data buffer.msg_I_vector[]=>inphase component of the message.msg_Q_vector[]=>quadraphase component of the message.est_I =>Current inphase phase carrier estimate.est_Q =>Current quadraphase phase carrier estimate.real_val =>Baseband inphase message value.imag_val =>Baseband quadraphase message value.phase_acc =>Phase accumulator value.phase_err =>Phase error value.LF_acc =>Loop Filter Integration Accumulator.

2.6.11.4OutputsPhase_diff => demodulated message

2.6.11.5OperationThis will reuse the code from the FM simulation. [AMPS_FM]

2.7 System Testing ResultsThe simulation results for each of the four data channels are shown in a series of bit error rate (BER) plots. This simulation is an end-to-end test which exercises both the transmitter and receiver code builds. In the transmitter, the message bits are BCH encoded, inserted in the selected frame format, Manchester encoded, and then FM modulated. In the receiver, the signal is demodulated, bit voted, BCH decoded and the original message recovered. The Matlab scripts used to collect data for these plots are “AMPS_FSK_VC_BER_test.m” and “AMPS_FSK_CC_BER_test.m”. The Matlab scripts used to display the BER plots are “BER_RECC_curves.m”, “BER_FOCC_curves.m”, “BER_FVC_curves.m”, and “BER_RVC_curves.m”. Each plot shows the BER performance in a Gaussian white noise

26

Page 32:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

environment. There are five curves on each of the plots. The curve labeled “raw bits” shows the BER performance including all of the detected bits (e.g. dotting, synchronization word and message) at the output of the PLL without and channel coding. The curve labeled “message bits voting BCH” shows the expected performance in the system with both voting and BCH channel coding. The curve labeled “no voting BCH” shows the improvement in performance with only the BCH channel coding. The curve labeled “message bits no voting no BCH” shows the performance of the detected message bits with no channel coding. The curve labeled “message bits voting no BCH” shows the improvement in performance of the detected message bits with voting but no BCH.=

The first channel shown is the reverse control channel (RECC). The curves for the BER RECC are show below.

Figure 17: RECC BER curves

The second channel shown is the reverse control channel (FOCC). The curves for the BER of FOCC are show below.

27

Page 33:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

Figure 18: FOCC BER curves

The third channel shown is the reverse control channel (FVC). The curves for the BER of FVC are show below.

Figure 19: FVC BER curves

The fourth channel shown is the reverse control channel (RVC). The curves for the BER of RVC are show below.

28

Page 34:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

Figure 20: RVC BER curves

2.8 ReferencesThe following documents are used as sources of information when using this test plan.

[AMPS_SDD] J. Neel, “Advanced Mobile Phone System (AMPS) Specification Document,” version 1.0 Oct 14, 2008.

[AMPS_FM] J. Neel, “Advanced Mobile Phone System (AMPS) FM Simulation,” v 1.0, Dec 12, 2008.

[AMPS_99] TIA/EIA-553-A “Mobile Station – Base Station Compatibility Standard,” November 1999.

3 Simulation of FM PHYAs described in (J. Neel, “AMPS FM (Voice) Simulation Design Document,” version 1.0 Oct 22, 2008.), the simulation was initially intended to model the physical layer operations of AMPS FM voice in the Conversation state as a first step towards SINCGARS. Currently, the FM voice application has been implemented on the Lyrtech SFF and is being ported to the FlexRadio solution.

There are two links in an AMPS voice system – from BS to MS and from MS to BS. Because the SAT tone transmitted by the BS must be looped back to the MS to the BS, an accurate simulation will require both links to be operational as illustrated in Figure 6. In Figure 6, all inputs from the link layer (e.g., setting channel, enabling ST tone) will be treated as a top-level simulation variables and all outputs to the link later as top-level simulation results.

29

Page 35:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

MS RCV MS XMT

BS XMT BS RCV

Channel Channel

Output

Output

Input Source

(Link Layer)

(Link Layer)

(Link Layer)

(Link Layer)

Input Source

SAT

Forward Link Reverse Link

Figure 21: End Simulation System Architecture

However, for purpose of testing and development we will develop simulations of the Forward Link (BS transmitter to MS receiver), Reverse Link (MS Transmit to BS Receive), and each of the four principle AMPS blocks (BS Transmit, MS Receive, MS Transmit, and BS Receive).

The following figures show the data flow of the components within each of the primary AMPS FM voice blocks illustrated in Figure 6 (all except for the channels) as originally designed. Note that many blocks in the BS transmitter are replicated in the MS transmitter and many of the blocks in the BS receiver are replicated in the MS receiver.

Pre-emphasis

Compressor

DeviationLimiter

PostDeviationFilter

SAT Generation

FM Mod

BS AMPS FM Transmitter

Sampled Voice Input

Modulated Signal (to Channel)

Enable(from Link Layer)

(From Link Layer)Carrier

Figure 22: BS AMPS FM Transmitter Communications Blocks

30

Page 36:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

De-emphasis

Expander

FLL

PLL

CMA Equalizer

Squelch

SAT Reception

SAT Signal Strength

FM Demod

Channelization

MS AMPS FM Receiver

Sampled Input

(To MS Transmitter)

(To Link Layer)

(from RF)

Audio Output(to speaker)

(From Link Layer)

Figure 23: MS AMPS FM Receiver Communications Blocks

Pre-emphasis

Compressor

DeviationLimiter

PostDeviationFilter

ST Generation

SAT Generation

FM Mod

MS AMPS FM Transmitter

Sampled Voice Input

Modulated Signal (to Channel)

TranspondedSAT Tone

(from Mobile FM Receiver)

Enable(from Link Layer)

(From Link Layer)Carrier

Figure 24: MS AMPS FM Transmitter Communications Blocks

De-emphasis

Expander

FLL

PLL

CMA Equalizer

Squelch

SAT Reception

SAT Signal Strength

FM Demod

Channelization

BS AMPS FM Receiver

Sampled Input

(To Link Layer)

(from RF)

Audio Output(to speaker)

(From Link Layer)

ST Reception

(To Link Layer)

Figure 25: BS AMPS FM Receiver Communications Blocks

31

Page 37:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

3.1 File ListingThe following gives a listing of the files included in the initial release with a brief description of its function. Details on design, use, and testing are given in subsequent sections.

AMPS_BS_RX_PHY_FM.m BS PHY FM block receiver o AMPS_BS_audio_filter.m Separate audio from SAT / STo AMPS_BS_channelizer.m Digital down conversiono AMPS_BS_CMA_equalizer CMA equalizero AMPS_BS_De_emphasis.m De-emphasis filtero AMPS_BS_expander.m Expandero AMPS_BS_PLL.m Phase-locked loopo AMPS_BS_SAT_block.m SAT recover / detecto AMPS_BS_ST_detect.m Detect ST

AMPS_BS_TX_PHY_FM.m BS PHY FM block transmitter o AMPS_BS_compressor.m 2:1 Syllabic compressoro AMPS_BS_deviation_limiter.m Deviation o AMPS_BS_FM_Mod.m FM Modulatoro AMPS_BS_gen_SAT.m SAT generatoro AMPS_BS_post_limit_filter.m Post deviation-limiter filtero AMPS_BS_Pre_emphasis.m Pre-emphasis filtero AMPS_BS_upconvert Upconvert carrier

AMPS_MS_RX_PHY_FM.m BS PHY FM block receiver o AMPS_MS_audio_filter.m Separate audio from SAT / STo AMPS_MS_channelizer.m Digital down conversiono AMPS_MS_CMA_equalizer CMA equalizero AMPS_MS_De_emphasis.m De-emphasis filtero AMPS_MS-FM_demodulate.m Remove frequency scalingo AMPS_MS_expander.m Expandero AMPS_MS_PLL.m Phase-locked loopo AMPS_MS_SAT_block.m SAT transponder / detect

AMPS_MS_TX_PHY_FM.m BS PHY FM block transmitter o AMPS_MS_compressor.m 2:1 Syllabic compressoro AMPS_MS_deviation_limiter.m Deviation o AMPS_MS_FM_Mod.m FM Modulatoro AMPS_MS_gen_ST.m ST generatoro AMPS_MS_post_limit_filter.m Post deviation-limiter filtero AMPS_MS_Pre_emphasis.m Pre-emphasis filtero AMPS_MS_upconvert Upconvert carrier

Support scripts o calculate_chan_freq.m return frequency for chan #

32

Page 38:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

o gen_audio_source.m sampled audio (file or random)o has_toolbox.m check if Matlab has a toolbox o link_plots.m Time and frequency domain + erroro scale_phase.m phase => [0 2)o rockytop.wav sample 8 ksps audio file

Test scripts and design files o AMPS_forward_link_test.m Forward link system testo AMPS_reverse_link_test.m Reverse link system testo AMPS_errr.m FM MSE estimateo Channelizer_test.m Channelizer / upconverter testso Compressor_test.m compressor / expander testo Dev_filter_design.m post deviation limiter filter designo Eval_Carson_BW.m An FM modulation testo Eval_peak_nominal_deviation.m Verifying peak nominal deviationo FM_demod_test.m Modulation / demodulation testo FM_modulate_test.m Simple modulation comparisono gen_SAT_test.m verify generation of SATo PLL_design.m initial parameter selection / testo post_filter_test .m Post-deviation limit filter testo pre_emp_design.m Pre-emphasis filter designo squelch_filter_design.m squelch designo squelch_test.m squelch test

3.2 General Design ConsiderationsThe following general design considerations are made in the simulation:

All functions are implemented to process blocks of samples rather than individual samples (as is done in some sample-based simulations) or calling each block once with the entire set of simulation samples. This reduces execution time for simulation and implementation, will be more in line with how the system will need to be implemented (buffered samples), and will be critical for proper modeling of interactions between layers.

To facilitate block processing, routines store internal states between calls (e.g., filter states, phases in tone generators).

Since the design will likely need to change in several ways as the implementation platform is defined (e.g., block size based on DMA buffer and sampling rates) and as we transition to SINCGARS-lite (e.g., modulation index, compressors / expanders), routines are designed such that changes in major design decisions automatically update the processing of each routine. The exception to this principle is automatic filter generation which could significantly slow down the simulation.

All routines are currently implemented as .m files. These were transitioned to mex files (C-code called from within Matlab) as part of the implementation process to provide another means of code verification (C-code should be sample-for-sample equivalent to Matlab for identical inputs).

33

Page 39:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

3.3 ReferencesThe following documents are used as sources of information when using this test plan.

J. Neel, “Advanced Mobile Phone System (AMPS) Specification Document,” version 1.0 Oct 14, 2008.

J. Neel, “AMPS FM (Voice) Simulation Design Document,” version 1.0 Oct 22, 2008. TIA/EIA-553-A “Mobile Station – Base Station Compatibility Standard,” November

1999. IEEE 829-1983 “IEEE Standard for Software Test Documentation,” March 21, 1991.

3.4 Routine ReferencesThe following covers the use, design, and test results for each of the routines called by the MS and BS transmitters and receivers. Since many routines are reused between the BS and the MS, they are only discussed once. When there are differences between the implementations, those differences are noted.

3.4.1 Audio FilterThe audio filter is intended to remove the higher frequency components on the audio branch after FM demodulation (see below).

De-emphasis

Expander

FLL

PLL

CMA Equalizer

Squelch

SAT Block

FM Demod

Channelization

MS AMPS FM Receiver

Sampled Input

(To Link Layer)

(from RF)

Audio Output(to speaker)

(From Link Layer)

Audio Filter

Figure 3-26: Audio filter location in a receiver

3.4.1.1Usage%AMPS_MS_audio_filter%%Filters out components above 4 kHz (e.g., SAT tones) from audio branch%Assumes sampling rate of 30 kHz%%USAGE: [out_sig, out_states] = AMPS_MS_audio_filter(msg, in_states)% msg => demodulated message% [optional] in_states => internal filter states%% out_sig => output signal% [optional] out_states => internal states

34

Page 40:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

3.4.1.2Design ConsiderationsThe output of the FM demodulator / PLL is sampled at 30 ksps (for better tracking performance) with subsequent branches designed to be sampled at the same rate. Because the phase and amplitude of the output signal carries, a linear phase, equiripple FIR is desirable. Audio information is carried from 0 to 4 kHz and undesired information above 5.9 kHz.

Filter design parameters:Sampling rate = 30kspsFpass = 4 kHzFstop = 5 kHzStopband attenuation = 40 dBPassband ripple = 0.01

Filter coefficients (via fdatool):b = [-0.003142926263170 -0.004199523552945 0.002998076220919 0.002391661669087 0.003696816706031 -0.000434537633437 -0.004050873795509 -0.005467065992568 -0.001664849865071 0.004476414669704 0.008018782874840 0.004787072860083 -0.003687891909247 -0.010715122932666 -0.009320562818586 0.001127641283793 0.012964223112006 0.015438923688475 0.004019122188674 -0.013969424870446 -0.023319631365764 -0.013043559639283 0.012502185615295 0.033602200050262 0.028867023989863 -0.006008412484403 -0.049079259530669 -0.062056443682625 -0.015312921357986 0.088402193690618 0.209221166019303 0.290115540998982 0.290115540998982 0.209221166019303 0.088402193690618 -0.015312921357986 -0.062056443682625 -0.049079259530669 -0.006008412484403 0.028867023989863 0.033602200050262 0.012502185615295 -0.013043559639283 -0.023319631365764 -0.013969424870446 0.004019122188674 0.015438923688475 0.012964223112006 0.001127641283793 -0.009320562818586 -0.010715122932666 -0.003687891909247 0.004787072860083 0.008018782874840 0.004476414669704 -0.001664849865071 -0.005467065992568 -0.004050873795509 -0.000434537633437 0.003696816706031 0.002391661669087 0.002998076220919 -0.004199523552945 -0.003142926263170];Filter frequency response:

3.4.1.3TestingTesting was performed by alternating between enabling and disabling the audio filter. As can be seen below, eliminating the SAT component from the audio chain significantly reduced the presence of undesirable higher frequency components and reduced mean-square error by about an order of magnitude – from 1.3813e-003 to 2.3208e-004. Peak error was also reduced by about a factor of 2.

35

Page 41:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

Power spectral density Time domain Error

Without Filter

With Filter

3.4.2 Audio SourceTo aid the simulation, a routine was written to either return audio samples from a .wav file or simulate an audio source sampled at 8 ksps. This function also includes a subroutine to resample the generated audio signal to output the audio at the desired sampling rate.

3.4.2.1Usage%AMPS_MS_gen_audio_source%%Generates white noise then filters it to appear like an audio signal%If a filename is specified, that is used instead%Defaults to 30kHz output Sampling rate%%USAGE: out_msg = AMPS_MS_gen_audio_source(Num_samp, Fs, filename)% Num_samp => Number of samples% [optional] Fs => output sampling rate% [optional] filename => alternate source for samples%% out_msg = audio signal

3.4.2.2DesignAs reading samples from a file is straight-forward, this section focuses on the generation of random audio samples.

To generate random audio samples, white noise is generated and then filtered to conform with audio spectrum. To determine the audio spectrum, a PSD for a .wav file (rocky top) was evaluated. Then a minimal order filter was designed to conform with this PSD.

This resulted in the following filter coefficients in a first-order IIR. b = [0.2929 0.2929];a = [1.0000 -0.4142];

36

Page 42:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

To achieve the desired 30 ksps, the result of this filtering process is upsampled to 30 ksps.

3.4.2.3Testing To test the generation of white noise, the spectrum of the our random audio source was compared against our wav file as shown below.

0 5 10 15-110

-100

-90

-80

-70

-60

-50

Frequency (kHz)

Pow

er/fr

eque

ncy

(dB

/Hz)

Welch Power Spectral Density Estimate

Filtered NoiseRocky Top wav

3.4.3 ChannelizerThe channelizer (down converter) extracts 30 kHz from a real 40 Msps signal (assumed ADC sampling rate).

3.4.3.1Usage%AMPS_MS_channelizer

37

Page 43:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

%%Via a 5 stage decimator / filter structure, AMPS_MS_channelizer %downconverts signal at specified channel #, extracts 30 kHz signal sampled%at 100 ksps. Assumes 40 Msps input signal.%%USAGE: [msg_out] = AMPS_MS_channelizer(msg, chan_num)% msg => real message from ADC (40 Msps)% chan_num => chan# where signal is located (see AMPS standard)%% msg_out => extracted signal @ 100 ksps

3.4.3.2Design ConsiderationsIf we assume that the front end digitizes all 10 MHz (333 channels) simultaneously with an oversampling factor of 4, that implies an ADC sampling rate of 40 MHz. At the input to the PLL, we would like a single FM signal (30 kHz BW) oversampled by approximately a factor of 4 (120 kHz). Since 120 kHz does not neatly divide into 40 MHz (implying a more complicated resampling process), we use 100 kHz. This implies a decimation factor of 400. As large decimation / filtering factor can be more efficiently implemented in a multi-stage form, we implement decimation over four stages (x5, x4, x5, x4).

Since we need to both translate the desired signal to baseband and downsample, the digital downconversion routine is implemented by performing an initial frequency translation to baseband followed by the four decimation stages. A final filtering stage is used to limit the final signal bandwidth to 30 kHz (channel bandwidth). The basic design is illustrated below.

cos(2fchannel)

Input signal

5LPF

Decimator 1

4LPF

Decimator 2

5LPF

Decimator 3

4LPF

Decimator 4

LPF

Design parameters for each decimator and filter and shown below with filter coefficients following. Because phase information must be preserved at multiple frequencies, linear phase FIR filters are used.

Stage Fs in Fs out Fpass Fstop

Decimator 1 40 Msps 8 Msps 1 MHz 3 MHzDecimator 2 8 Msps 2 Msps 100 kHz 900 kHzDecimator 3 2 Msps 400 ksps 50 kHz 150 kHzDecimator 4 400 ksps 100 ksps 30 kHz 50 kHzOutput LPF 100 ksps 100 ksps 30 kHz 35 kHz

Coefficientsb1 = [0.001184572728033 0.002827713058872 0.005799022218677 0.010304984490724 0.016532606431296 0.024479327545031 0.033909605533120 0.044333106006387 0.055038260948726 0.065160025110236 0.073784840296574 0.080076225495291 0.083395231290952 0.083395231290952 0.080076225495291 0.073784840296574 0.065160025110236 0.055038260948726 0.044333106006387 0.033909605533120 0.024479327545031 0.016532606431296 0.010304984490724 0.005799022218677 0.002827713058872 0.001184572728033];

b2 = [0.001532769801304 0.004490382268067 0.010080156251386 0.018865500941027 0.031004527418311 0.045981598961127 0.062532807471416 0.078777778907817 0.092536237950146 0.101766913270534

38

Page 44:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

0.105018769915506 0.101766913270534 0.092536237950146 0.078777778907817 0.062532807471416 0.045981598961127 0.031004527418311 0.018865500941027 0.010080156251386 0.004490382268067 0.001532769801304];

b3 = [-0.002179248628590 -0.003374003909342 -0.005193061094693 -0.006754560125014 -0.007374780543155 -0.006242024354510 -0.002545098171039 0.004347497156960 0.014719381659733 0.028370653105620 0.044553878893949 0.062006712841855 0.079088244661314 0.093999088068192 0.105050579464221 0.110933438795678 0.110933438795678 0.105050579464221 0.093999088068192 0.079088244661314 0.062006712841855 0.044553878893949 0.028370653105620 0.014719381659733 0.004347497156960 -0.002545098171039 -0.006242024354510 -0.007374780543155 -0.006754560125014 -0.005193061094693 -0.003374003909342 -0.002179248628590];

b4 = [0.001332195480680 0.001977823939546 0.002552768925043 0.002291896961152 0.000812246580882 -0.001836256776405 -0.004994198740078 -0.007461635516893 -0.007861224944972 -0.005223151008536 0.000410432546899 0.007645513335298 0.013899754113758 0.016142714629032 0.012057458504639 0.001247813830527 -0.013996827542400 -0.028788341798022 -0.036724916223938 -0.031763191415547 -0.010333862345303 0.027018714462061 0.075112678971543 0.125029042618526 0.166274443043237 0.189598640945224 0.189598640945224 0.166274443043237 0.125029042618526 0.075112678971543 0.027018714462061 -0.010333862345303 -0.031763191415547 -0.036724916223938 -0.028788341798022 -0.013996827542400 0.001247813830527 0.012057458504639 0.016142714629032 0.013899754113758 0.007645513335298 0.000410432546899 -0.005223151008536 -0.007861224944972 -0.007461635516893 -0.004994198740078 -0.001836256776405 0.000812246580882 0.002291896961152 0.002552768925043 0.001977823939546 0.001332195480680];b5 = [-0.001385930336432 -0.004910417613090 -0.000812634755176 0.003677030538957 -0.002743663299278 -0.002149848328284 0.005954685819876 -0.002926078617513 -0.005310561312236 0.009223806701905 -0.001875790062027 -0.010576403279944 0.012933118119029 0.001374052860769 -0.018639785953022 0.016691018913165 0.008431718602306 -0.031150217390599 0.020036577482161 0.023203886241155 -0.053500436240989 0.022559590363544 0.062224736903565 -0.118489522260608 0.023913351537814 0.538571426022072 0.538571426022072 0.023913351537814 -0.118489522260608 0.062224736903565 0.022559590363544 -0.053500436240989 0.023203886241155 0.020036577482161 -0.031150217390599 0.008431718602306 0.016691018913165 -0.018639785953022 0.001374052860769 0.012933118119029 -0.010576403279944 -0.001875790062027 0.009223806701905 -0.005310561312236 -0.002926078617513 0.005954685819876 -0.002149848328284 -0.002743663299278 0.003677030538957 -0.000812634755176 -0.004910417613090 -0.001385930336432];

3.4.3.3TestingTo test the performance of the channelizer, two different messages were upconverted and then input to the channelizer. Upconverted power spectrum is shown below on the left. On the right, the downconverted signal and the original modulated signal are shown.

0 2 4 6 8 10 12 14 16 18 20-130

-120

-110

-100

-90

-80

-70

-60

Frequency (MHz)

Pow

er/fr

eque

ncy

(dB

/Hz)

Welch Power Spectral Density Estimate

Up Converted Signals

0 5 10 15 20 25 30 35 40 45 50-120

-100

-80

-60

-40

Frequency (kHz)

Pow

er/fr

eque

ncy

(dB

/Hz)

Welch Power Spectral Density Estimate

Channelized signal

0 5 10 15 20 25 30 35 40 45 50-100

-80

-60

-40

-20

Frequency (kHz)

Pow

er/fr

eque

ncy

(dB

/Hz)

Welch Power Spectral Density Estimate

Transmit2 signal

39

Page 45:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

We also input the wrong channel number (off by 5) and verified that signal power was dramatically decreased (essentially filtered noise @ -140 dBm),

0 5 10 15 20 25 30 35 40 45 50-180

-160

-140

-120

Frequency (kHz)

Pow

er/fr

eque

ncy

(dB

/Hz)

Welch Power Spectral Density Estimate

Channelized signal

0 5 10 15 20 25 30 35 40 45 50-100

-80

-60

-40

-20

Frequency (kHz)

Pow

er/fr

eque

ncy

(dB

/Hz)

Welch Power Spectral Density Estimate

Transmit2 signal

As a system test, the upconverter and channelizer were integrated into a link simulation and the error vector evaluated as shown below.

0 500 1000 1500 2000 2500 3000 3500 40000

1

2

3

4

5

6x 10

-3 |Message - Received|2

3.4.4 Compressor / ExpanderThe compressor routines implements a 2:1 (2 dB increase in input results in a 1 dB increase in output) syllabic compressor with an attack time of 3 ms and a nominal recovery time of 13.5 ms, time constant is 20 ms. The expander undoes this operation at the receiver.

3.4.4.1Usage%USAGE: ans = AMPS_expander(msg, Fs, state) % msg => input message to compress% Fs => Sampling rate, defaults to 15 kHz% in_state (optional) => state of LPF from previous call%% ans => modified message, length(ans) = length(msg)% out_state => final state of LPF filter

40

Page 46:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

3.4.4.2Design ConsiderationsThe design for the compressor was adopted from (P. Black, et al., "Digital FM Audio Processing in a dual-mode %communication system, US Patent 6,246,885 B1. Issued Jun 12 2001) which can be implemented as shown below.

z-11/x

Kc(1-a)

aABS()

where for a sampling rate of 30 ksps the following loop filter parameters are used. a = 1/30e3/20e-3; Kc = 1/8.6e-3;

The expander uses the same loop filter, but reverses this operation as shown below.

z-1Kc

(1-a)

aABS()

Note that (P. Black, et al., "Digital FM Audio Processing in a dual-mode %communication system, US Patent 6,246,885 B1. Issued Jun 12 2001) suggests interpolating and decimating by a factor of 3 before and after the abs() block for greater phase resolution. However this is not necessary for our implementation as the implementation is clocked at 30 ksps (P. Black is implemented at 8x3 = 24 ksps), implying a natural greater phase resolution.

3.4.4.3TestingTo test the 2:1 compressor and expanders we swept the power of the signal input to the compressor and expander from -6 dBw to 14 dBw. The results are shown below for the input/output ratios for the compander alone (top), expander alone (middle) and the compander followed by the expander (bottom).

41

Page 47:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

-6 -4 -2 0 2 4 6 8 10 12 14-5

0

5

10

Input Max (dB)

Out

put M

ax (d

B)

Compressor Transfer FunctionIdeal Transfer Function

-6 -4 -2 0 2 4 6 8 10 12 14-20

-10

0

10

20

30

Input Max (dB)

Out

put M

ax (d

B)

Expander Transfer FunctionIdeal Transfer Function

-6 -4 -2 0 2 4 6 8 10 12 14-10

-5

0

5

10

15

Input Max (dB)

Out

put M

ax (d

B)

Joint Transfer FunctionIdeal Transfer Function

Example time domain signals for a random audio signal before compression, after compression, and after compression – then-expansion is shown below.

42

Page 48:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

0 100 200 300 400 500 600 700 800 900 1000-3

-2

-1

0

1

2Original Message

0 100 200 300 400 500 600 700 800 900 1000-2

-1

0

1

2Compressed Signal

0 100 200 300 400 500 600 700 800 900 1000-3

-2

-1

0

1

2Expanded Signal

The induced error in the process was measured (by comparing input and output signals) and seen to be very low as shown below.

0 100 200 300 400 500 600 700 800 900 10000

0.5

1

1.5

2

2.5

3

3.5

4

4.5

x 10-32

43

Page 49:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

3.4.5 DemodulatorNominally, with phase extraction / residual carrier removal performed by a PLL, the output signal takes the form y t f m t so that output message is scaled by the ratio of frequency deviation to the sampling rate. This routine restores proper scaling.

3.4.5.1Usage%AMPS_MS_FM_demodulate%%Scales the input msg by the specified factor%%USAGE: ans = AMPS_MS_FM_demodulate(msg,scale)% msg => input message to compress% scale => scale factor%% ans => modified message, ans = msg * scale

3.4.5.2DesignThis process simply multiplies the input message vector by a scalar to undo scaling effects, so this design discussion is greatly abbreviated.

While the output signal takes the form y t f m t so that output message is scaled, the loop filter also imparts a gain, so the calculation is not as straight forward. Currently that scalar is set to 7 which was determined empirically.

3.4.6 Deviation LimiterThe deviation limiter ensures that the audio signal does not drive the deviation of the FM signal beyond some specified limit thereby creating out-of-band interference for other signals. In AMPS, the maximum frequency deviation is limited to ±12 kHz, though this is not applied to the SAT or the ST. The simplest way to implement a deviation limiter is to clip audio signals above a given amplitude level.

3.4.6.1Usage%AMPS_BS_DEVIATION_LIMITER%%Implements a deviation limiter to limit audio modulation to a maximum %instantaneous frequency deviation of 12 kHz%%USAGE: ans = AMPS_BS_deviation_limiter(msg, lambda) % msg => input message to limit% lambda => Maximum magnitude%% ans => modified message, length(ans) = length(msg)%% Lambda should be set to 8 kHz for a maximum nominal deviation of 10.9% kHz and worst case to less than 12 kHz%% Operation% ans(i) = lambda; msg(i) >= lambda% ans(i) = msg(i); -lambda < msg(i) < lambda% ans(i) = -lambda; msg(i) <= -lambda

44

Page 50:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

3.4.6.2Design ConsiderationsThe basic operation of the deviation limiter can be visualized as shown below in equation and graphical forms.

x ny n x n x n

x n

Input

Output

-

-

The only design consideration here is the choice of lambda. The AMPS specification gives 1 kHz tone = 2.9 peak deviation which implies a frequency deviation of 2.9 kHz. (P. Black, et al., "Digital FM Audio Processing in a dual-mode %communication system, US Patent 6,246,885 B1. Issued Jun 12 2001) suggests a nominal limit of 8000 Hz to achieve the AMPS specified peak nominal deviation of 12 kHz. This then yields: = 8000 / 2900.

3.4.7 FM ModulationThe FM modulation block transforms the input message into an FM signal with a nominal peak deviation of ±12 kHz with a frequency deviation of 2.9 kHz.

3.4.7.1Usage%AMPS_BS_FM_MOD%%Implements an FM Modulator and stores phase between calls%%USAGE: [signal,out_phase] = AMPS_BS_FM_Mod(msg, Fc, Fs, freq_dev, in_phase)% msg => input message to modulate% Fc => carrier frequency% Fs => Sampling rate% freq_dev => deviation frequency% in_phase (optional) => initial phase of modulator%% signal => modulated signal message, length(signal) = length(msg)% out_phase => final phase of modulator

3.4.7.2Design ConsiderationsThe design of an FM modulator in simulation can be readily implemented as

45

Page 51:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

cos 2 cy n f t f m t where f = 2.9 kHz.

As a secondary consideration more important for implementation, the phase input to the cosine should be remapped to [0 2) between calls to limit overflow and maximize phase accuracy.

3.4.7.3TestingTo verify operation of the implemented FM modulator, it was compared against the FM modulator included in the Communications toolbox. The results are shown below. Note that there is a slight growing deviation due to not remapping the phase, but at 10-14, the errors are negligible over the periods considered in the simulation.

0 100 200 300 400 500 600 700 800 900 1000-1

-0.5

0

0.5

1

Bui

lt in

0 100 200 300 400 500 600 700 800 900 1000-1

-0.5

0

0.5

1

Cod

ed

0 100 200 300 400 500 600 700 800 900 1000-2

-1

0

1

2x 10

-14

Bui

lt in

- co

ded

3.4.8 Phase Locked LoopBecause performing FM demodulation via a PLL gives a slight SNR improvement over discriminator techniques, a PLL will be used for demodulation rather than initially proposed discriminators.

3.4.8.1Usage%AMPS_BS_PLL%%Removes carrier and returns carrier-less phase of input signal%Output phase differences taken from phase error%I.e., the difference between the phase estimate and the actual phase is%the phase shift between samples%

46

Page 52:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

%USAGE: [phase_diff, phase_acc_out, phase_err_out, LF_acc_out, out_state,%out_hilbert] = AMPS_BS_PLL(msg,Fc,Fs,in_state, in_hilbert)% msg => input message% Fc carrier frequency% Fs => Sampling rate% [optional] in_state, in_hilbert => internal states%% phase_diff => output phase differences% [optional] phase_err_out, LF_acc_out, out_state,out_hilber => internal states

3.4.8.2Design ConsiderationsThe basic design for a Costas loop-based phase-locked loop for extracting FM information is shown below where and are parameters that define the loop filter behavior and –j sign implies a Hilbert transform.

If a complex ADC is used, then there will be no need for the Hilbert transform.LoopLoop

The following discusses the design of these parameters in more detail.

Hilbert TransformTheoretically, a Hilbert transform imparts a -/2 phase shift of the input signal without modifying the magnitude of the input signal. A Hilbert transformer is a filter that implements a Hilbert transform. The transformer is defined by the frequency response given in (1) and illustrated in Figure 3-27.

sgnHH j 00

jj

(1)

0

0

j

- j

H H ( )

Figure 3-27 Hilbert Transform Frequency Response

47

Page 53:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

Except at =0, for all values of the magnitude response of the Hilbert transformer is a constant 1, i.e., 1HH . Though technically undefined, the magnitude of response of the transformer at =0 is typically chosen to be 0, i.e., 0HH = 0. For notational purposes we will denote the Hilbert transform as H{} and the output of the Hilbert transform of the signal x(t), H{x(t)}, as ˆ( )x t .

In order to implement a Hilbert transform, we need to express it in the time domain. The impulse response of an ideal Hilbert transform can be found as follows.

0

0

2

12

12

2sin / 2, 0

0, 0

j nH H

j n j n

h n H e

je je

nn

nn

(10)

Thus an ideal Hilbert transform’s impulse response is seen to be 1) infinite in duration2) noncausal (as the output depends on future values of n)3) antisymmetric (equal in magnitude and opposite in sign)4) nonzero for only odd values of n

Because of the infinite duration, it is not possible to directly implement a Hilbert transform. However, it can be closely approximated by windowing the impulse response and implementing the filter using a linear phase FIR with an antisymmetric impulse response. Any of a number of different windowing methods are appropriate. Additionally, because the impulse response is antisymmetric, the frequency response must be 0 at =0 for even and odd order filters, and 0 at = for an odd order filter, thus it will also not be possible to implement the Hilbert transform as an all pass filter. However, if the signal to be phase shifted is known -to be limited to a range of frequencies, then the filter can still be appropriately designed.

One method to

2 20.54 0.46cos , [0, 1],

10, [1, 1],

H

n n N n evenh n n N

n N n odd

(11)

where 2N

and indicates the floor function.

Designing the Costas Loop FilterIn order to design the Costas loop filter we need a linearized model that can be analyzed. Assuming the carrier is in lock, and the phase error is small, a linearized model of the Loop filter is given below in Figure 6.

48

Page 54:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

Figure 6 Linearized Loop Filter

In this diagram, 1 ck A (25)

for an FM demodulation scheme.

Its loop transfer function is given by the following equation2

11 1

1 21 1

1( )

1 2 1

k k zH z

k z k z

(27)

Notice that this corresponds to a lowpass filter. Thus the loop filter will use low frequency components of the error signal (created from actual phase and frequency offsets) while blocking the higher frequency components of the error signal (mostly due to noise). The range of frequencies that the loop filter passes is known as the loop bandwidth and is typically denoted as BL.

The value of loop bandwidth determines the following performance parameters for the loop: acquisition time and the variance in the phase estimate. Acquisition time, in samples is equal to

1.2 [ ]acqL S

t samplesB T

(28)

The variance in the phase estimate is equal to

2

2 2[ ]L SB Trad

SNR (29)

Thus while increasing the loop bandwidth decreases the amount of time required for acquisition, it increases the variance in the phase estimate. This highlights the fundamental tradeoff of acquisition time for tracking stability that must be made in carrier recovery systems. In order to

2 Note that this is different than the transfer function that appears in Tretter.

49

1(n)

z-1

k1

11 z

2(n)-

Page 55:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

achieve “the best of both worlds” some receivers include several - pairs so that the signal can initially be recovered using a signal with coefficients that correspond to a wide loop filter bandwidth for fast acquisition and then once acquired, change over to a lower filter bandwidth.

In order to implement a filter with a specific loop filter bandwidth, the following relationships can be used

12

21

4

L SB Tk

(30)

2

12

14

L SB Tk

(31)

where is the loop's damping factor. For most phase lock loops, a value of =0.707 can be shown to be optimal.

In general, the loop filter should be sufficient to pass the baseband message signal, but narrow enough to suppress out-of band noise – the difference between the two being the source of the relative performance gain for a PLL demodulator.

In the implementation, loop bandwidths and sampling rates (the inverse of the sample period, Ts) are specified and alpha and beta automatically calculated. Currently, the simulation is configured to operate with a 15 kHz loop filter bandwidth.

Hilbert coefficients:h=[ -0.004195635890349 0.000000000000002 -0.009282101548805 0.000000000000001

-0.018835806997706 0.000000000000001 -0.034401008019325 0.000000000000001 -0.059551575569703 0.000000000000001 -0.103037636419894 0.000000000000001 -0.196831535623640 0.000000000000000 -0.631353640882195 0 0.631353640882195

-0.000000000000000 0.196831535623640 -0.000000000000001 0.103037636419894 -0.000000000000001 0.059551575569703 -0.000000000000001 0.034401008019325

-0.000000000000001 0.018835806997706 -0.000000000000001 0.009282101548805 -0.000000000000002 0.004195635890349];

Sampling rate:The input signal of 30 kHz (channel bandwidth) requiring a sampling rate of at least 60 ksps. However, because higher sampling rates yield better performance, a higher sampling rate is used. Oversampling by a factor of 4 is common (or 120 ksps), but using 100 ksps allows for simpler implementation of channelization / down conversion stages.

3.4.8.3TestingTo test the phase-locked-loop, we input FM modulated signals into the routine and evaluated the output. When the loop filter is too narrow (2 kHz), higher frequency components in the original message are lost as can be seen below.

50

Page 56:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

0 100 200 300 400 500 600 700 800 900 1000-0.4

-0.2

0

0.2

0.4Original Signal

0 100 200 300 400 500 600 700 800 900 1000-0.5

0

0.5

1Demodulated Signal

Initial acquisition

With a wider loop bandwidth (10 kHz) there is less attenuation of higher frequency signals.

0 100 200 300 400 500 600 700 800 900 1000-0.4

-0.2

0

0.2

0.4Original Signal

0 100 200 300 400 500 600 700 800 900 1000-0.1

-0.05

0

0.05

0.1Demodulated Signal

And with a loop bandwidth of 15 kHz virtually no higher frequency components are lost (see below), though it is still not a perfect reconstruction.

51

Page 57:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

0 100 200 300 400 500 600 700 800 900 1000-0.4

-0.3

-0.2

-0.1

0

0.1

0.2

0.3Original Signal

0 100 200 300 400 500 600 700 800 900 1000-0.1

-0.05

0

0.05

0.1Demodulated Signal

3.4.9 Post Deviation-Limiter FilterThe post-deviation filter is used to limit the higher frequency components created by the deviation limiter.

3.4.9.1Usage%AMPS_MS_post_limit_filter%%Implements a low pass filter after the deviation limiter%%USAGE: [msg_out, out_state] = AMPS_MS_post_limit_filter(msg, in_state)% msg => input message to filter% in_state (optional) => stored filter states%% msg_out => filtered message% [optional] out_state => final state of filter

3.4.9.2Design ConsiderationsAMPS specifies that the Post Deviation-Limiter Filter’s attenuation characteristics must exceed the specifications in Table 3-1.

52

Page 58:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

Table 3-1: Post Deviation-Limiter Filter Minimum Requirements. From Section 2.1.3.4 in [AMPS_99]

Since phase information needs to be preserved, a linear-phase equiripple filter is desired. However, using the minimum order filter (as determined by fdatool) violated minimum attenuation requirements as highlighted below.

0 5000 10000 15000-90

-80

-70

-60

-50

-40

-30

-20

-10

0

10

Frequency (Hz)

|H(

)| (d

B)

RequirementInitial Post Deviation Filter

So we manually moved the location of a handful of zeros (decreasing spacing near and near the SAT band) using the minimum order filter. The frequency response of this altered filter is shown below.

53

Page 59:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

0 5000 10000 15000-70

-60

-50

-40

-30

-20

-10

0

10

Frequency (Hz)

|H(

)| (d

B)

RequirementModified Post Deviation Filter

Filter coefficentsh = [0.0093,-0.004074105158591,-0.001680855780921, 0.001038275803214, 0.0003145675795942, -

0.0002661664750837,-0.003178175108014,-0.003480261683949, -0.005054329423129, -0.004015585620964,-0.002752682314886, 0.002083017127123, 0.006680739693787, 0.008544614693588, 0.003934972170555,-0.005255213147915, -0.01375745400267, -0.01565669987897,-0.008673998175613, 0.004322103418575, 0.0177958250681, 0.0248174580535, 0.01970603022711,0.0006583247399552, -0.02618642316876, -0.04789043173241, -0.0471629353282, -0.01430980123278, 0.04738067908363, 0.1218038163222, 0.1891490636535, 0.2359657014037, 0.2301339552291, 0.173126737949, 0.1012117311498, 0.02988220161609, -0.02270033159502, -0.04517243757058, -0.03867738053013, -0.01559414123453, 0.007272183023311, 0.01973398179257, 0.01949586058282, 0.01098031118892, 6.20583907374e-005,-0.008561169962336, -0.0122900905383,-0.009933705124487, -0.003298597245074, 0.003491980189544, 0.006771183275222, 0.005052388387177, 0.001470438362255,-0.002400932196112,

-0.0032885934608,-0.004620495592326, -0.003642892413389, -0.00372455538822,-0.0006088003398914,0.0006481667392035, 0.001896896995113,-0.001052580195583, -

0.004478528696097, 0.008775424891451];

Note that a much smaller filter order could have been achieved if we processed audio at 8 ksps and upconverted as needed.

3.4.10 Pre-emphasis / De-emphasisAn FM signal is received with an SNR that decreases with modulation frequency. To improve received SNR, FM systems reshape the transmitted signal by emphasizing higher frequency components with a pre-emphasis filter. The pre-emphasis and de-emphasis filters perform these operations.

3.4.10.1Usage%AMPS_MS_De_emphasis

54

Page 60:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

%Implements a de-emphasis filter for AMPS Receiver Physical Layer FM Waveform%%USAGE: [msg_out, out_state] = AMPS_MS_De_emphasis(msg, in_state)% msg => input message% [optional] in_state => Filter state%% msg_out => filtered signal% [optional] in_state => Filter state

3.4.10.2Design ConsiderationsIn AMPS, the pre-emphasis filter is defined as increasing at a rate of 6 dB / octave from 300 Hz to 3000 Hz (or 20 dB per decade). This can be visualized as shown below. No specification is made for audio components above 3000 Hz, though these are implicitly filtered out by some of the following communications blocks. Additionally, the response at 1000 kHz is specified to be at 0 dB.

Frequency0

H(f)

(dB

)

10003000300

6 dB / octave

In the receiver, the effect of the pre-emphasis filter is undone with a de-emphasis filter which has a – 6 dB / octave (-20 dB / decade) response between 300 and 3000 Hz. When cascaded, the pre-emphasis and de-emphasis filters should have a zero phase response and a magnitude response of

1H f (all pass).

To design these filters we want to relate the de-emphasis filter coefficients to the pre-emphasis coefficients as:

pre de

num denden num

so that

1num denden num

In such a formulation, the phase response is identically zero, though there will be a constant group delay imparted by the two filters. Interestingly, this means that we do not have to be concerned with the linearity of the phase response of either filter as it will naturally cancel out.

55

Page 61:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

A final design constraint is we wished for the unspecified band above 3 kHz to be as flat as possible to simplify the design of the post-deviation limiter filter which filter out higher frequency components of the nonlinear effects of the clipping in the deviation limiting filter.

Also in this form, extra care must be given to the placement of the zeros. Typically, when poles fall outside of the unit circle, the filter is unstable, but zeros can be in any position without instability. However, because the zeros of the pre-emphasis filter are the poles of the de-emphasis filter (and vice versa), in this design, we must also ensure that all zeros are inside of the unit circle.

As the placement of zeros is not a design constraint of Matlab’s built-in automated filter design routines (e.g., remez, firpm, ellip, chebyshev), they could not be used in the filter design. Indeed, several attempts at using these routines to design the pre-emphasis filter resulted in zeros outside of the unit circle. So we had to design the filter “by hand” which in practice meant we used the Signal Processing Toolbox’s Filter Design and Analysis (FDA) Tool to vary the number and placement of poles and zeros. A snapshot of the designed pre-emphasis filter in the FDA tool is shown below.

The designed filter’s poles and zeros are shown below and the coefficients for the pre-emphasis filter follows.

56

Page 62:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

-1 -0.5 0 0.5 1

-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

4

Real Part

Imag

inar

y P

art

Coefficientsb_pre_emph = [7.8, -11.80432846903, 6.580417658534, -1.498127693356, 0.0645050347985,

0.01298789190044, 0.001567647923334,-0.0002643963842457, -5.358255489929e-006, -1.419699987735e-006, 2.040997646494e-007, 0, 0, 0, 0];

a_pre_emph = [1,-0.9878898028869, 0.6705675993758, -0.00968683648108, 0.1137766048835, 0.1089190997852, 0.0788345050163, 0.04455712827004, 0.06617847063799, 0.02361280898405, 0.01366381452519, 0.03279003244673, 0.002735442476967, 0.004045173473979, 0.004419473756291];

3.4.10.3TestingPlots which depicts the individual and cascaded responses of these filters is shown below.

0 5000 10000 15000-5

0

5

10

15

20

25

H(

)

Frequency (Hz)

Pre-emphasisIdeal

0 5000 10000 15000-25

-20

-15

-10

-5

0

5

H(

)

Frequency (Hz)

De-emphasisIdeal

0 5000 10000 150001

1

1

1

1

1

H(

)

Frequency (Hz)

Joint

57

Page 63:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

0 500 1000 1500 2000 2500 3000 3500 4000-5

0

5

10

15

20

25

H(

)

Frequency (Hz)

Pre-emphasisIdeal

0 500 1000 1500 2000 2500 3000 3500 4000-25

-20

-15

-10

-5

0

5

H(

)

Frequency (Hz)

De-emphasisIdeal

0 500 1000 1500 2000 2500 3000 3500 40001

1

1

1

1

1

H(

)

Frequency (Hz)

Joint

3.4.11 SAT Detection / Reception BlockAt the mobile station, there are two different functions that must be accomplished by the SAT block – detecting the presence and index of transmitted SAT tones and transponding the received SAT tone. At the BS, there is no need to transpond the SAT signal (as it is the source of the SAT signal), but it does still need to detect if the MS was able to send back the SAT. The BS may do additional processing with the transponded SAT to estimate other parameters.

3.4.11.1Usage%AMPS_MS_SAT_block%%Implements SAT reception / detection block at the MS %%[SAT_ind, SAT_flag, SAT_transpond, SAT_strength] = AMPS_MS_SAT_block(msg,SAT_level)% msg => input message from demodulator (30 ksps)% [optional] SAT_level => SAT level for transponding% % SAT_ind => Detected SAT index (Filter bank with greatest power)% SAT_flag => If detected SAT index power > -20 dB% SAT_tranpond => transponded signal% [optional] SAT_strength => strength of largest SAT index (useful if a% different threshold is desired

58

Page 64:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

3.4.11.2Design ConsiderationsThe basic design of this routine is shown below. The initial signal is passed through a bandpass filter to limit the input energy to only the SAT band. This signal is then separately processed by the SAT transponding block (to restore the proper power level) and by the detection block. Each of these are discussed in more detail in the following.

BPF

SAT Transponding

SAT Detection

6?

30 ksps

5 ksps BPF 1

BPF 2

SAT band only

BPF 3

()2

()2

()2

AVG

AVG

AVG

Decision

SAT_ind

SAT_level

LPF

()2

SAT_level-

+

1

1

51

zH zz

BPF

1

1

0.731 0.5

zH zz

Initial Bandpass Filter (BPF)Since phase information is not necessary (by the AMPS standard, any phase shift can be induced by the MS as long as the phase-shift is constant during the SAT transponding), we can make use of an IIR filter to extract the SAT tones.

The BPF parameters were chosen as follows:%======================%Initial %BPF stuff%Fpass = 5950, 6050%Fstop = 5800, 6200%Fs = 30 kHz%Stop attenuation = 40 dB%Type = Chebyshev I%====================== Using a minimum order IIR filter (as designed in fdatool) resulted in the following coefficients for a 7-th order filter:b = 1.0e-005 * [ 0.055841306910404 0 -0.167523920731211 0 0.167523920731211 0 -0.055841306910404];a = [1.0 -1.847705675773874 4.117016651855352 -3.903412493779290 4.088708602598154 -1.822382569108087 0.979513182836410];

The frequency response for this filter is shown below. Note that over 100 dB of attenuation is applied to any possible audio or ST energy.

59

Page 65:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

Figure 3-28: Initial Bandpass Filter and relative location of other signals.

Detection designAfter the narrow-band BPF, the only signals that should remain are those in the SAT band – for which phase information is inconsequential. Thus in our filter bank design, we can use IIRs and we can permit aliasing in decimation which would further reduce implementation cycles.

In the SAT detection block, samples from the BPF block are downsampled by a factor of 6 from 30 ksps to 5 ksps. This creates an aliased version of the SAT tones at 1 kHz instead of the original 6 kHz and reduces filter complexity (as it runs slower and has a wider digital transition band).

The following specifications for the filter bank were used.

%======================%Filter Bank (assumes downsampled to 5 ksps)%Fpass = 960-980, 990-1010, 1020-1040%Fstop = +- 20%Fs = 5kHz%Stop attenuation = 40 dB%======================

Using fdatool with minimum order Chebyshev Type I (IIR) filters resulted in the following set of coefficients.

b_ind1 = 1.0e-007 * [0.060532003742681 0 -0.242128014970724 0 0.363192022456085 0 -0.242128014970724 0 0.060532003742681];a_ind1 = [1.000000000000000 -2.748890671412128 6.809157508033244 -9.494833430099405 11.783588283470834 -9.438161606488269 6.728116885253561 -2.699960824591750 0.976337829216197]; b_ind2 = 1.0e-007 * [0.060532003742681 0 -0.242128014970723 0 0.363192022456084 0 -0.242128014970723 0 0.060532003742681];a_ind2 = [1.0 -2.464736328605734 6.253588205376495 -8.285111944630565 10.600248302342271 -8.235660686553263 6.179160133216954 -2.420864387001973 0.976337829216194]; b_ind3 = 1.0e-007 * [0.060532003742680 0 -0.242128014970721 0 0.363192022456081 0.0 -0.242128014970721 0 0.060532003742680];

60

Page 66:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

a_ind3 = [1.0 -2.177079460608928 5.752854719380474 -7.136464903785235 9.548400487262812 -7.093869644243915 5.684386525687111 -2.138327768651451 0.976337829216207];

A zoomed-in view of the frequency response for the filter bank is shown below. Note that there is a minimum of 20 dB of attenuation between adjacent filters and more than 40 dB to the center of the adjacent filter.

940 960 980 1000 1020 1040 1060-40

-35

-30

-25

-20

-15

-10

-5

0

5

Frequency (Hz)

H(f)

(dB

)1 2 3

TranspondingIn the transponding block, the loop filter attempts to restore the SAT-band energy to the proper amplitude level (a 2 kHz nominal deviation with a 2.9 kHz frequency deviation implies an amplitude of 2/2.9 and a power level of 4/2.92).

This is performed by estimating the received signal power level, comparing it to the desired SAT_power level, and passing it through a low pass filter before multiplying the input signal. This was illustrated an parameterized in the introduction to this section.

3.4.11.3TestingDetectionExample output power estimates are given below where the rows correspond to choices of SAT indices generated by the BS and columns correspond to the SAT power levels detected by each SAT bandpass detector. Note that out-of-band signal levels are approximately 4 orders of

Input SAT index

SAT 1 Filter Power

SAT 2 Filter Power

SAT 3 Filter Power Output SAT index

1 0.1926 1.1716e-004 2.5192e-005 12 7.8850e-005 0.2355 1.0794e-004 23 1.1524e-005 8.4167e-005 0.1898 3

none 8.0090e-007 8.1188e-007 8.0186e-007 Flag = 0

TranspondingThe restoration to the proper maximum amplitude (2/2.9) is verified below.

61

Page 67:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

0 500 1000 1500 2000 2500 3000 3500 4000-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

3.4.12 SAT / ST GenerationThese routines generate SAT / ST signals by the BS and MS. A separate routine is used for transponding SAT tones at the MS. Similar interfaces / design considerations are used for both.

3.4.12.1Usage%AMPS_BS_gen_SAT%%Generates the required supervisory audio tone (SAT) based on the input %index for the specified %number of samples at the specified sampling rate%Stores phase between calls%%USAGE: [sig, out_phase] = AMPS_BS_gen_SAT(SAT_enable, L,SAT_ind, Fs, phase)% SAT_enable => SAT enable signal (outputs all zeros if 0) % L => number of samples% SAT_ind = > SAT index (1-3)% Fs => Sampling frequency% phase => initial phase for SAT%% msg_out => filtered signal (msg_out) = length(msg)% out_state => final state of filter

3.4.12.2Design considerationsTones are simply generated as

cos 2 Ty t f twhere fT is the frequency of the tone. The only consideration is to ensure that phases are preserved between function calls.

3.4.12.3TestingThough not explicitly tested, the proper generation of tones is verifiable by examining the spectrum of the generated signal. For example the table below shows the difference when a SAT is generated or not generated and the next plot shows when a ST tone is included.

62

Page 68:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

0 5 10 15 20 25 30 35 40 45 50-120

-100

-80

-60

-40

Frequency (kHz)

Pow

er/fr

eque

ncy

(dB

/Hz)

Welch Power Spectral Density Estimate

Channelized signal

0 5 10 15 20 25 30 35 40 45 50-100

-80

-60

-40

-20

Frequency (kHz)

Pow

er/fr

eque

ncy

(dB

/Hz)

Welch Power Spectral Density Estimate

Transmit2 signal

0 5 10 15 20 25 30 35 40 45 50-100

-80

-60

-40

Frequency (kHz)

Pow

er/fr

eque

ncy

(dB

/Hz)

Welch Power Spectral Density Estimate

Channelized signal

0 5 10 15 20 25 30 35 40 45 50-100

-80

-60

-40

-20

Frequency (kHz)

Pow

er/fr

eque

ncy

(dB

/Hz)

Welch Power Spectral Density Estimate

Transmit2 signal

Due to SAT

0 5 10 15 20 25 30 35 40 45 50-90

-80

-70

-60

-50

-40

-30

Frequency (kHz)

Pow

er/fr

eque

ncy

(dB

/Hz)

Welch Power Spectral Density Estimate

SAT

ST

3.4.13 SquelchThe squelch routine is intended to determine if the audio output should be suppressed because no signal is present or the SNR is too low. This should be coupled with a routine that turns off the audio when no SAT is detected at the MS.

3.4.13.1Usage%AMPS_MS_squelch_detect%%Determines if signal should be sent to audio output based on SNR level%(enable signal). Actual suppression (zeroing) should be performed externally.%%USAGE: [msg_out, enable, SNR, out_states] = AMPS_MS_squelch_detect (msg, SAT_flag,%thresh, states)% msg => audio message (audio signal)% FM_demod_sig => 0-15kHz output from FM demodulator (to estimate noise)% chan_num => desired AMPS channel number (integer)% [optional] thresh => SNR threshold (linear)% [optional] states => noise filter_states%% enable => audio enable signal% [optional] SNR => estimated SNR% [optional] out_states => noise filter states

63

Page 69:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

3.4.13.2Design ConsiderationsEstimating SNR can be done by measuring signal power and estimating noise power and evaluating the ratio. Since noise overlaps with signal power, this is slightly more complicated, but can be accomplished via the following process:

%Basic operation:%1) Estimate Initial signal power% a) LPF for audio portion -> DC to 3300ish Hz% b) Sum of squares for signal power% c) LPF to smooth out estimate %2) Estimate noise power level% a) HPF for non-audio portion% b) Sum of squares for noise power% c) LPF to smooth out estimate %3) Estimate SNR ratio (assumes white noise)% a) Estimate in-band noise power% b) Update signal power estimate% i) signal power = init power - in-band noise% c) Inband Ratio = sig_power (adj) / (in_band_noise) %4) Squelch as needed% a) If SNR > thresh, enable = 1, else enable = 0

Since a filtered audio signal is available at the output of the audio filter, the key design consideration is the design of the noise filter which can be done with an IIR filter since we do not need phase information (only power). Since we would like to use the same process at both the BS and the MS, we need to avoid the ST tones @ 10 kHz which implies a high pass above 11 kHz.

Note that this implies a noise filter whose bandwidth is equal to the bandwidth of the audio filter. Thus inband noise power is approximately equivalent to the output of the noise filter which simplifies the calculation of in-band SNR (initial estimate – noise estimate).

Noise Filter Design ParametersFpass = 11 kHzFstop = 10.5 kHzF_samp = 30 kspsStop_attentuation = 80 dB

Noise Filter Coefficientsbhigh = 1.0e-007 * [0.000000951461132 -0.000019029222642 0.000180777615100 -0.001084665690598 0.004609829185043 -0.014751453392137 0.036878633480342 -0.073757266960683 0.119855558811111 -0.159807411748147 0.175788152922962 -0.159807411748147 0.119855558811111 -0.073757266960683 0.036878633480342 -0.014751453392137 0.004609829185043 -0.001084665690598 0.000180777615100 -0.000019029222642 0.000000951461132];

ahigh = 1.0e+004 * [0.0001 0.001586539541097 0.012235258099182 0.060928511363704 0.219561058550457 0.608235304084402 1.343317018815370 2.421018739069416 3.615123398052575 4.515521549727492 4.742902087093835 4.196085644954677 3.121241057197530 1.941472826527187

64

Page 70:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

1.000066251090603 0.420096659753966 0.140567807625164 0.036118991948099 0.006707140493316 0.000802943332451 0.000046633295649];

Noise Filter Frequency Response

3.4.13.3TestingThe most interesting aspect of the squelch circuit is its SNR estimation process. To test that, we performed an initial unit test where we swept the input SNR and averaged over 10 trials with varying number of samples per estimate and compared estimated SNR to actual SNR. Note that at higher SNR levels, the estimates begin to deviate (as roll-off signal energy begins to dominate the power estimated in the noise filter) from ideal, but with less variance with more samples per estimate (as would be expected).

5 10 15 20 25 305

10

15

20

25

30

Signal SNR (dB)

Est

imat

ed S

NR

(dB

)

100 samples per estimate

Perfect EstimatorSquelch SNR Estimator

5 10 15 20 25 305

10

15

20

25

30

Signal SNR (dB)

Est

imat

ed S

NR

(dB

)

1000 samples per estimate

Perfect EstimatorSquelch SNR Estimator

However the performance of that

bhigh = [0.0069 -0.0484 0.1453 -0.2422 0.2422 -0.1453 0.0484 -0.0069];ahigh = [1.0000 1.0186 1.3255 0.7013 0.3542 0.0898 0.0168 0.0012];

For some light system testing, we set two sets of channel parameters in our forward link model, one that should be suppressed (SNR = 5; squelch_thresh = 10) and one that should be passed through (SNR = 10; squelch_thresh = 5). The results of these are shown below where the squelch circuit performed as expected.

65

Page 71:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

0 500 1000 1500 2000 2500 3000 3500 4000-0.4

-0.2

0

0.2

0.4Original Message

0 2000 4000 6000 8000 10000 12000 14000-1

-0.5

0

0.5

1Transmit Signal

0 500 1000 1500 2000 2500 3000 3500 4000-0.4

-0.2

0

0.2

0.4Receive Signal

0 500 1000 1500 2000 2500 3000 3500 4000-0.4

-0.2

0

0.2

0.4Original Message

0 2000 4000 6000 8000 10000 12000 14000-1

-0.5

0

0.5

1Transmit Signal

0 500 1000 1500 2000 2500 3000 3500 4000-1

-0.5

0

0.5

1Receive Signal

SNR = 10 dB / Threshold = 5 dB (allow output) SNR = 5 dB / Threshold = 10 dB (squelch output)

3.4.14 ST DetectThe ST detect routine is intended to be used by the base station to detect when the mobile station has sent an ST (a 10 kHz tone).

3.4.14.1Usage%AMPS_BS_ST_detect%%Detects presence of ST tone at 10 kHz%Assumes sampling rate of 30 kHz%%USAGE: [detect_flag, sig_str, out_states] = AMPS_BS_ST_detect(msg,in_states)% msg => demodulated message% [optional] in_states => internal filter states%% detect_flag => 1(0) if (not) present% [optional] sig_str => estimated ST strength% [optional] out_states => internal filter states

3.4.14.2Design ConsiderationsThe basic operation of the ST detection routine is shown below. Here, a bandpass filter selects a small portion of the demodulated spectrum around the intended location of the ST signal (10 kHZ), calculates an estimated power, compares the ST power level to a nominal ST strength, and if the detected power level exceeds the threshold the routine will flag its presence.

66

Page 72:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

BPF ()2 AVG

ST_Nominal >0?

ST_est

+

-

ST_detect

From Demod

Bandpass filter DesignBecause phase information is unimportant, a filter with a nonlinear phase response can be used. Thus for lower complexity, an IIR can be used. The following design parameters were used.

%Filter design parameters%Fs = 30kHz%Fstop = 9900, 10100%Fpass = 9980 10020%Attenuation = 40 dB%Chebyshev Type I

Filter coefficients (via fdatool):b = (1.0e-006) *[0.035960228876567 0 -0.107880686629701 0 0.107880686629701 0 -0.035960228876567];a = [1.0 2.995860076076299 5.983409413801804 6.971023884286495 5.966918204595483 2.979368651109240 0.991754287935391];

Filter frequency response:

3.4.14.3TestingTesting was performed by selectively enabling / disabling the ST in the reverse link system simulation and verifying correct detection.

3.4.15 UpconversionThe upconverter block is intended to put the FM modulated signal into the correct AMPS channel and to upsample the signal to 40 Msps which is our estimate for a DAC sampling rate.

3.4.15.1Usage%AMPS_BS_upconvert%%Upconverts the FM signal (msg) to the desired channel (chan_num). Signal%is upsampled by factor up_samp

67

Page 73:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

%%USAGE: [msg_out, out_phase] = AMPS_BS_upconvert(msg, chan_num, up_samp,%in_phase)% msg => FM modulated signal % chan_num => desired AMPS channel number (integer)% up_samp => up sampling factor (should correspond to DAC rate)% [optional] in_phase => stored phase for carrier_translation%% msg_out => upconverted / upsampled signal% [optional] out_phase => stored phase for carrier_translation

3.4.15.2Design ConsiderationsThe basic design is shown below.

400

cos(2fchannel)

When implemented, this should be done as a multi-stage interpolator as done with the channelizer. However, for engineering time considerations, interpolation was done via the resampling function.

3.4.15.3TestingAn example of the upconverted signals is shown below where two different FM signals have been upconverted to channels 100 and 200. Two signals were used as part of the testing of the channelizer to ensure that the proper signal was downconverted.

0 2 4 6 8 10 12 14 16 18 20-130

-120

-110

-100

-90

-80

-70

-60

Frequency (MHz)

Pow

er/fr

eque

ncy

(dB

/Hz)

Welch Power Spectral Density Estimate

Up Converted Signals

3.5 Simulation Block ReferencesThe following simulation blocks are effectively the top level scripts / functions.

3.5.1 Forward Link Test (AMPS_forward_link_test.m)This is a test script for simulating the forward link (BS->MS) physical layer FM signaling. It acts as a “MAC” of sorts to set all of the parameters for the BS transmitter, MS receiver, and channel (e.g., SNR). It also moves the necessary data between the functions and calls the appropriate post-processing scripts.

68

Page 74:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

3.5.1.1UsageAs this is not a function, edits to the forward link should be done by directly modify the script.

3.5.2 AMPS BS Transmitter (AMPS_BS_TX_PHY_FM.m)Implements a block-by-block AMPS transmitter for the forward link.

3.5.2.1Usage%AMPS_BS_FM_PHY_TX%Implements the AMPS Base Station Transmitter Physical Layer FM Waveform%%USAGE: [output_sig, comb_sig] = AMPS_BS_TX_PHY_FM(msg, SAT_enable,%SAT_ind, Fc, Fs, chan_num, enable_bits)% msg => input message from vocoder% Fc => Carrier frequency (MAC input)% Fs => Sampling rate (should be 40 Msps)% chan_num => channel number% enable_bits => a vector that specifies which components in the receiver should be enabled%% output_sig => upconverted signal% [optional] comb_sig => pre-mod signal (for debugging)%%============================%BS_XMT_ENABLE Vector%1 = compressor%2 - pre_emphasis%3 = deviation limiter%4 = limiter filter%5 = FM Modulation%6 = Upconvert%=================

3.5.2.2Design ConsiderationsThe implemented design (which varies somewhat with the initial design) is shown below. The details for each block were presented in the preceding along with test descriptions.

69

Page 75:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

Pre-emphasis

Compressor

DeviationLimiter

PostDeviationFilter

SAT Generation

FM Mod

BS AMPS FM Transmitter

Sampled Voice Input

(to Channel)

Enable(from Link Layer)

(From Link Layer)Carrier

Upconvert

3.5.3 AMPS Mobile System Receiver (AMPS_MS_RX_PHY_FM.m)Implements a block-by-block AMPS MS receiver for the forward link.

3.5.3.1Usage%AMPS_MS_FM_PHY_RX%Implements the AMPS Mobile Unit Station Receiver Physical Layer FM Waveform%%USAGE: [output_sig, SAT_transpond, SAT_strength, SAT_flag, SAT_index] = AMPS_MS_RX_PHY_FM(msg, Fc, Fs, chan_num, enable_bits, squelch_thresh) % msg => input message from ADC% Fc => Carrier frequency (MAC input)% Fs => Sampling rate (should be 40 Msps)% chan_num => channel number% enable_bits => a vector that specifies which components in the receiver should be enabled% squelch_thresh => SNR threshold for %% output_sig (to audio output) => recovered audio signal% SAT_transpond => (to MS TX) => recovered SAT% SAT_strength (to MAC) => SAT power measurement% SAT_flag (to MAC) => flag if SAT detected% SAT_index (to MAC) => detected SAT tone #%%============================%MS_RCV_ENABLE Vector%1 = Channelize%2 - CMA%3 = FLL%4 = PLL%5 = FM Demodulation%6 = Deemphasis%7 = Expander%8 = SAT detect%9 = Squelch

70

Page 76:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

%10 = Audio Filter%=================

3.5.3.2Design ConsiderationsThe implemented design (which varies somewhat with the initial design) is shown below. The details for each block were presented in the preceding along with test descriptions. Note the FLL and CMA equalizer are not integrated at this time but will be during FSK development (where the routines could also be used).

De-emphasis

Expander

FLL

PLL

CMA Equalizer

Squelch

SAT Block

FM Demod

Channelization

MS AMPS FM Receiver

Sampled Input

(To MS Transmitter)

(To Link Layer)

(from RF) Audio Output(to speaker)

(From Link Layer)

Audio Filter

Mux

3.5.4 ChannelWhile the channel will not be implemented on any radio, it is critical to the simulation and design of the processes developed. Because of the need to store channel states, there are forward and reverse channel functions which are equivalent except for their states.

3.5.4.1Usage%AMPS_forward_channel%%Implements the specified channel model and stores states between calls.%If communications toolbox is not installed, implements an AWGN channel%%USAGE: [out_msg] = AMPS_forward_channel(msg, model_name, SNR, Fs, fd)% msg => input signal% model_name => channel model name, any comm toolbox channel callable via% the stdchan is acceptable as well as AWGN, Rayleigh, and Ricean% SNR => output SNR% Fs => sampling rate% fd => absolute value of doppler shift%% out_msg => message out of channel (to receive antenna / ADC)

3.5.4.2 Design considerationsIt was desired to support a wide variety of channel models, e.g., line-of-site (AWGN), Rayleigh, Ricean, and more domain specific models where channels can generally be modeled as a time-varying (complex) filter with additive Gaussian noise.

71

Page 77:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

To reduce development time we can make use of Matlab’s communications toolbox which provides several built-in channel models. These include AWGN, Rayleigh, Ricean, and more interestingly, the standard Cooperation in the Field of Scientific and Technical research (COST) models and ITU-approved HF models. The following lists the models known to the communications toolbox.

Because not all platforms may have the communications toolbox and we minimally

3.5.4.3TestingExample channel time domain profiles (created with an all ones vector message and infinite SNR) are shown below.

0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000-40

-35

-30

-25

-20

-15

-10

-5

0

5

10

0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000-70

-60

-50

-40

-30

-20

-10

0

10

72

Page 78:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

Example Rayleigh channel (fd = 100, SNR = 100 dB)

Example Ricean channel (fd = 100, SNR = 100 dB)

The proper operation of additive noise was verified as part of the squelch circuit system testing. With squelch disabled, the following shows the some of the effects of noise on the signals. Note that while there was little benefit to improving SNR beyond 20 dB, at 5 dB, error magnitudes were an order of magnitude larger.

0 500 1000 1500 2000 2500 3000 3500 4000-0.4

-0.2

0

0.2

0.4Original Message

0 2000 4000 6000 8000 10000 12000 14000-1

-0.5

0

0.5

1Transmit Signal

0 500 1000 1500 2000 2500 3000 3500 4000-0.4

-0.2

0

0.2

0.4Receive Signal

0 500 1000 1500 2000 2500 3000 3500 4000-0.4

-0.2

0

0.2

0.4Original Message

0 2000 4000 6000 8000 10000 12000 14000-1

-0.5

0

0.5

1Transmit Signal

0 500 1000 1500 2000 2500 3000 3500 4000-0.4

-0.2

0

0.2

0.4Receive Signal

0 500 1000 1500 2000 2500 3000 3500 4000-0.4

-0.2

0

0.2

0.4Original Message

0 2000 4000 6000 8000 10000 12000 14000-1

-0.5

0

0.5

1Transmit Signal

0 500 1000 1500 2000 2500 3000 3500 4000-0.4

-0.2

0

0.2

0.4Receive Signal

AWGN 100 dB AWGN 20 dB AWGN 5 dB

0 500 1000 1500 2000 2500 3000 3500 40000

0.5

1

1.5

2

2.5

3x 10

-3 |Message - Received|2

0 500 1000 1500 2000 2500 3000 3500 40000

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2x 10

-3 |Message - Received|2

0 500 1000 1500 2000 2500 3000 3500 40000

0.002

0.004

0.006

0.008

0.01

0.012|Message - Received|2

100 dB 20 dB 5 dB

3.5.5 Reverse Test (AMPS_reverse_link_test.m)This is a test script for simulating the reverse link (MS->BS) FM physical layer. It acts as a “MAC” of sorts to set all of the parameters for the MS transmitter, BS receiver, and channel (e.g., SNR). It also moves the necessary data between the functions and calls the appropriate post-processing scripts.

3.5.5.1UsageAs this is not a function, edits to the forward link should be done by directly modify the script.

3.5.6 AMPS Mobile System Transmitter (AMPS_MS_PHY_TX.m)Implements a block-by-block AMPS MS transmitter for the reverse link at the physical layer.

73

Page 79:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

3.5.6.1Usage%AMPS_MS_FM_PHY_TX%Implements the AMPS Mobile Station Transmitter Physical Layer FM Waveform%%USAGE: [output_sig, comb_sig] = AMPS_BS_TX_PHY_FM(msg, SAT_sig, Fc, Fs, chan_num, enable_bits)% msg => input message from vocoder% SAT_sig => transpoded SAT% Fc => Carrier frequency (MAC input)% Fs => Sampling rate (should be 40 Msps)% chan_num => channel number% enable_bits => a vector that specifies which components in the receiver should be enabled%% output_sig => upconverted signal% [optional] comb_sig => pre-mod signal (for debugging)%%============================%BS_XMT_ENABLE Vector%1 = compressor%2 - pre_emphasis%3 = deviation limiter%4 = limiter filter%5 = FM Modulation%6 = Upconvert%7 = ST Generate%=================

3.5.6.2 Design ConsiderationsThe implemented design (which varies somewhat with the initial design) is shown below. The details for each block were presented in the preceding along with test descriptions.

Pre-emphasis

Compressor

DeviationLimiter

PostDeviationFilter FM Mod

MS AMPS FM Transmitter

Sampled Voice Input

(to Channel)

(from Link Layer)

(From Link Layer)Carrier

Upconvert

ST Generate

TranspondedSAT ST Enable

74

Page 80:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

3.5.7 AMPS Base Station Receiver (AMPS_BS_FM_PHY_RX.m)Implements a block-by-block AMPS BS FM receiver for the reverse link at the physical layer.

3.5.7.1Usage%AMPS_BS_FM_PHY_RX%Implements the AMPS Mobile Unit Station Receiver Physical Layer FM Waveform%%USAGE: [output_sig, SAT_strength, SAT_flag, SAT_index] = AMPS_BS_RX_PHY_FM(msg, Fc, Fs, chan_num, enable_bits, squelch_thresh) % msg => input message from ADC% Fc => Carrier frequency (MAC input)% Fs => Sampling rate (should be 40 Msps)% chan_num => channel number% enable_bits => a vector that specifies which components in the receiver should be enabled% squelch_thresh => SNR threshold for %% output_sig (to audio output) => recovered audio signal% SAT_strength (to MAC) => SAT power measurement% SAT_flag (to MAC) => flag if SAT detected% SAT_index (to MAC) => detected SAT tone #% ST_detect (to MAC) => if ST_detected (1,0)% ST_strength (to MAC) => ST strength%%============================%BS_RCV_ENABLE Vector%1 = Channelize%2 - CMA%3 = FLL%4 = PLL%5 = FM Demodulation%6 = Deemphasis%7 = Expander%8 = SAT detect%9 = Squelch%10 = Audio Filter%11 = ST detect%=================

3.5.7.2Design ConsiderationsThe implemented design is shown below. The details for each block were presented in the preceding along with test descriptions. Note the FLL and CMA equalizer were finalized as part of the FSK development.

75

Page 81:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

De-emphasis

Expander

FLL

PLL

CMA Equalizer

Squelch

SAT Block

FM Demod

Channelization

MS AMPS FM Receiver

Sampled Input

(To Link Layer)

(from RF) Audio Output(to speaker)

(From Link Layer)

Audio Filter

Mux

ST Block

76

Page 82:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

4 SCWA SimulationThe SCWA is a multi-element, multi-band antenna array with elements that enable wideband operation at low frequencies. This portion of the project is developing an HF prototype that will utilize only a single antenna element per transmitter as part of a dual transceiver system as shown in Error: Reference source not found.

Figure 29: Block diagram of HF System

This simulation effort is focused on modeling the behavior of the tuner / transmit antenna pair for a single transceiver as the receive antenna’s response is fairly consistent while the transmit branch’s gain will vary with the environment and with changes created by the tuner. This allows the development effort to:

Create and use realistic link gain models for the simulated system Model the timing requirements for controlling the tuner.

The following discusses

4.1 Modeled SystemThe modeled system (shown in Figure 30) consists of two primary components – a tuner block and an antenna gain block – though implicitly, there needs to be a third block to control the tuner. Because the auto-tuner does not support handshaking with the FlexRadio 5000A, the tuner can only respond to

77

Page 83:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

Figure 30: The modeled system consists of an antenna gain block, a tuner block, and a control block. The tuner block . Pending final antenna characterization, the antenna block link gain is modeled as an isotropic

antenna with gain of 0 dBi whose output power is reduced due to VSWR effects.

4.2 Modeling ConsiderationsThere are two components modeled in our transmit antenna system model – the tuner and the antenna (which also models feedline loss). The following discuss these in more detail.

4.2.1 Modeling Tuner BehaviorThe modeled PALSTAR Auto-tuner uses a T-network with a tunable capacitor and a rolling inductor to achieve a tuning range of 1.8 MHz to 54 MHz. The rolling inductor is initially used for coarse repositioning after which the tuner and capacitor are fine tuned to achieve a target VSWR. When tuning to a known frequency (the auto-tuner can store up to 500 positions – which we’re treating as infinite in our simulation models), the past learned configuration will be recalled and tuning is very short and the system VSWR should be less than the target VSWR. When tuning to an unknown frequency, however, the process can take longer and the VSWR can vary greatly. While not noted in the documentation, others have reported T-networks with a maximum pull-in (fine-tuning) range of about 3:1.3 Accordingly, we model the initial VSWR post-coarse-positioning as a uniform random variable drawn from the range [1, 3] and expected VSWR as steadily decreasing at a rate that assumes an expected time to cover the range of tunable VSWRs within half of the tuner timeout period (20 seconds).

Once the target VSWR is achieved, the auto-tuner stores those values (C,L) and ceases to make adjustments unless the VSWR rises above some other higher threshold at which point it will begin tuning again. While in the tuning or tuned state, the tuner defaults to being inline with the antenna; and while repositioning, the tuner goes into a bypass mode to limit the amount of energy that is splayed into other bands. While in bypass mode, VSWR can be very high (though relatively fixed) and this is modeled by assigning VSWR an initial value a uniform random variable drawn from the range [1, 16] (a configurable parameter) which is corrupted by additive Gaussian noise while the tuner remains in the bypass state.

By default, the tuner comes programmed with a target VSWR threshold set at a ratio of 1.05 and a threshold to go into tuning mode at 1.2 and is modeled as such, even though the antenna itself is expected to operate with a VSWR of around 2. This, however, is easily modifiable in the simulation code.

3 http://www.ab4oj.com/atu/main.html

78

Page 84:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

We model this behavior of the tuner as a two state machines, a tuning state machine, and a bypass mode state machine. The tuning state machine is a three state machine – positioning where the rolling inductor is repositioned, tuning where fine tuning of the inductor and capacitor occur, and a tuned state where the tuner does not adjust the T-network. When in the positioning state, the tuner goes into a bypass mode which takes the T-network out of the transmission path to cut down on the amount of energy that is transmitted at off-frequencies during tuning. When positioning is complete, the tuner is brought back in line with the transmission path.

Figure 31: Operational States of Tuner. The tuner has three tuning states – positioning where the rolling inductor is repositioned, tuning where fine tuning of the inductor and capacitor occur, and a tuned state

where the tuner does not adjust the T-network. When in the positioning state, the tuner goes into a bypass mode which takes the T-network out of the transmission path to cut down on the amount of energy that is

transmitted at off-frequencies during tuning. When positioning is complete, the tuner is brought back in line with the transmission path.

Table 2: Tuning state transitions

To From ConditionPositioning Tuned New input frequencyPositioning Tuning New input frequencyPositioning Tuning Tuning timeout (>20 seconds default)Tuning Positioning Arrived at desired frequencyTuning Tuned VSWR exceeds threshold (1.2 default)Tuned Tuning VSWR below threshold (1.05 default)

These states define the operating VSWR and behavior of the tuner. In the tuned state, VSWR is corrupted by an additive low-variance noise process, but not no tuning occurs in response to this unless VSWR exceeds a predefined threshold.

79

Page 85:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

4.2.2 Antenna Behavioral ModelingThe antenna behavioral model is intended to create estimates of the ratio of usable radiated power to input power. At the antenna, this is roughly the square of the reflection coefficient multiplied by the antenna gain, though the power at the antenna has to be decreased by the feedline loss.While the antenna characterization is ongoing, it is being modeled as an isotropic antenna with a dBi or 0 dB and perfectly flat frequency response (i.e., the gain is 1 for all inputs). When this data becomes available, the model will be revisited.

Because of this consideration, the fraction of RF power that passes through the ATU that actually radiates from the antenna is dominated by VSWR and feedline losses. Thus a simple model of the antenna / tuner system is appropriate, such as the one shown in Figure 32 which considers input power, output power, feedline loss and VSWR.

Figure 32: A simple model of the antenna / tuner system.

The power radiated by the antenna (power out or Pout) can calculated for this model as

where Pfwd is the forward power measured at the ATU, Pret is the return power measured at the ATU, Att is the linear attenuation of the feedline converted from Lf in dB, and G is the antenna gain (identically 1 in the current model). The ATU will then report a VSWR as

which can be used to calculate a measured (not actual!) reflection coefficient, , as

which then gives the relationship between forward and reverse power referenced to the ATU as

So provided with a VSWR measured by a modeled tuner, the antenna model first calculates , then (where Pfwd is set at 1 so the output power ratio can be calculated) which is then used to calculate yielding the desired output power ratio.

80

Page 86:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

4.3 File ListingThe following gives a listing of the files included in the included release with a brief description of its function. Details on design, use, and testing are given in subsequent sections.

Get_antenna_gain.m Model of TX ANT / Tuner system o Antenna_model.m Model of antenna gaino PALSTAR_auto_tuner_model.m Model of tunero Tuner_model_test.m A test script for the code

4.4 Functional Component DescriptionsThe following components (functions) are necessary to realize the simulation of the modeled system.

Integrated system Antenna model Tuner Model

The following gives a brief description of each component (function), its inputs and outputs, and its operation. For relatively simple processes, the operation is described in the following subsections; more complicated processes are referenced to external documents.

4.4.1 Integrated systemThe integrated system provides a common interface for both the tuner and antenna models and when given a specified time and frequency, returns the fraction of input power that is radiated (called gain for simplicity of notation).

Figure 33: Block diagram of antenna system model. Time stamps and frequencies are input to the system and antenna “gains” are returned. “Gains” refer to the fraction of input power that is radiated.

4.4.1.1 UsageP_out = get_antenna_gain(t, freq)

4.4.1.2 Inputst => time when request is made

81

Page 87:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

f => frequency at which request is made

4.4.1.3 Internal VariablesAtt_dB // feed loss in dBPfwd // Input power, defaults to 1 for ratio

4.4.1.4 OutputsPout => fraction of input power that is radiated

4.4.1.5 OperationGiven the time and frequency, the system calls the tuner to get a VSWR and the antenna model to get a gain, and then calculates the output power ratio as described in Section4.2.2.

4.4.2 Antenna modelThe antenna model is called to calculated the antenna gain as a function of time and frequency. Currently, the model is an isotropic antenna with a dBi of 0 dB and flat frequency response. This will change after antenna characterization is complete.

4.4.2.1 UsageG = Antenna_model(curr_time, desired_f)

4.4.2.2 InputsCurr_time => time when request is madeDesired_f => frequency at which request is made

4.4.2.3 Internal VariablesNone

4.4.2.4 OutputsG (G=1) => antenna gain (linear).

4.4.2.5 OperationGiven the time and frequency, the antenna model returns a link gain value

4.4.3 Tuner modelThe tuner model represents a PALSTAR 1500 W auto-tuner. It is described in more detail

4.4.3.1 Usage[VSWR, bypass_flag] = PALSTAR_auto_tuner_model(curr_time, desired_f)

4.4.3.2 InputsCurr_time => time when request is madeDesired_f => frequency at which request is made

4.4.3.3 Internal Variables%INTERNAL VARIABLES persistent local_state; %'positioning', 'tuning','tuned'persistent local_time; %Time when function was last called

82

Page 88:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

persistent local_VSWR; %LAST VSWR (used to estimate noise levelpersistent positioning_VSWR; %VSWR while positioningpersistent pull_in_VSWR; %Maximum VSWR which tuner might be in post-

positioningpersistent known_freqs; %Table of known frequenciespersistent target_f; %To where the tuner is movingpersistent local_f; %The frequency that the tuner is actually

tuned forpersistent VSWR_tuned; %VSWR at which tuner switches from tuning to

tuned (default 1.05)persistent VSWR_tuning; %VSWR at which tuner switches from tuned to

tuning (default 1.2)persistent tuning_start_time; %Time at which tuning starts (needed for

timeout)persistent tuning_timeout; %Duration for uncompleted tuning wher system

times outpersistent positioning_constant;%Amount of time to double (half) frequency

when positioningpersistent min_tuner_freq; %minimum tunable frequencypersistent max_tuner_freq; %maximum tunable frequencypersistent noise_var; %noise variance on VSWR estimates

4.4.3.4 OutputsVSWR => VSWR level[1,)Bypass_flag => If bypass mode is enabled {0,1}

4.4.3.5 OperationGiven the time and frequency, the antenna model returns VSWR. The tuner model represents a PALSTAR 1500 W auto-tuner. It is described in more detail in Section 4.2.1.

4.5 Example simulation resultsAn example output from the test script is shown below. Note that this has not been validated against the final PALSTAR Auto-tuner as it is still under development.

83

Page 89:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

Figure 34: Output from simulation of antenna-tuner system over three frequency changes (two to unknown frequencies).

4.6 References[Palstar_09] Palstar, “AT-AUTO & AT-AUTOKL Operating Manual Firmware Version 2.10,” July 2009. Available online: http://www.palstar.com/AT-AUTO%202_10%20REV%2020_JULY_2009.pdf

84

Page 90:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

5 Link Layer SimulationIn the demonstration setup, two communications systems will be used – one stationed in DTI’s facilities in Jackson, MS and another at the end-customer’s premises in Colorado as illustrated in Error: Reference source not found. The link will be managed and controlled by the system in Jackson, MS with guidance from the station in Colorado. The system in Jackson, MS will track and store all performance statistics during the demonstration to allow for verification of operation at the end of the 24-hour demonstration. During its operation, it is expected that the communications link’s carrier frequency will need to shift between a 2 MHz band and a 6 MHz band and back again.

The movement of the frequencies between bands while implementing a make-before-break link handoff and the initial automatic link establishment (ALE) are part of the link layer simulation and are notionally treated separately from the modem PHY simulations. Specifically the Link layer is responsible for the following functions:

Handoffs – switching between bands without disrupting communications Rendezvous (automatic link establishment) – wherein the master and slave nodes

automatically find each other upon initialization Sensing and measurement – to quantify channel quality Scanning – to search for stations and to ensure measurements are taken across a wide

variety of channels Packetization – to facilitate packet based communications and to allow for eventual

insertion of techniques such as ARQ

Additionally, we are in the process of incorporating predictive HF models to enable the link to stay ahead of changes in the ionosphere.

85

Page 91:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

Figure 35: Planned HF predictive capability will use Ionosphere prediction models and link layer services to adjust frequencies in anticipation of changes in the HF environment. (PowerSDR is the software environment

that comes with the FlexRadio)

The remainder of this section discusses the design and simulation of the link layer components.

5.1 General Simulation MethodologyUnlike the preceding pieces which currently heavily incorporate Matlab, this code does not. Due to the tight time constraints and the fact that deployment will be on general purpose processors in the HPCS, development is proceeding directly in C (within Visual Studio 2008 on a Windows platform as needed for the FlexRadio drivers). As such, the source files for deployment are also the simulation files which should reduce transition time. However, this greatly complicates visualization which Matlab excels at, so plots are minimal in this section. Eventually (possibly after demonstration), Mex wrappers will be placed around the C code to allow the code to be interfaced in Matlab to the remaining components in the simulation.

86

Page 92:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

5.2 Link Layer Overview Communications Channels

5.2.1 The Primary Data Channel The primary link consists two logical channels a payload data channel and a maintenance channel. The primary channel provides the means of payload communications over the data link and is also referred to as the communicate mode. The first logical channel is the primary data channel. The primary data channel is a continuous stream of payload packets called link payload packets (LPPs). Each LPP contains a packet identifier, packet number and payload information. The format for the LPP packet is contained in the section called Link Payload Packet (LPP). The master controller starts the primary state machine in the “Start Payload Packets State” when it wants to start the LPP packet flow on a link. After the primary state machine is started it transitions to the “Continue Payload Packets State” where is remains while servicing the requests from the FSK modem for more data. The flow diagram for the primary state machine is shown in Figure 36 below.

Figure 36: Primary Channel State Machine

5.2.2 The Maintenance Channel The second logical channel is the link maintenance channel made up of periodic control packets called forward link maintenance packets (FLMP)s. The maintenance channel sends control information from the master to the slave transceiver and tells the slave when and at what RF channel to switch during a handoff or during scanning. The FLMPs allow the master to gain information concerning the integrity of the secondary RF channels. The reverse link maintenance channel RLMPs provide a means for the slave to acknowledge the commands from the master and send link integrity information back to the master. The format for the FLMP packet is contained in the section called Forward Link Maintenance Packet (FLMP). The format for the RLMP packet is contained in the section called Reverse Link Maintenance Packet (RLMP).

5.3 Major node processesThe master node of the link is made up the functional components illustrated in Figure 37. The master controller consists of the master state machine which directs and decides the state of each of the primary and secondary links. Two identical forward link controllers direct the state of their corresponding FSK modems. The forward link controllers build and send the link packets and

87

Page 93:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

FLMPs. The two RLMP processors receive the reverse link maintenance packets and make that information available to the link integrity calculator. The link integrity calculator uses the information contained in the RLMPs to allow the master controller to decide the operating channel.

Figure 37: Master Node Functional Components

The source files which will implement the functional components of the master node blocks are listed in Table 3.

88

Page 94:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

Table 3: Source Files of the Master Node Blocks

Master Node Blocks Associated Source FilesMaster Controller master_controller.cLink Integrity Calculator link_integrity.cForward Link Controller forward_link_controller.cPrimary Link State Machine primary_state_machine.cScanning State Machine scan_state_machine.cTransition State Machine trans_scan_to_primary_state_machine.cPack Link Payload Packet build_send_LPP.cPack Link Management Packet build_send_FLMP.cPacket TX processor master_send_packet.cMaster Payload Processor master_payload_processor.cRLMP processor master_process_RLMP.cPacket RX processor master_receive_packet.c

A similar design is envisioned for the slave node whose functional components are shown in Figure 38. The slave controller consists of the slave state machine which directs the state of each of the two reverse link controllers and the Slave payload processor. The two reverse link controllers and two the LPP/FLMP processors are identical. These functional blocks control their associated FSK modems. The payload processor merges the two streams of payload packets (LPPs) to create the output file.

89

Page 95:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

Figure 38: Slave Node Functional Components

The source files that will implement the functional components of the slave node blocks are listed in Table 2.

Table 4: Source Files of the Slave Node Blocks Slave Node Blocks Associated Source Files

Slave Controller slave_controller.cReverse Link Controller reverse_link_controller.cPack RLMP build_send_RLMP.cTransmit Pakcets slave_send_packet.cLPP/FLMP Processor slave_receive_packet.cSlave Payload Processor slave_payload_processor.c

5.4 HandoffsMake-before break handoffs (where the new link is established before the old link is taken down) is a critical capability to ensure uninterrupted communications as operating frequencies are changed. The following describes key processes involved with making handoffs.

5.4.1 Measuring Signal QualityA handful of processes are being implemented to measure channel quality. The parameters collected by the communication system and used to evaluate link quality are the following:

SNR (based on received signal strength (RSS) and noise power estimates), an estimate of the raw bit error count, sometimes referred as the un-coded bit error count,

90

Page 96:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

packet loss.

The measurements for calculating RSS will be formed by a modified leaky integrator measuring baseband power that will be adjusted by the settings for the automatic gain control process, which will need to be adjusted for the FlexRadio specific gain levels. Completing the SNR measurements will be the estimates of noise power used in the current squelch processes. The estimate of the raw bit error count is derived from the bit voting process implemented in the baseline FSK waveform and summed over a packet. The accuracy of these two parameter estimates will be improved using moving average filters. Packet loss will be determined using a counter that tracks packet sequence (ranges from 0 to 216-1). Loosely, these measurements will be used to define 4 operating regions (three thresholds) as shown below which will aid in the handoff process which will be controlled by the master controller.

EXCELLENT: SNR> 20 dB AND RAW > 0.005 (10 errors)

GOOD:10 dB < SNR < 20 dB OR 10 errors < RAW < 100

POOR:SNR < 10 dB AND RAW > 100

UNUSABLE:SNR < 0 dB OR PACKET LOSS

5.4.2 Handoff State MachineThe system employs two communications links whose role as the primary or secondary link changes over time to implement a handoff. The following describes the state machine for the system.

After booting up, the system puts both links into scan mode to determine the state of available RF channels. The master controller state machine on Figure 39 below shows the processing flow. The master controller makes transition number 1 to enter the circle state labeled S,S. The circle indicates that this state is a transition state and will be denoted in text as (S,S). The transition state (S,S) provides a transition to the regular link 1 scan and link 2 scan state indicated by [S,S]. The square in the figure indicates a regular state as do square brackets in the text. The transition state allows for the setup and configuration of the regular states and provides a state to insure switch over acknowledgement packets have arrived before normal operation may proceed. Next the master controller makes transition number 2 to state regular state [S,S]. Regular state [S,S] is the state in which link 1 scan and link 2 are scanning. Following the boot up and scanning processes, the master accumulates link quality information and determines the RF channel for the primary link and begins payload data packet transmission. The master continues the scanning process on the secondary link. The master makes state transition decisions based on the boundaries defined in the preceding section.

91

Page 97:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

Table 5: Link integrity threshold descriptions

Operating Regions Assumed Link Quality Handoff EffectCommunications

Effect3 Excellent No Handoff Maximum Data Rate2 Good Prepare for handoff Normal Data Rate1 Minimal Acceptable Execute Handoff Minimum Data Rate

0 Unacceptable Search for opportunities Maintenance only

Figure 39: Master Controller State Machine where a circle state indicates a transition state and a square indicates a regular state

Descriptions for the states of the Master Controller are listed in Table 6 below.

92

Page 98:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

Table 6: Master Controller State Descriptions

State Description(S,S) Transition into Link 1 scan, Link 2 scan

[S,S] Link 1 scan, Link 2 scan (no suitable communications channel can be found)

(C,S) Transition into Link 1 communicate , Link 2 scan[C,S] Link 1 communicate, Link 2 scan(S,C) Transition into Link 1 scan Link 2 communicate[S,C] Link 1 scan , Link 2 communicate(C,C) Transition into Link 1 communicate, Link 2 communicate

[C,C] Link1 communicate, Link 2 communicate (making the alternate connection prior to handoff)

The criteria to perform each of the state transitions are described in Table 7. The transition states indicated with a Circle allow for a smooth transition from the channel being scanned to the new desired primary. The transition state is exited when an acknowledgement of the FLMP is received. In general, before taking any change in operation (e.g., operating frequency or state), the master will signal the change to the slave and await confirmation via an acknowledgment packet before implementing the change. This will enhance link reliability and reduce the possibility for interrupted communications.

93

Page 99:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

Table 7: State Transitions Criteria

State Transition Number

Exit State

Enter State Criteria

1 Enter (S,S) Enter the transition state to put both links in scan mode.2 (SS) [S,S] FLMP ACK

3 [S,S] (C,S) If the quality of link 1 rises above threshold 2 then transition to link 1 primary.

4 (C,S) [C,S] If the quality of link 2 rises above threshold 2 then transition to link 2 primary.

5 [S,S] (S,C) FLMP ACK

6 [C,S] (C,C)If the quality of link 1 drops below threshold 1 and the quality of link 2 is above threshold 1 then transition to both link 1 and link 2 in primary state

7 (S,C) [S,C] FLMP ACK

8 [S,C] (C,C) If the quality of link 2 drops below threshold 1 and the quality of link 1 is above threshold 1 then transition to both link 1 and link 2 in primary state

9 (C,C) [C,C] FLMP ACK

10 [C,C] [S,C] If the quality of link 2 rises above threshold 2 then link 1 transitions to scan

11 [C,C] [C,S] If the quality of link 1 rises above threshold 2 then link 2 transitions to scan

12 (C,S) (S,S) If the quality of both links should drop below threshold 0 then transition to both links in scan (rendezvous)

13 (S,C) (S,S) If the quality of both links should drop below threshold 0 then transition to both links in scan

5.4.3 The Scanning Process The scanning process allows the Master to collect information concerning the quality of a given set of RF channels. Loosely we are envisioning scanning over 3 frequency pairs in the 2 MHz band and 3 frequency pairs in the 6 MHz band, though this will be software definable. By looking at alternate channels in band and across bands, this will allow the system to accommodate frequency selective fading and band changes as the day progresses.

The scanning process is described below. Forward Link Maintenance Packets (FLMPs) are sent out by the master on the secondary link in the scan state. The FLMPs specify the RF channel on which the slave should move when it receives the switch command from the master. The slave prepares to receive the next FLMP on the new RF channel when it receives the switch command. Upon receiving a FLMP the slave will send an acknowledgement packet called the Reverse Link Maintenance Packet (RLMP). The acknowledgement packet confirms to the master that the slave will switch to the next RF channel. The master controller begins the flow of maintenance packets by executing the “Scan State Machine” shown in Figure 40 below. The “Scan State Machine”

94

Page 100:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

starts by sending out an FLMP and then waits some time before sending out additional FLMPs. The state machine performs a channel switch by sending switch packets.

Figure 40: Scanning State Machine

5.4.4 RendezvousThe rendezvous process allows the master and slave nodes to initially find each other and to reestablish a connection if the link is broken. This process is executed at boot up or when the link integrity levels for both primary and secondary links fall into the POOR quality regions. The master node transmitter link will remain on a single frequency transmitting FLMPs until the slave has had ample time to listen to the available RF channels. Should no suitable RLMP acknowledgement packets be received, the master would select the next available RF channel and continue sending FLMPs. The process would continue until acknowledgement RLMPs are received and the scanning process can be executed. To aid this process, the master node will intermittently transmit a set of backup channels to the slave node.

5.5 Packet StructureBoth the primary and secondary links will transmit messages using packets. This will allow for eventual inclusion of ARQ protocols and to verify that nothing is lost during handoffs by allowing for packet sequences to be aligned. The packets will be separated into link payload packets (LPP) and Link Maintenance Packets (LMP) for the forward (FLMP) and reverse (RLMP) packets. Note that to allow for comparisons between the current operating link (primary) and candidate channels identified by the secondary link, maintenance packets that carry measurement data and commands will also be carried over the primary link

5.5.1 Link Payload Packet (LPP)This describes the over the air packet in the FSK data link. The packet sends 32 words (128 bytes of information). This packet transfers the payload information and makes use of the following conventions:

Word 0 Packet Identifier => 13 (increments with each packet) Word 1 Packet count => incremented by one for each packet transmitted Words 2 thru 31 Data words => 4 bytes packed in each 32 bit word Words 35 and 36 Null words => 00

95

Page 101:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

The structure for a LPP is shown in Table 8

Table 8: LPP Format

Byte0 Byte1 Byte2 Byte3Word 0 Pkt IDWord 1 Pkt countWord 2 Data word 0 DataByte DataByte DataByte DataByteWord 3 Data word 1 DataByte DataByte DataByte DataByte

Word 34 Data word 31 DataByte DataByte DataByte DataByteWord 35 Null word 0 0 0 0Word 36 Null word 0 0 0 0

5.5.2 Forward Link Maintenance Packet (FLMP)

This describes the over the air packet in the FSK data link. The packet sends 32 words (128 bytes of information).

Table 9: Forward Link Maintenance Packet

Byte0 Byte1 Byte2 Byte3Word 0 Pkt IDWord 1 Pkt counterWord 2 Command IDWord 3 SwitchWord 4 RF channelWord 5 RF channelWord 6 Slave TX level.

Word 34 Data word 31Word 35 Null word 0 0 0 0Word 36 Null word 0 0 0 0

Word 0 Packet Identifier => 15 Words 1 Packet Counter => packet counter Word 2 Command ID => identifies the type of maintenance command Word 3 Switch frequency Words 3 and 4 Next RF channel => number indicating the next TX/RX pair the slave

processor should use. Word 5 Next Slave TX level => number indicating the next power level the slave should

use.

96

Page 102:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

Words 5 thur34 Unused Words 35 and 36 Null words => 00

5.5.3 Reverse Link Maintenance Packet (RLMP)This describes the over the air packet in the FSK data link. The packet sends 32 words (128 bytes of information).

Table 10: Data Message Format

Byte0 Byte1 Byte2 Byte3Word 0 Pkt IDWord 1 Pkt counterWord 2 Command_IDWord 3 Slave RF channelWord 4 Switch Word 5 Slave TX level.Word 6 Forward channel RSSIWord 7 LPP/FLMP Pkt number Word 8 LPP only (one for each packet )

BCH error count

Un-codedBit errors

Word 9 LPP only (one for each packet )

Pkt number

Word 10 LPP only (one for each packet )

BCH error count

Un-codedBit errors

Un-codedBit errors

0xff 0xff 0xff 0xff

Word 33 0xff 0xff 0xff 0xffWord 34 Null word 0 0 0 0Word 35 Null word 0 0 0 0

Word 0 Packet Identifier => Acknowledgement identifier for RLMP = 14 Word 1 Packet counter => returns the packet count sent on the forward link. Word 2 Maintenance command identifier=> type of maintenance command indicates the

type of packet being acknowledged4=> FLMP5=>LPP

Word 3 and 4 Slave RF channel => RF channel slave is on. Words 5 Slave Tx level => power level of slave. Word 6 Forward channel RSSI => received signal level of forward channel. Word 7 Packet number to be acknowledged Word 8 Signal quality information of packet to be acknowledged (BCH and Un-coded

bit error count) Word 9 Repeat 7 for each packet to be acknowledged Word 10 Repeat for each packet to be acknowledged.

97

Page 103:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

5.6 File ListingThe following gives a listing of the files included in the included release with a brief description of its function. Details on design, use, and testing are given in subsequent sections.

Build_send_FMP.c Creates a FLM packet from data vector Build_send_LPP.c Creates a LP packets from data vector Build_send_RLMP Creates a LP packets from data vector Destination_payload_processor.c Merges packet streams at master or slave Filters.c Used to smooth out bit error estimates Link_integrity.c Performs link integrity calculation Main.c Initializes simulation and starts state machine Master_controller.c Implements the master controller node processes Master_receive_packet.c Initial point for packets before processing Master_rx_link_controller.c Main master rx packet handler Master_send_packet.c Main master tx packet handler Master_tx_link_controller.c Controls mode of transmit links Primary_state_machine.c Generates packets at specified intervals for Read_config.c Sets input / output files for simulation Scan_state_machine.c Determines timing for scanning and packets, choice

of RF for sounding Slave_controller.c Main state machine for slave Slave_receive_packet.c Interface from modem Slave_rx_link_controller.c Controls modes of receive links at behest of master Slave_send_packet.c Formats and sends packets to modem Slave_tx_link_controller.c Controls modes of transmit links at behest of master Source_payload_processor.c Reads files for data SW_init.c Initializes state machines and counters Sys_globals.h Stores all common variables Sys_state_machine.c Main state machine for entire link

5.7 Functional Component DescriptionsThe following components (functions) are necessary to realize the simulation of the modeled system.

Integrated system Antenna model Tuner Model

The following gives a brief description of each component (function), its inputs and outputs, and its operation. For relatively simple processes, the operation is described in the following subsections; more complicated processes are referenced to external documents.

5.7.1 Build_Send_FLMPBuilds a FLMP (Forward Link Maintenance Packet) packet and stores it in specified location and sends it to the specified link. Note this packet does not carry a payload and is used solely to take a channel sounding to measure link quality.

98

Page 104:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

5.7.1.1Usagevoid build_send_FLMP(int link_id, MODE_PARAMETER_STORAGE *mode_storage)link_id : ID (1,2) of link to send out packetmode_storage: Where packet data is stored.

5.7.1.2Design considerationsThe packet structure is shown below. More details are available in Section 5.5.2.// structure for an FLMP/*• Word 0 Packet Identifier => 15• Word 1 Packet Counter• Words 1 Command ID => identifies the type of maintenance packet• Word 2 Switch frequency flag• Words 3 and 4 Next RF channel => number indicating the next TX/RX pair the slave processor should use. • Word 5 Next Slave TX level => number indicating the next power level the slave should use.• Words 5 thur34 Unused• Words 35 and 36 Null words => 00

5.7.2 Build_Send_LPPBuilds a Link Payload packet and stores it in specified location and sends it to the specified link. Note this packet does not carry a payload and is used solely to take a channel sounding to measure link quality.

5.7.2.1Usagevoid build_send_LPP(int link_id, MODE_PARAMETER_STORAGE *mode_storage) link_id : ID (1,2) of link to send out packetmode_storage: Where packet data is stored.

5.7.2.2Design considerationsThe packet structure is shown below. More details are available in Section 5.5.1.//LPP_STORAGE LPP_packet;

// structure for an FLMP/*• Word 0 Packet Identifier => 13• Word 1 Packet Counter• Words 5 thur34 Unused• Words 35 and 36 Null words => 00

5.7.3 Build_Send_RLMPBuilds a RLMP (Reverse Link Maintenance Packet) packet which acknowledges a FLMP and stores it in specified location and sends it to the specified link. Note this packet does not carry a payload and is used solely to take a channel sounding to measure link quality.

5.7.3.1Usagevoid build_send_RLMP(

int link_id,// link identifier

99

Page 105:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

int type_of_ack,//type of acknowledgement 0= LPP 1= FLMPRLMP_STORAGE *slave_RLMP_packet, //pointer to packet to return FLMP_STORAGE *slave_FLMP_packet) //pointer to packet to received

5.7.3.2Design considerationsThe packet structure is shown below. More details are available in Section 5.5.3..// RLMP_STORAGE slave_RLMP_packet;/*• Word 0 Packet Identifier => Ack for forward channel packet 14• Word 1 Packet Counter• Word 2 maint_packet_ID• Word 3 Slave RF channel => RF channel slave is on.• Word 4 Slave RF channel => RF channel slave is on.• Word 5 Slave Tx level => power level of slave.• Word 6 Forward channel RSSI => received signal level of forward channel.• Word 7 Forward channel un-coded bit error count• Word 8 Forward channel BCH error count.*/

5.7.4 Destination Payload ProcessorThe destination payload processor merges the two data streams if needed during handoffs as part of the make-before-break process where multiple communications streams are temporarily active.

5.7.4.1Usagevoid destination_payload_processor(

int link_num, // link 1 or 2LINK_PARAMETER_STORAGE *link_storage) // pointer to storage

5.7.4.2Design considerationsSee the section on handoff design (Section 5.4).

5.7.5 Bit Error Count FiltersThis routine includes filters for bit error counts

5.7.5.1Usageint bec_filter(int RF_channel //channel where error count is fromint input_val // number of errors)

Returns filtered number.

Internal Variables4

extern int link_status_RSSI[]; // RSSI of each channelextern int link_status_RAW_bec[]; // RAW un-coded bit error countextern int link_status_BCH_error_cnt[]; // BCH bit error cntextern int link_status_Packets_in_row[]; // Packets in a row lostextern int link_status_LPR[]; // lost packet rateextern int link_status_TLP[]; // total lost packets

4 Here, they’re technically shared between

100

Page 106:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

#define BEC_FILTER_LEN 5static int bec_filter_data_array[MAX_NUM_RF_CHANNELS][BEC_FILTER_LEN]={0};static int bec_y_output[MAX_NUM_RF_CHANNELS]={0};

5.7.5.2Design considerationsTo reduce the impact of noise spikes and brief channel fades, filters can be used to smooth out the estimates. In this case a simple moving average (strictly, a moving sum) is used. A different estimate is kept for each allowable channels for up to MAX_NUM_RF_CHANNELS (defined in sys_globals.h).

5.7.6 Link IntegrityDetermines the quality of the link by mapping several measurements into a discretized judgement of link quality. See Section 5.4.1 for more information.

5.7.6.1Usagevoid determine_link_integrity(

LINK_PARAMETER_STORAGE *link_storage, //structure of link parametersLINK_INTEGRITY_STORAGE *link_integrity) //structure of measurements

5.7.6.2DesignSee Section 5.4.1 for more information.

5.7.7 Master / Slave Link ControllerConfigures each link to either be in scan or communications mode based on link quality and handoff requirements. Slave responds to commands from packets sent by master

5.7.7.1Usagevoid master[slave]_controller(

MASTER_PARAMETER_STORAGE *master_storage, // logging for master node LINK_PARAMETER_STORAGE *link1_storage, // logging for link 1LINK_PARAMETER_STORAGE *link2_storage) // logging for link 2

Internal Variables:LINK_INTEGRITY_STORAGE link1_integrity; // quality of channels in link 1 LINK_INTEGRITY_STORAGE link2_integrity; // quality of channels in link 2

5.7.7.2DesignLargely, this is implementing the master node state machine and calling relevant functions to make state transition determinations. Note that either link 1 or link 2 may be primary or scanning depending on which link has the better link quality and hysteresis effects. See Section 5.3 for more information.

5.7.8 Master / Slave Receive PacketThis acts as the interface between the PHY modems and the receive portion of the link layer. Takes packet from receiver and identifies format for use by other node processes.

101

Page 107:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

5.7.8.1Usagevoid Void Master[slave]_receive_packet(int link_id, PACKET_FROM_RECEIVER *master[slave]_rec_packet)

Accesses reverse_link1[2]_ota_packet for actual packet information.

5.7.8.2DesignSee Section 5.5.

5.7.9 Master / Slave Rx Link ControllerUnpacks received packets by packet type and updates link status.

5.7.9.1Usagevoid master[slave]_rx_link_controller(LINK_PARAMETER_STORAGE *link_storage)

5.7.9.2DesignSee Section 5.5.

5.7.10 Master / Slave Send PacketThis acts as the interface between the PHY modems and the transmit portion of the link layer.

5.7.10.1UsageThere are three functions associated with sending packets for the three types of packets.

void send_LPP_packet(int link_id,LPP_STORAGE *LPP_packet)void master_send_FLMP_packet(int link_id, FLMP_STORAGE *FLMP_packet)void slave_send_RLMP_packet(int link_id, RLMP_STORAGE *RLMP_packet)

5.7.10.2DesignIn general, each of these functions work in the same manner inserting bits into the expected locations for the type of packet being sent with RLMP packets being sent over the slave link. For more information, see Section 5.5.

5.7.11 Master / Slave TX ControllerSpecifies states for links and sets states for primary / scan state machine.

5.7.11.1Usagevoid master[slave]_tx_link_controller(LINK_PARAMETER_STORAGE

*link_storage) void

5.7.11.2DesignIn general, each of these functions work in the same manner inserting bits into the expected locations for the type of packet being sent with RLMP packets being sent over the slave link. For more information, see Section 5.3.

102

Page 108:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

5.7.12 Primary / Scan State MachineGenerates packets at specified intervals for sounding channel quality and controls choice of RF channels when scanning or just the packet order for the primary state machine.

5.7.12.1Usagevoid primary_state_machine(int link_id,

MODE_PARAMETER_STORAGE *mode_storage )void scan_state_machine(int link_id, MODE_PARAMETER_STORAGE *mode_storage )

5.7.12.2DesignSee Section 5.4.3 for scan state machine design considerations.

5.7.13 Read Config FileUsed to configure simulation by specifying input and output files. Called at beginning of simulation

5.7.13.1Usagevoid read_config_file()

5.7.13.2DesignThe following files are specified in this function.

Current Simulation Configuration Files Slave

o Log: slave_logo Input files: link_slave_payload_in.txt, slave_rx_1.txt, slave_rx_2.txto Output files: link_slave_payload_out.txtLPPS_slave_chan_1.txt,

LPPS_slave_chan_2.txt, slave_tx_1.txt, slave_tx_2.txt Master

o Input Files: master_rx_1.txt, master_rx_2.txto Output Files: LPPS_master_chan_1.txt, LPPS_master_chan_2.txt,

master_tx_1.txt, master_tx_2.txt

5.7.14 Source Payload ProcessorProvides payload data to the slave and master nodes from files specified in read_config().

5.7.14.1Usagevoid master[slave]_payload_read_buf(

FILE *f_file_payload_in, // source of dataLINK_PARAMETER_STORAGE *link_one_storage,//parameters storageLINK_PARAMETER_STORAGE *link_two_storage)

5.7.14.2DesignCurrently, this is a simple file read for simulation purposes but will be expanded to allow for other data sources to eventually allow multiplexing of data sources.

5.7.15 Software InitSets all of the initial states for the link. Called at initialization and at reboots.

103

Page 109:  · Web viewrecd = received code word vector plus errors index_of[] = antilog table of GF(2**6) alpha_to[] = log table of GF(2**6) Internal Variables m = order of the field GF(2**6)

Development of SDR, CR, and Software Controlled Antenna SystemsPhase II Simulation Code

5.7.15.1Usagevoid software_init()

5.7.15.2DesignLinks start in scan-scan state as part of rendezvous operation (see Section 5.4.4) and all packet counters are initialized to zero and other bookkeeping operations are performed.

5.7.16 System State MachineThe primary decision process for handoffs. Determines when links have failed and which link should be in which state. Called after every packet.

5.7.16.1Usagevoid sys_state_machine()

5.7.16.2DesignSee the preceding.

104