Top Banner
1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang
97

1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

Dec 27, 2015

Download

Documents

Ella Walton
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

1

OFDM, Mobile Software Development Framework

9/27/2012

Y. Richard Yang

Page 2: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

2

Admin.

Homework 2 to be posted by Friday

Start to think about project

Page 3: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

3

Recap

Inter-Symbol Interference (ISI) Handle band limit ISI Handle multipath ISI

• Viterbi– problems: Its complexity

grows exponentially with D (the number of multipaths taps relative to the symbol time)

– Q: how to reduce D?

Page 4: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

4

OFDM: Basic Idea

Uses multiple carriers modulation (MCM) each carrier (called a subcarrier) uses a low

symbol rate• for N parallel subcarriers, the symbol time can be N

times longer spread symbols across multiple subcarriers

• also gains frequency diversity

Page 5: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

5

Benefit of Symbol Rate on ISI

1 2 3 4

1 2 3 4

1 2

1 2

Page 6: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

Multiple Carrier Modulation

6

Page 7: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

7

Multiple Carrier Modulation (MCM): Problem

Despite wave shaping, there can be leak from one subcarrier to another subcarrier

Conventional design: guard bands to avoid interference among subcarriers

Guard band wastes spectrum

i j

Page 8: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

Objective: Avoid subcarrier interference Interference of subcarrier i on subcarrier j

Assume no pulse wave shaping, matched filter

8

i j

Condition for the interference to be always 0?

Page 9: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

9

Objective: Avoid subcarrier interference

if integer number of cycles in [0, T]

# cycles in T is T * f => T * f = integer

Page 10: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

10

OFDM Key Idea: Orthogonal Subcarriers Each subcarrier frequency is chosen so

that an integral number of cycles in a symbol period, i.e., subcarrier freq = k 1/T

They do not need to have the same phase, so long integral number of cycles in symbol time T !

Page 11: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

OFDM Modulation

11

Page 12: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

12

Orthogonal Frequency Division Multiplexing

http://www1.linksys.com/products/images/ofdm.gif

OFDM allows overlapping subcarriers frequencies

802.11a

Page 13: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

13

OFDM Implementation

Take N symbols and place one symbol on each subcarrier (freq.)

Q: complexity of the implementation strategy?

Freq0

FreqN-1

Page 14: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

14

OFDM: Implementation Issue

Hardware implementation can be expensive if we use one oscillator for each subcarrier

Software implementation requires N multiplications per time output => N2 multi. per N outputs

Freq0

FreqN-1

Page 15: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

15

OFDM: Key Idea 2

Consider data as coefficients in the frequency domain, use inverse Fourier transform to generate time-domain sequence

Assume N outputs per symbol time T, fsc=1/T

Page 16: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

16

OFDM Implementation: FFT

channel

Page 17: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

17

OFDM Implementation

Parallel data streams are used as inputs to an IFFT

IFFT does multiplexing and modulation in one step !

Page 18: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

18

Guard Interval: Removing ISI

Orthogonal subcarriers remove inter-carrier interference

Slow symbol rate reduces inter-symbol interference, but may still have ISI

Basic idea of GI: skip the first part “damaged” signal

1 2

1 2

More details: Chap. 13.1.4 Gast

Page 19: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

19

OFDM Guard Interval

http://www.dsplog.com/2008/02/17/cylcic-prefix-in-orthogonal-frequency-division-multiplexing/

Page 20: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

20

OFDM Implementation

http://proquest.safaribooksonline.com/0596100523?tocview=true

Page 21: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

OFDM in 802.11a

Subcarrier frequency spacing 312.5KHz 1/312.5KHz = 3.2us 64 samples FFT 16 samples

Guard Interval

21

http://standards.ieee.org/getieee802/download/802.11a-

1999.pdf

Page 22: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

22

Other Multipath Techniques

There are other techniques to handle multipath such as Rake Receiver

See backup slides for somedetails

Page 23: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

23

Summary of PHY

Page 24: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

24

Wireless PHY

http://setemagali.com/2009/10/12/climbing-the-mountain-everyday/

PHY

Page 25: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

Big Picture

25

Foundational Services: Communications, Location, Service Discovery,

UI/Media, Power Management, Security

Wireless/Mobile Application Development Framework

Applications

Page 26: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

Overview

Mobile/Wireless software development framework for mobile wireless applications is a quite large topic

We have already seen Gnuradio as an example framework

We will cover more examples TinyOS, J2ME, Android, IOS

Approach for designing/evaluating each software development framework: Focus on the key concepts introduced by each

framework26

Page 27: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

27

Outline

Admin and recap Mobile/wireless development framework

GNURadio

Page 28: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

28

GNURadio: Design Objective

A software development toolkit that provides signal processing blocks to implement software-defined radio systems.

Page 29: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

29

Outline

Admin and recap Mobile/wireless development framework

GNURadio• Hardware setting

Page 30: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

GNURadio Hardware Arch

Hardware Frontend Host Computer

RF Frontend(Daugtherboar

d)

ADC/DAC andDigital Frontend

(USRP)

http://mobiledevices.kom.aau.dk/fileadmin/mobiledevices/teaching/software_testing/Gnu_radio_lecture.pdf

GNU RadioSoftware

Page 31: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

31

Outline

Admin and recap Mobile/wireless development framework

GNURadio• Hardware setting• Software concepts

Page 32: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

Basic Software Concepts Block

Flow graph

Page 33: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

Basic Software Concepts http://gnuradio.org/doc/doxygen/

classgr__block.html

gr_basic_block (name, in/out signature, msg queue) gr_block (Leaf block; key functions

forecast/general_work) Example:

http://www.gnu.org/software/gnuradio/doc/howto-write-a-block.html

gr_hier_block2 (container block; key functions: connect/disconnect/lock/unlock) gr_top_block (flow graph; start/stop/wait)

Page 34: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

Software/Execution Model

Python

Application developmentFlow graph construction

C++

Signal processing blocks

Software model Python

Application management (e.g., GUI)

Flow graph construction Non-streaming code (e.g.,

MAC-layer)

C++ Signal processing blocks Certain routines also coded

in assembly

Execution model Python thread for each

top_block

Discussion: benefits/issues of the hybrid software structure?

Page 35: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

35

Summary: GNURadio

Interesting/key software design techniques you learned from GNURadio?

Page 36: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

36

Outline

Admin and recap Mobile/wireless development framework

GNURadio• Hardware setting• Software concepts

TinyOS

Page 37: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

37

Design Goal

A free and open source component based operating system and platform targeting wireless sensor networks (WSNs)

Example app Environment monitoring, e.g.,

• measure temperature, lighting values/events• periodically transmit measurements/events to a base

station• forward data for other nodes that are out of range of

the base station

…http://www.tinyos.net/tinyos-1.x/doc/tutorial/

Page 38: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

38

Hardware

Assembled from off-the-shelf components

4Mhz, 8bit MCU (ATMEL) 512 bytes RAM, 8KB ROM

Devices serial Port temperature sensor & light

sensor 900Mhz Radio (RF monolithics)

• 10-100 ft. range LED outputs

1.5” x 1.5”

Page 39: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

39

Schematic Diagram of a Mote

Page 40: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

40

Outline

Admin and recap Mobile/wireless development framework

GNURadio• Hardware setting• Software concepts

TinyOS• Hardware setting• Software concepts

Page 41: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

41

Requirements on Software Dev. Framework

Flexible configuration of attached devices

Small foot print devices have limited

memory and power resources

Page 42: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

TinyOS: Software Concept

TinyOS: Generate customized OS + application for each given scenario support one application at a time but flexible

reprogramming

42

Page 43: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

43

Schematic Diagram

Page 44: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

44

TinyOS: Software Concepts

A TinyOS consists of one or more components linked together software components motivated by hardware

component

Each component specifies that it provides some interfaces

• allows other components to control it also uses some interfaces

• control other components

Page 45: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

45

Interface

An interface declares a set of

functions called commands that provider must implement

another set of functions called events that the interface user must implement

A uses interfaces I1 and I2

B provides I1 C provides I2

commands events commands eventsI1 I2

C provides I3

Page 46: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

46

Interface: Examples

StdControl.nc

interface StdControl {  command result_t init();  command result_t start();  command result_t stop();}

Timer.nc

interface Timer {

command result_t start(

char type,

uint32_t interval); 

command result_t stop(); 

event result_t fired();

}

ADC.nc

interface ADC {

async command result_t getdata(); 

async command result_t getContinuousData(); 

event result_t dataReady(uint 16_t data);

}

Page 47: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

47

TinyOS Component: Implementation

Component contains: commands and event

handlers• can invoke lower level

commands, but cannot block

frame (storage)• statically allocated, fixed

size to know memory requirement and avoid overhead of dynamic allocation

Component

Internal StateInternal Tasks

Commands Events

Page 48: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

48

Linking Components

Two types of components:

modules: individual components

configurations : assemble components together, connecting interfaces (objects) used by components to interfaces (objects) provided by others

Page 49: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

49

Example Application

A simple TinyOS application which periodically reads in the light intensity value, computes a moving average, displays it on the LEDSee SenseTaskM.nc

SenseTask.nc

Page 50: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

50

Running tinyOS Program make mica ncc -o main.exe -target=mica SenseTask.nc avr-objcopy --output-target=srec main.exe

main.srec Use uisp to install

Page 51: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

51

TinyOS Execution Model

Concurrency model: only two threads long running tasks that can be interrupted by hardware

event handlers

Tasks perform the primary computation work commands and event handlers post tasks call lower level commands signal higher level events schedule other tasks within a component

Each task is atomic with respect to other tasks run to completion, but can be preempted by events the task scheduler is a simple FIFO scheduler

Page 52: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

52

A More Complete Sample Application Sensor network

monitoring monitor temperature and

light conditions periodically transmit

measurements to a base station

sensors can forward data for other sensors that are out of range of the base station

dynamically determine the correct routing topology for the network

Page 53: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

53

Internal Component Graph

RFM

Radio byte

Radio Packet

UART

UART Packet

I2C

Temp

Light

Active Messages

Clocksbit

byte

packet

Ad hoc Routing Applicationapplication

HW

SW

Page 54: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

54

Message Send Transition

Total propagation delay up the 5 layer radio communication stack is about 80 instructions

Timing diagram of event propagation

Page 55: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

55

Evaluation: Storage

Component Name Code Size (bytes)

Data Size (bytes)

RoutingAM_dispatchAM_temperatureAM_lightAMRADIO_packetRADIO_byteRFMLightTempUARTUART_packetI2C

884078

1463563348103108464

196314198

00

328

4040

81111

408

Processor_initTinyOS schedulerC runtime

17217882

3016

0

Total 3450 226

Scheduler only occupies 178 bytes

Complete application only requires 3 KB of instruction memory and 226 bytes of data (less than 50% of the 512 bytes available)

Only processor_init, TinyOS scheduler, and C runtime are required

Page 56: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

56

Evaluation: Timing

Operations Cost (cycles)

Time (µs)

Normalized to byte copy

Byte copy 8 2 1

Post an Event

Call a Command

Post a task to scheduler

Context switch overhead

10104651

2.52.5

11.512.7

5

1.251.25

66

Interrupt (hardware cost) 9 2.25 1

Interrupt (software cost) 71 17.75

9

Page 57: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

Summary: TinyOS Components

provide commands andrequire callback hooks for event-driven programming

Configurations Link components

TinyOS an app (configuration)

at a time, linkingonly necessary components

Two threads exec one for event one for task

57

ADC.nc

interface ADC {

async command result_t getdata(); 

async command result_t getContinuousData(); 

event result_t dataReady(uint 16_t data);

} configuration SenseTask { // this module does not provide any interfaces}implementation{ components Main, SenseTaskM, LedsC, TimerC, DemoSensorC as Sensor;

Main.StdControl -> TimerC; Main.StdControl -> Sensor; Main.StdControl -> SenseTaskM;

SenseTaskM.Timer -> TimerC.Timer[unique("Timer")]; SenseTaskM.ADC -> Sensor; SenseTaskM.Leds -> LedsC;}

Page 58: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

Discussion: Compare TinyOS/GNURadio

What are some similar software concepts?

What are some differences?

58

Page 59: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

Discussion

Can we use GNURadio/TinyOS for writing mobile applications for mobile phones, or in other words, what are missing?

59

Page 60: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

60

Java2 Micro Edition (J2ME)

Page 61: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

61

Outline

Admin and recap Mobile/wireless development framework

GNURadio TinyOS J2ME

Page 62: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

62

Java Platforms

Java2 is divided into three platforms J2EE (Java2 Enterprise Edition)

• business applications

J2SE (Java2 Standard Edition)• general applications

J2ME (Java2 Micro Edition)• small devices such as mobile phone, PDA, car navigation

Oracle’s claims on Java on mobile devices http://www.java.com/en/about/

Page 63: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

63

J2ME Basic Concepts: Versioning To accommodate heterogeneous mobile

devices, define configurations and profiles

http://developers.sun.com/techtopics/mobility/getstart/articles/survey/

-A configuration provides fundamental services for a broad category of devices (e.g., lang, io, util)

- A profile supports higher-level services common to a more specific class of devices or market (e.g., life cycle, GUI)

-An optional package adds specialized services that are useful on devices of many kinds, but not necessary on all of them

Page 64: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

64

J2ME

128-512K mem16-32 bit proc

Upto 2M mem32 bit proc

Page 65: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

65

Example J2ME Configurations

Connected Limited Device Configuration (CLDC) 160 KB to 512 KB of total memory available 16-bit or 32-bit processor low power consumption and often operating with battery

power connectivity with limited bandwidth examples: cell phones, certain PDAs

Connected Device Configuration (CDC) 2 MB or more memory for Java platform 32-bit processor high bandwidth network connection, most often using

TCP/IP examples: set-top boxes, certain PDAs

Page 66: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

66

CLDC Available Packages

java.lang java.util java.io javax.microedition.io

Page 67: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

67

CLDC Classes Boolean Byte Character Class Integer Long Math Object Runnable Runtime Short String StringBuffer System Thread Throwable

Calendar Date Enumeration Hashtable Random Stack TimeZone Vector

ByteArrayOutputStream ByteArrayInputStream DataOuput DataInput DataInputStream DataOutputStream InputStream InputStreamReader OutputStream OutputStreamWriter PrintStream Reader Writer

java.lang java.util java.io

Page 68: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

68

Example J2ME Profiles

Mobile Information Device Profile (MIDP) GUI, multimedia and game functionality,

end-to-end security, and greater networked connectivity

mobile phones and entry level PDAs

Foundation Profile set of Java APIs that support resource-constrained devices

without a standards-based GUI system

Personal Profile Full set of AWT APIs, including support for applets and Xlets CDC + Foundation Profile + Personal Profile for high-end PDA

Page 69: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

69

Mobile Phone Framework

Page 70: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

70

MIDP Hardware

Memory (added to CLDC memory) 128 KB non-volatile for MIDP components 8 KB non-volatile for application persistent

data 32 KB volatile for KVM

Display screen 96x54 display depth 1-bit pixel shape (aspect ratio) 1:1

Page 71: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

71

MIDP Hardware

Input (one or more)one-handed keyboard (ITU-T phone

keypad)two-handed keyboard (QWERTY keyboard)or touch screen

Networking two-way wireless possibly intermittent limited bandwidth

Page 72: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

72

MIDP Packages

java.io java.lang java.util javax.microedition.io javax.microedition.lcdui javax.microedition.rms javax.microedition.midlet

javax.microedition.lcdui.game javax.microedition.media javax.microedition.media.contr

ol javax.microedition.pki

addition in version 2.0version 1.0

Page 73: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

73

MIDP Technology Stack

Mobile Information

Device Profile

KVMCLDC = KVM + J2ME Core

APIs in this

example DSP chip(e.g., ARM)

J2ME core APIs

YourMIDlet

Yellow Pages, train schedules and ticketing, games…

UI, HTTP networking...

Threads, no Floats…

32-bit RISC, 256K ROM, 256K Flash, 64K RAM

Page 74: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

MIDlet

GUI based

Each MIDP has one instance of Display• Display.getDisplay(this) to get the manager• At any instance of time at most one Displayable

object can be shown on the display device and interact with user– display.setCurrent(<Displayable object>)

74

Page 75: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

75

MIDlet

An MIDP application is called a MIDlet similar to the J2SE applet

A MIDlet moves from state to state in the lifecycle, as indicated

start – acquire resources and start executing

pause – release resources and become quiescent (wait)

destroy – release all resources, destroy threads, and end all activity

Pause

Active

Destroyed

startApp

destroyApp

pauseApp

destroyApp

Page 76: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

MIDP Visual Display

Each MIDP has one instance of Display

Display.getDisplay(this) to get the manager

At any instance of time at most one Displayable object can be shown on the display device and interact with user• display.setCurrent(<Displayable object>)

76

Page 77: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

MIDP Visual Display

Displayable Canvas

• GameCanvas

Screen• Alert, List, TextBox, Form

Form can contain multiple form items for organization Labels, Image Items, String Items, Text Fields, Date

Fields, Gauges, Choice Groups

77

Page 78: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

MIDP: User Interaction

Displayable objects can declare commands and declare a command listener: addCommand(Command cmd) addCommandListener()

Command(<label>, <type>, <priority>) Type: BACK, CANCEL, EXIT, HELP, ITEM, OK, SCREEN, and STOP

78

Page 79: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

79

HelloWorldMIDlet.javaimport javax.microedition.midlet.*;import javax.microedition.lcdui.*;

public class HelloWorldMIDlet extends MIDletimplements CommandListener {

private Command exitCommand;private Display display;private TextBox t;

public HelloWorldMIDlet() { display = Display.getDisplay(this);exitCommand = new Command("Exit", Command.EXIT, 2);t = new TextBox(“CS434", "Hello World!", 256, 0);t.addCommand(exitCommand);t.setCommandListener(this);

}public void startApp() { display.setCurrent(t); }public void pauseApp() { }public void destroyApp(boolean unconditional) { }public void commandAction(Command c, Displayable s) {

if (c == exitCommand) {destroyApp(false);notifyDestroyed();

}}

}

Page 80: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

MIDP: Persistent State

Record store defined in javax.microedition.rms

Record store identified by name: static String[] listRecordStores();

recordStore = RecordStore.openRecordStore("scores", true);

recordId = addRecord(byte[] data, int offset, int numBytes);

getRecord(int recordId);

80

Page 81: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

81

Summary : J2ME

Scale down a popular programming environment to ease learning

Use virtual machines to mask device heterogeneity

Use configuration/profiling to handle device heterogeneity and avoid using lowest common denominator

MIDLet to manage app life cycle Displayable to visual display, commands and

provides command listener Introduce persistent record store

Page 82: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

82

Windows .NET Compact Framework Similar to J2ME Scales down a popular programming environment to ease

learning the .NET CF is a subset of the full .NET framework with some additions designed for resource constrained devices 1,400 classes for .NET CF vs. 8,000 for full 27 UI controls for .NET CF vs. 52 for full 1.5 MB for .NET CF vs. 30 MB for full

Uses versioning to avoid using lowest common denominator pocket PC pocket PC phone version smart phone version

Uses virtual machines to mask device heterogeneity programming languages compile to MSIL

• MSIL is JIT compiled on the device• MSIL code is smaller than native executables• MSIL allows your code to be processor independent

Page 83: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

Andriod

83

http://developer.android.com/index.html

Page 84: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

Android Features

Linux kernel as foundation Java based framework (J2SE not J2ME)

Dalvik Virtual machine Nice features

Touch screen, accelerometer, compass, microphone, camera, GPS,

GSM, EDGE, and 3G networks, WiFi, Bluetooth, Near field communications

Media, SQLite, WebKit, SSL Location-based service, map (Google API)

84

Page 85: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

Andriod

85

Page 86: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

Activity

A single, focused thing that the user can do.

Interaction with users: creating a window to place UI views

full-screen windows, floating windows, embedded inside of another activity

Page 87: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

Android Activity Life cycle

87

Page 88: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

View

A view component is a building block for user interface components.

Widget Toolbox TextView, EditText, Button, Form,

TimePicker… ListView Layout

• Positions of controls• LinearLayout, Relativelayout

http://developer.android.com/guide/tutorials/views/index.htm

Page 89: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

Rake Receiver

89

Page 90: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

90

Multipath Diversity: Rake Receiver

Instead of considering delay spread as an issue, use multipath signals to recover the original signal

Used in IS-95 CDMA, 3G CDMA, and 802.11

Invented by Price and Green in 1958 R. Price and P. E. Green, "A

communication technique for multipath channels," Proc. of the IRE, pp. 555--570, 1958

Page 91: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

91

Multipath Diversity: Rake Receiver

Use several "sub-receivers" each delayed slightly to tune in to the individual multipath components

Each component is decoded independently, but at a later stage combined this could very well result in

higher SNR in a multipath environment than in a "clean" environment

LOS pulsemultipathpulses

Page 92: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

92

Rake Receiver Blocks

Correlator

Finger 1

Finger 2

Finger 3

Combiner

Page 93: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

93

Rake Receiver: Matched Filter

Impulse response measurement Tracks and monitors peaks with a

measurement rate depending on speeds of mobile station and on propagation environment

Allocate fingers: largest peaks to RAKE fingers

Page 94: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

94

Rake Receiver: Combiner

The weighting coefficients are based on the power or the SNR from each correlator output

If the power or SNR is small out of a particular finger, it will be assigned a smaller weight:

M

ii

mm

Z

Z

1

2

2

Page 95: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

95

Discussion

What are major considerations in designing a software environment for mobile wireless applications for mobile devices?

Page 96: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

96

Mobile Programming Requirements

Handle heterogeneous devices/configurations Be extremely efficiency on using resources

(memory, battery, …) Easy programming for event-driven

programming …

Page 97: 1 OFDM, Mobile Software Development Framework 9/27/2012 Y. Richard Yang.

97

Comparison [PAH95]

MCM is OFDM