2009年2月22日 星期日

藍牙簡介

如前文所述,bluetooth 己成為 mobile computing 的 de facto 外接的標準。本文主要討論 bluetooth 的規格及應用。

Bluetooth 有內定的 profile 決定有關的應用,可參考 wiki。以下舉出手機中常見的 profile:

  • Hands Free and Headset profile: HFP / HSP
  • Advanced Audio Distribution (Stereo) profile: A2DP
  • Audio/Video Remote control profile: AVRCP

不同的 profile 並不完全是獨立的,常常是互相關連,如下圖所示。GAP 是最基本的 profile;GAVDP 是架構在GAP之上; A2DP 又是架構在 GAVDP之上。

image

以下說明各種 os/device 對 profile 的支援程度。以 embedded OS 而言,symbian 目前有最完整的 bluetooth profile 支援。

 

General OS

Windows XP SP2/Vista/7

The Microsoft Windows Bluetooth stack only supports external or integrated Bluetooth dongles attached through USB. It does not support Bluetooth radio connections over PCI, I²C, serial, PC Card or other interfaces.

Windows XP includes a built-in Bluetooth stack starting with the Service Pack 2 update, released on 2004-08-06.

The Windows XP and Windows Vista Bluetooth stack supports the following Bluetooth profiles natively: SPP, DUN, HID, HCRP.  Windows 7 also supports audio related profiles-HFP, HSP, A2DP and AVRCP natively.

 

Linux

The Linux operating system currently has two widespread Bluetooth stack implementations:

BlueZ is the official Bluetooth stack for Linux and is used in Google's Android OS. Its goal is to make an implementation of the Bluetooth wireless standards specifications for Linux. As of 2006, the BlueZ stack supports all core Bluetooth protocols and layers.  It was initially developed by Qualcomm, and is available for Linux kernel versions 2.4.6 and up.

 

MAC OS

Mac OS X: As of version 10.5, Mac OS X includes native support for A2DP on Bluetooth equipped Macs.  Version 10.4 does not support A2DP, but can be hacked to enable limited functionality.  Softick Audio Gateway for Mac OS X also supports A2DP. Despite being capable of A2DP, the iPhone variant of OS X provides no A2DP support as of October 2008. (But will be supported in future versions of the iPhone OS.)

 

Embedded OS

BlueMagic

BlueMagic 3.0 is Open Interface's (now Qualcomm) highly portable embedded Bluetooth protocol stack which power's Apple's iPhone and Qualcomm-powered devices such as the Motorola RAZR. BlueMagic also ships in products by Logitech, Samsung, LG, Sharp, Sagem, and more. BlueMagic 3.0 was the first fully certified (all protocols and profiles) Bluetooth protocol stack at the 1.1 level.

 

BlueCore Host Software (BCHS)

CSR's BCHS or BlueCore™ Host Software provides the upper layers of the Bluetooth® protocol stack (above HCI, or optionally RFCOMM) - plus a large library of Profiles - providing a complete system software solution for embedded BlueCore applications. BCHS supports 1.2, 2.0+EDR and 2.1+EDR. Current qualified Profiles available with BCHS: A2DP,AVRCP,PBAP,BIP,BPP,CTP,DUN,FAX,FM API,FTP GAP,GAVDP,GOEP,HCRP,Headset,HF1.5,HID,ICP,JSR82,LAP Message Access Profile,OPP,PAN,SAP,SDAP,SPP,SYNC,SYNC ML.

 

Windows CE/Mobile

Windows CE is Microsoft's embedded operating system, which also supports Bluetooth. However, different stacks can be installed on windows CE devices, including Microsoft, Widcomm, and Toshiba, depending on the embedded device on which the OS is installed.

Windows Mobile (previously Pocket PC, PPC): Version 5.0 and newer (with AKU 2.0), thus far based on the Windows CE 5.0 kernel, fully support A2DP if an appropriate device is present.

There is a huge amount of debate on the forums as to what Bluetooth profiles Windows Mobile devices support.  Below is the list that we support natively in the Microsoft Stack in AKU 2.0 of Windows Mobile 5.0 and beyond:

Generic Access Profile (GAP)
Generic Object Exchange Profile (GEOP)
Serial Port Profile (SPP)
Dial-up Networking (DUN) Profile
Hands-Free Profile (HFP)
Headset Profile (HSP)
Human Interface Device (HID) Profile
Object Push Profile (OPP)
ActiveSync-Over-Bluetooth
Advanced Audio Distribution Profile (A2DP)
Audio/Video Remote Control Profile (AVRCP)

The confusion typically starts because it is up to to the OEM to choose which ones they implement or to add additional support for other profiles.

 

Symbian OS bluetooth profile (v9.2)

Symbian OS is an operating system for mobile phones, which includes a bluetooth stack. All phones based on Nokia's S60 platform and Sony Ericsson/Motorola's UIQ platform use this stack. The Symbian bluetooth stack runs in user mode rather than kernel mode, and has public APIs for L2CAP, RFCOMM, SDP, AVRCP, etc. Profiles supported in the OS include GAP, OBEX, SPP, AVRCP, GAVDP, PAN, PBAP.  Additional profiles supported in the OS + S60 platform combination include A2DP, HSP, HFP1.5, FTP, OPP, BIP, DUN, SIM access, device ID.

There are two kinds of profiles provided for by Symbian OS: implemented and supported. Implemented profiles can be used directly from the existing components. When a profile is supported the licensee will need to provide its own APIs to make the functionality of that profile available to application developers.

image

The above figure shows the dependencies of profiles. The shaded profiles are implemented by the Symbian OS Bluetooth subsystem.

Implemented Bluetooth profiles

The following profiles are implemented by Symbian OS Bluetooth:

  • Generic Access Profile (GAP)

  • Serial Port Profile (SPP)

  • Generic Object Exchange Profile (GOEP)

  • Personal Area Networking (PAN) Profile

  • Audio Video Remote Control Profile (AVRCP)

  • Generic Audio Video Distribution Profile (GAVDP)

 

Android (Cupcake)

Android bluetooth is based on BlueZ on Linux.  New kernel based on Linux 2.6.27.  However, the bluetooth API is not supported till v1.0 release.  Google promised it will support A2DP profile.  The tentative release cupcake supports A2DP and AVRCP profiles.

iphone OS

iphone OS is based on MAC OS X.  The only bluetooth device opens now is the bluetooth headset.  It is annoying!

50/75 Ohm for RF?

所有 RF 工程師都熟悉如下圖 50 Ohm 的阻抗匹配。舉凡 LNA, PA, 天線, 高頻頭 (tuner), waveguide 等等,都要求 50ohm 的阻抗。唯一的例外是有線電視,通常使用 75ohm 的纜線。到底當初為什麼會選擇 50 或 75ohm的阻抗?以及在 rf ic 的設計上是否應沿用 50ohm 的阻抗?本文參考 Tom Lee 的說明給予一些解釋。

image

為什麼要做阻抗匹配?

常見的幾種說法:

1. Max power delivery:當阻抗匹配時,能傳遞最大的能量(功率)

2. 相反的,如果沒有適當的阻抗匹配,發射端的能量會反射,有可能損壞機器,如上圖的 phase array radar 系統所示。或者接收端可能收不到訊號。

為什麼用 50 Ohm 做阻抗?

主要有兩個考量:

1. Power delivery (能量傳遞):  主要考慮發射端能把最大的能量傳遞至天線或雷達。由於能量和阻抗成反比,阻抗愈小,電流愈大,能量愈大。

2. Power Attenuation (能量衰減): 所有的 wavegude 和 cable 都有雜散電阻。特別高頻有所謂的 skin effect, 會使電阻隨頻率(平方根)增加,因而讓發射或接收信號衰減。因此會希望阻抗愈大,電流愈小,損失的能量愈小。

同樣的考量也存在電力網上。電力網的解決之道是用變動的阻抗(變動的電壓和電流)來解決。在頭端和末端使用低電阻和高電流(110V/220V 電壓)以達到高能量傳遞。但在傳送過程中使用高電壓和低電流以避免能量衰減,同時維持高的能量傳遞。在 RF 中一般傳送的距離很短,也有相當的困難使用變動的阻抗。因此仍然以固定阻抗為主。

Tom Lee 的書花了一番功夫推導兩者的最佳值。就 power delivery 而言,最好的值是是 32 Ohm.  就 power attenuation 而言,最佳值約為 77 Ohm.  因此取平均值為 50 Ohm.  詳細的推導可參閱 Tom Lee 的書。然而在 cable TV 的應用,因為主要為通訊目的而選為 75 Ohm 以增加傳送距離。

RF IC 也應用 50 Ohm 做阻抗嗎?

當然是否定。因為 50 Ohm 或 75 Ohm 只是人為的選擇。以 RF IC 而言,既不能 power delivery 也非 power attenuation, 反而是重在 RF signal 的放大,frequency translation, filtering, etc. 除了和 IO interface 有關的電路仍應用 50 Ohm 以和外部元件匹配 (trace, 天線, etc.),內部線路可用類似電力線做法用 variable impedance 以達成最佳的效果。甚至可以忽視阻抗匹配,因為非常短距離。例如 Ro 用低阻抗而下級 Ri 用高阻抗,如同設計低頻電路一樣。

數值方面的解釋可以參考 Crawford 的文章

2009年2月13日 星期五

Beauty of Dipole Antenna

Before diving into the dipole antenna, let's feel the simple beauty of radiation wave of a dipole antenna.  A good picture is worth a thousand words.

Example 1: A small dipole antenna.  Please refer to the following figure for the radiation wave.  It vividly shows how static electrical field becomes electromagnetic wave when the dipole is oscillating. 

image 

Fig. 1: Electrostatic field and electromagnetic wave

Example 2: for a λ/2 dipole antenna, the radiation wave is shown in the following figure.  The maximal radiation wave is at equator.  No radiation wave at the north and south poles.

image 

Fig. 2: λ/2 dipole antenna radiation wave

Example 3: for a λ wavelength dipole antenna, the radiation wave is shown in the link.  The maximal radiation wave is at equator.  Again, no radiation wave at the north and south poles.

 Example 4: for a 3λ/2 dipole antenna, the radiation wave is shown in the following figure.  The maximal radiation wave is 45 degree between the equator and two poles.  Again, no radiation wave at two poles.

image 

 Fig. 3: 3λ/2 dipole antenna radiation wave

The above radiation wave animation is essentially derived from Maxwell equations.  The process is very cubersome and only solved by numerical method in computer.

Dipole Antenna Lumped Circuit Model

The core equivalent circuit of a dipole antenna is a serial RLC resonator.  Intuitively, the dipole antenna acts as an open circuit as a serial RLC resonator at low frequency as shown in Fig. 4(a).

On the contrary, the equivalent circuit model of a loop antenna is a parallel RLC resonator.  The loop antenna behalves as a short circuit as the parallel RLC resonator at low frequency as shown in Fig. 4(b).

The resonant resistance Rrad is not a physical resistance, but an equivalent resistance representing the radiative to the air.  Radiation resistance is only part of the antenna impedance.  Inductive and capacitive reactance are also present.  Energy that is transferred to the near field relates to the reactive component of the current in the antenna.  This is the 1/R^2 component of the electric and magnetic fields that we neglected when deriving the expressions for the far fields. 

A serial RLC resonator is only a first order approximation.  We need to consider other effects for a real antenna at RF frequency.

ant

Fig. 4: Dipole and loop antenna equivalent circuit model

1. Rs, ohmic resistance and skin effect: a real antenna has finite ohmic resistance.   Rs also increases proportionally to sqrt(f) and becomes significant at high frequency.

2. Cp, parasitic capacitance of antenna. It can be modeled as a shunt capacitance.

Fig. 4(c) shows the equivalent circuit model including Rs and Cp, a better model than a serial RLC model.  We called it a lumped circuit model because we borrow circuit concepts (such as R, L, C, voltage, and current) to model the field behavior (such as electrical field, magnetic field, wave).  Strictly speaking, the lumped circuit model is only valid at low frequency where the wavelength is much longer than the antenna.  Nevertheless, we can break the entire operating freuqency range into different segment and use different lumped circuit model.

Lumped Circuit Model vs. Wavelength

When the dipole is very short (relative to wavelength), the dipole can be modeled as a series RLC circuit in which the impedance is dominated by radiation resistance and capacitive reactance. As the antenna is made longer, Rrad and XL increase and XC decreases. When the physical length equals λ/2 , XL = XC with a resulting impedance of Rrad (~73W).  As the antenna is made longer than λ/2, the model is a parallel RLC circuit. When length equals λ, the tank LC circuit has infinite impedance, leaving the parallel Rrad (~200W) as the net impedance.  Between a length of λ and 3λ/2 (Rrad~105W), the model is a series RLC circuit, and so forth.  This result is sumarized in Fig. 4(d).

See the figure for the variation in Rrad, which itself varies with wavelength.  Note that Rrad is about 73W at λ/2.   So we want to use a 75 ohm cable to match the impedance of a half-wave dipole in order to have maximum power transfer from the generator to the antenna. Notice that we used the impedance of space, ήo, in the calculation of Rrad. If we do not use a length of λ/2, there will be impedance mismatch and reflections, leading to a standing wave ratio greater than unity, i.e. less than maximum power transfer to the antenna.

image

Fig. 5: Dipole antenna radiation resisance vs. λ

Bandwidth
Note that the system is designed for specific frequency; i.e. at any other frequency it will not be one-half wavelength. The bandwidth of an antenna is the range of frequencies over which the antenna gives reasonable performance. One definition of reasonable performance is that the standing wave ratio is 2:1 or less at the bounds of the range of frequencies over which the antenna is to be used.

Dipole Antenna Smith Chart

It seems that there is a delimma to get a full picture of a simple dipole antenna.  Solving Maxwell equations provides the accurate solution, but loses the physical intuition and not practical due to the computation complexity. 

Lumped circuit model provides a simple approximation of a dipole antenna, it is useful but only valid within limited frequency range.  The situation is shown in Fig. 6.

img011

Fig. 6: Different abstration in electrical discipline

Luckily, there is a another tool originally derived from transmission line, namely Smith Chart, provides useful physical insight and enough accuracy for understanding the dipole antenna.  A brief introduction of Smith Chart is on the other article.  Lumped circuit is a subset included in Smith Chart.  Smith Chart (transmission line) is based on a specific EM wave called TEM (tranverse EM) wave where the dynamic electrical and magnetic fields are perpendicular to the wave propagation direction.  The majority of EM wave and waveguide either belong to the TEM domain or can be approximated by TEM wave.  That is, Smith Chart is a very useful tool to solve most electrical problems.

Fig. 7 shows the Smith chart of the input impedance (S11) of a monopole (half of a dipole antenna) without Rs and Cp.  The red trace starts from open circuit and capacitive at low frequency, and intersects at real axis at the first resonant frequency (λ/2, 36W).  The input impedance becomes inductive after the first resonance till it reaches the second resonant frequency (λ, 105W) so on and so forth.  Fig. 8 shows the Smith chart of a similar monopole antenna but with Rs and Cp.  Clearly, the input impedance is capacitive due to Cp at the first resonant frequency. 

smith_ant

Fig. 7: S11 of a monopole antenna without Rs and Cp

 smith_ant_cap

Fig. 8: S11 of a monopole antenna with Rs and Cp

2009年2月4日 星期三

如何在 Transport Stream 做 Data Service

 

Example 1: EPG

Propritary data service defined in DVB (T/C/S?)

 

Example 2: TPEG

Orginal based on RDS-TMC then use in DAB or DVB (particularly DVB-H, but not DVB-T?)

 

Example 3: IP over MPE

DVB-T/H/S uses MPE (multi-protocol encapsulation)

ESG?

How about DAB-IP ?

 

Moreover HTML or XML over TS?

 

Can use hardware to strip IP packets

DVB-H adds another MPE-FEC

Applications:

Data broadcasting for

for emergence

general information

How about advertisement?

html? (file type, no return channel)

追蹤者