Upload
others
View
11
Download
0
Embed Size (px)
Citation preview
Application Note
MATLAB アプリケーション
MG3700A ベクトル信号発生器
1
Slide 1MG3700A-J-F-11
アプリケーションノート- アプリケーション -
アンリツ
2008年1月(300)
Slide 2MG3700A-J-F-11
目次
bull はじめに 3bull 変調の基礎 5bull シグナルパターンファイルを理解する 10bull IQデータファイルを生成するプログラミング例
18raquo アナログ変調 19raquo パルス変調 26raquo PSK QAM 35raquo Simulink 46
bull IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例 68
2
Slide 3MG3700A-J-F-11
はじめに
bull MATLABやMicrowave OfficeのようなEDA(Electronic Design Automation)ツールはIQシミュレーションデータをCSVテキストファイル
にセーブできますraquo シミュレーションと計測データの容易な比較
bull アプリケーションソフトウェアIQプロデューサ(MG3700A標準付属品)はユーザのIQサンプルデータをCSVファイルからMG700Aへインポートで
き様々なアプリケーションに役立ちますraquo 次世代ワイヤレスシステムへのRampD RFID PMW アナログ変調 (AM FM
PM)
ベースバンド信号のCSVファイル生成
CプログラムやMATLABのようなEDAツール
による信号処理(シミュレーション)
MG3700A用シグナル
パターンファイルへ変換
FTP
ユーザ独自のソフトウェア
Slide 4MG3700A-J-F-11
はじめに
bull MG3700Aは任意波形発生器(AWG)の機能をサポートしま
すraquo サンプルレート (Fs)
ndash 20 k sim 160 MHzraquo 波形メモリ
ndash 2times 128 Mサンプルチャネル (1 GB)ndash 2times 256 Mサンプルチャネル (2 GB) メモリアップグレードオプション付で
bull デュアルベースバンドメモリ
raquo DAC分解能ndash 14 ビット
raquo マーカ出力ndash 3 定義可能 TTL
bull 本書は MATLAB使用例を紹介します
3
Slide 5MG3700A-J-F-11
変調の基礎
bull 変調は振幅や位相あるいはその両方の変化を用いて搬送波周波数ƒc上の帯域通過信号にデータを変換します
信号処理 周波数変更データ 被変調信号
変調信号m(t)
ベースバンド信号g(t)
帯域通過信号s(t)ベースバンド回路 RF回路
fm-fm
振幅
fc+fmfc-fm fc0 f
ベースバンド帯域幅
帯域通過帯域幅
Slide 6MG3700A-J-F-11
変調送信機
bull 振幅位相変調テクニック
bull 直交(IQ)変調
テクニック
ベースバンド信号処理 ƒc
m(t)
R(t) v(t)=R(t) cos[ωct+θ(t)]
ベースバンド回路 RF回路
sum
θ(t)φM cos[ωct+θ(t)]
ωc=2πƒc
ベースバンド信号処理
ƒcm(t)
x(t)
v(t)=x(t) cos(ωct) - y(t) sin(ωct)
ベースバンド回路 RF回路
y(t)
-π2 シフト
+
-
cos(ωct)
cos(ωct)
sin(ωct)
等価
)()()( 22 tytxtR +=
x(t)=R(t) cosθ(t)y(t)=R(t) sinθ(t)
I
Q
4
Slide 7MG3700A-J-F-11
ベースバンド波形
Dp 位相偏移 [radV]Acsin[Dpm(t)]Accos[Dpm(t)]Dpm(t)AcPM
m1(t) = plusmn1m2(t) = plusmn1
Dƒ 周波数偏移[radVmiddots]
m(t)=micro sin(2πƒmt)micro 変調度
ƒm 変調周波数
備考
Acm2(t)Acm1(t)QM
AcFM
0Ac[1+m(t)]0Ac[1+m(t)]AM
y(t)x(t)θ(t)R(t)変調方式
直交変調振幅位相変調
int infinminus
t
f dmD σσ )(
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
)()( 22
21 tmtmAc + )(
)(tan1
21
tmtmminus
QM 直交変調 Quadrature Modulation
Slide 8MG3700A-J-F-11
ベースバンド信号
bull どのようなタイプの被変調信号も振幅位相変調あるいは直交変調のどちらかのテクニックを用いて発生されます
bull 適切なソフトウェアアルゴリズムを選択することによってどのような変調方式も実現できます
bull ベクトル信号発生器(VSG)では帯域通過信号s(t)は2チャネルに分解して考えられることが多く1つはI(in-phase 同相)チャネルもう1つはQ (quadrature-phase 直交)チャネルでありそれぞれx(t)とy(t)に対応しま
すbull 帯域通過信号のコンピュータシミュレーションを行う場合帯域通過信号
s(t)の代わりにその等価低域信号であるベースバンド信号を用いることに
よってシミュレーションでのサンプリングレートを小さくすることができます
5
Slide 9MG3700A-J-F-11
bull CW
bull FM
bull AM
bull PSK
基本IQコンスタレーション
I
Q
I
Q
振幅 R(t)
I
Q
I
Q位相シフトπ2 [rad]
Ac
Ac-Ac
-Ac
Ac
角速度[rads]
Ac
Ac
Ac
Ac
Slide 10MG3700A-J-F-11
シグナルパターンファイルを理解する
bull シグナルパターンファイルは3つのデータから成りますraquo IQデータ
raquo マーカデータraquo ファイルヘッダ
ユーザ作成IQデータ
とマーカデータ
wvdバイナリファイル
wviテキストファイル
FTP
CF
FTP接続
HDD
テキストファイルをバイナリファイルへ大 ltltlt ファイルサイズ gtgtgt 小
ファイルヘッダ
IQデータはDAC入力値へ目盛り付けされるダウンロード rarr
larr抽出
6
Slide 11MG3700A-J-F-11
IQデータ
bull データファイル(wvd)はIおよびQデータポイント(IおよびQのデータポイントごとの符号付き14ビット整数)を含みます各IQポイントは1つのベース
バンド波形ポイントに相当しますbull MG3700AはIおよびQデータポイントの2バイト整数値のそれぞれを処
理するために14ビットDACを使用します14ビットDACは0sim16383のレンジを持ちますがMG3700Aは正数と負数にこのレンジを分けます
IQデータレンジ DACレンジ IQ出力電圧ndash 8191 ----------------- 16383 ----------------- Vmax 正数(+) フルスケールndash 0 ----------------- 8191 ----------------- 0 Vndash -8192 ----------------- 0 ----------------- Vmin 負数(-) フルスケール
DACIデータ LPF
DACQデータ LPF Q
I
Slide 12MG3700A-J-F-11
IQデータレンジ
bull MG3700A性能はIQ DAC RMS値1157sim1634内で保証されますraquo クレストファクタ(ピークパワーRMSパワー)を考慮した調整できるDAC RMS
値raquo MG3700Aディスプレイ上で調整できる RMSパワー22 QI +
Q
+8191
+8191
-8191
-8191
+1634
+1157
0
11 dB
3 dB
210 8191log202778 asympdB
22 QI +
2210 16341634log202867 +asympdB
2210 11571157log202864 +asympdB
I+1157 +1634
クレストファクタのためのマージン
7
Slide 13MG3700A-J-F-11
マーカデータ
bull マーカデータはIQデータポイントごとにOn(1)またはOff(0)の4マーカ状態をセットするためにIQデータポイントあたり4ビットを使用します
bull マーカデータは3イベントマーカとRFゲートフラグから成りますbull イベントマーカがアクティブ(On)のときアクティブマーカ番号1sim3に対応
するリアパネルマーカコネクタでトリガ信号を出力しますbull RFゲートフラグはパルス変調のために使用され内部パルス変調器を駆
動します
raquo マーカデータなしでIQデータをインポートすると自動的にイベントマーカはインアクティブ(Off)RFゲートフラグはアクティブ(On)になります
Slide 14MG3700A-J-F-11
内部パルス変調器
バーストパワー
RFゲートフラグが使用されない場合キャリアリークが存在する
規格 le -40 dBc
RFゲートフラグ
1
0
RFゲートフラグが使用されるとRF出力がオフになる
規格 le -60 dBc (OnOff比 gt 60 dB)
IQ = 0でのパワー
IQ変調器
パルス変調器ベースバンド
ジェネレータ
ディレイ調整
RF
RFゲート
I
Q
RFゲートフラグOffでのパワー
8
Slide 15MG3700A-J-F-11
タイミング
bull マーカがIQデータポイントごとにセットされるのでマーカデータはIQデ
ータポイントと同じサンプル数をもちます
bull イベントマーカ出力コネクタとRFコネクタの間の時間差はplusmn1サンプル内に調整されています
IQ変調器
パルス変調器
ベースバンドジェネレータ
ディレイ調整
RF
RFゲート
マーカ 1マーカ 2マーカ 3
IQ1 IQ2 IQ3 hellip
hellip
IQ4
ゲート1(1) ゲート2(0) ゲート3(1) ゲート4(1) hellip
RFI
Q
Slide 16MG3700A-J-F-11
ファイルヘッダ
bull データファイル(wvd)とファイルヘッダ(wvi)は同じファイル名を持ちますMG3700Aは同じパッケージフォルダにファイルを格納します
bull ファイルヘッダはサンプルレートサンプル数IQ DAC RMS値などのARB変調フォーマット用設定を収録してます
raquo MG3700Aは不特定のヘッダ設定を見つけた場合デフォルト設定かシ
グナルパターンが以前再生されたときの前のシグナルパターンからの設定のどちらかを使用します
9
Slide 17MG3700A-J-F-11
データファイルサイズ
bull データファイル(wvd)はベースバンドメモリにロードされます使用メモリサ
イズがデータファイルサイズに等しいことを意味しますbull ベースバンド波形はサンプル点から成ります1サンプルは4バイトをもち
ますraquo IQデータ + マーカデータ = 1 波形サンプル
14ビット I 4ビット 4バイト (32ビット)14ビット Q
チャネルI Q ( マーカ1 マーカ2 マーカ3 RFゲートフラグ)
最大256000000 サンプル512000000 サンプル オプション付
サンプリングレート(サンプル秒) FsHzで表されるサンプリング周波数
サンプリング間隔 Ts=1Fs一様なサンプリングでのサンプル間の時間
Slide 18MG3700A-J-F-11
IQデータファイルを生成するプログラミング例
bull ARB IQデータを生成するために様々なプログラミング環境があります
概して2タイプありますraquo シミュレーションソフトウェア (EDAツール)
ndash MATLAB Microwave Office など
raquo 高度なプログラミング言語ndash CC++ VB LabView など
bull 実例ではMATLABを使用しプログラマブルなM-ファイルを示しますraquo M-ファイル コマンドスクリプト用MATLABプログラム
10
Slide 19MG3700A-J-F-11
アナログ変調
bull アナログ変調スキームは最も基本テクニックでありIQデータを生成する
ことは単純です
基本的なアナログ変調スキームraquo 振幅変調 (AM)raquo 周波数変調 (FM)raquo 位相変調 (PM)
I
Q変調度 []micro = Vp Ac
Ac
I
Q
I
Q 位相シフトπ2 [rad]
Vp
AM FM PM
Vp角速度[rads]
Ac
Ac Ac
Ac
Slide 20MG3700A-J-F-11
AM
c(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
s(t)
-2
-15
-1
-05
0
05
1
15
2
t
Am
plitu
de [V
]
変調度 micro 80 []
包絡線 R(t)
キャリア
被変調信号
m(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号
11
Slide 21MG3700A-J-F-11
AM プログラミング例
bull I = x(t) = Ac[1+m(t)] = 1+micro sin(2πƒmt)bull Q = y(t) = 0
bull Ac キャリア信号振幅 = 1bull micro 変調度 = 変調信号ピークキャリア信号ピーク (振幅)
clear all close all clc
fm = 1 Modulating frequency [kHz]Depth = 08 Modulating depthCSVfile = AM1kHzDepth80csv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = 1+Depthsin(2pifmtDataPoints)Q = zeros(1DataPoints)data = [I Q]csvwrite(CSVfiledata)
Slide 22MG3700A-J-F-11
FMm(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
Df
-60
-40
-20
0
20
40
60
t
Freq
uenc
y de
viat
ion
[kH
z]
s(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号
ピーク周波数偏移 ∆ƒ 50 [kHz]
c(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
被変調信号キャリア
12
Slide 23MG3700A-J-F-11
FM プログラミング例
bull I = x(t) = = cos[β sin(2πƒmt)]bull Q = y(t) = = sin[β sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull β 変調指数 = ∆ƒƒmbull ∆ƒ ピーク周波数偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 50 Peak frequency deviation [kHz]CSVfile = FM1kHzDeviation50kHzcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationfmsin(2pifmtDataPoints))Q = sin(Deviationfmsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
Slide 24MG3700A-J-F-11
PMm(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号Dp
-2
-15
-1
-05
0
05
1
15
2
t
Pha
se d
evia
tion
[π r
ad]
ピーク位相偏移 5 [rad] asymp 16 π [rad]
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
c(t) s(t)被変調信号キャリア
13
Slide 25MG3700A-J-F-11
PM プログラミング例
bull I = x(t) = Ac cos[Dp m(t)] = cos[Dp sin(2πƒmt)]bull Q = y(t) = Ac sin[Dp m(t)] = sin[Dp sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull Dp ピーク位相偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 5 Peak phase deviation [kHz]CSVfile = PM1kHzDeviation5radcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationsin(2pifmtDataPoints))Q = sin(Deviationsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
Slide 26MG3700A-J-F-11
パルス変調
bull パルス変調はFMかPMのいずれかと時間多重化バースト信号との組
み合わせを使用してレーダや衛星の信号に使用されますndash PRFPRR パルス繰り返し周波数速度 [pps] [pulses]ndash パルス周期 [s] 1PRFndash パルス幅 [s] 立ち上がり時間含むndash デューティ比 [] パルス幅パルス周期ndash バーストあたりのパルス数 [pulsesburst]ndash バースト長 [s]ndash バースト周期 [s]ndash 立ち上がり時間 [s]
パルス周期
パルス幅
バーストあたりのパルス数バースト長 バースト周期
立ち上がり時間
14
Slide 27MG3700A-J-F-11
パルス変調 プログラミング例
bull I = x(t) = Ac = 1bull Q = y(t) = Ac = 1
bull Ac キャリア信号振幅 = 1bull PRF 700 [pps]bull パルス幅 1 [micros]bull Pulses burst 18bull バースト周期 10 [s]
clear all close all clc
PRF = 700 [pps]PulseWidth = 1E-6 [s]PulsesPerBurst = 18 [pulsesburst]BurstPeriod = 10 [s]CSVfile = Pulse700ppsW1us18ppbB10scsvzerofile = Pulse700ppsW1us18ppbB10sZerocsv
Fs = LCM(PRF1PulseWidth) Sampling rate [Hz] LCM Least Common Multiple Number of samplesW = PulseWidthFsPulseGap = (1PRF-PulseWidth)Fs
(次ページにつづく)
CW
Slide 28MG3700A-J-F-11
パルス変調 プログラミング例
(前ページからつづく)
I = [ ones(1W+2) zeros(1PulseGap-2) ]Q = [ ones(1W+2) zeros(1PulseGap-2) ]RFgateFlag = [ zeros(11) ones(1W) zeros(1PulseGap) ]Burst = [ zeros(11) ones(1W) ]for n = 2PulsesPerBurst
I = [ I ones(1W+2) zeros(1PulseGap-2) ]Q = [ Q ones(1W+2) zeros(1PulseGap-2) ]Burst = [ Burst ones(1PulseGap+W) ]if n == PulsesPerBurst
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap-1) ]else
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap) ]end
end
Marker1 = [ Burst zeros(1PulseGap-1) ] BurstMarker2 = RFgateFlag PulseMarker3 = RFgateFlag Pulsedata = [I Q Marker1 Marker2 Marker3 RFgateFlag]csvwrite(CSVfiledata)
BurstGapPulseLength = PRFBurstPeriod-PulsesPerBurstzero = zeros(1FsPRF) samplespulsezerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)zerofileMultiple = PRFBurstPeriod-PulsesPerBurst Pulse length in Burst gap
IQ
RF gate flag
15
Slide 29MG3700A-J-F-11
パルス変調 プログラミング例
繰り返し
シーケンス機能テクニック
Slide 30MG3700A-J-F-11
パルス変調 プログラミング例
繰り返しエレメント1 エレメント2
シーケンスファイルを生成
16
Slide 31MG3700A-J-F-11
パルスチャープ変調 プログラミング例
bull I = x(t) =bull Q = y(t) =
bull Ac キャリア信号振幅 = 1bull PRF 2000 [pps]bull パルス幅 20 [micros]bull Pulses burst 20
clear all close all clc
PW = 20 Pulse Width [us]PRF = 2000 [pps]Fpeak = 25 Peak Frequency Deviation [MHz]CSVfile = RTS6W20us2000ppscsvzerofile =RTS6W20us2000ppsZerocsv
Fs = Fpeak 40 Sampling rate [MHz]DataPoints = PW Fs
(次ページにつづく)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
FM
Slide 32MG3700A-J-F-11
パルスチャープ変調 プログラミング例
(前ページからつづく)
t = 0DataPointsdPhi = 2pi(-Fpeak + 2 Fpeak tDataPoints)Fs Frequency deviation from -Fpeak to
+FpeakPhi = cumsum(dPhi2) Comulative SumI = cos(Phi)Q = sin(Phi)
I = [zeros(11) I zeros(12)]Q = [zeros(11) Q zeros(12)]BurstFlag = ones(1DataPoints+4)RFgateFlag = [ones(1DataPoints+3) zeros(11)]
data=[I Q BurstFlag RFgateFlag RFgateFlag RFgateFlag] Marker1 Burst OnOff Flag Marker2amp3 RF OnOff Flag
csvwrite(CSVfiledata)
zero = zeros(1DataPoints+4)zerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)
PulsePeriod = Fs 1E6 PRF Pulse period samplesFrameLength = DataPoints + 4GapLength = PulsePeriod - DataPoints - 4
IQ
RF gate flag
17
Slide 33MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンス機能テクニック
Slide 34MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンスファイルを生成
18
Slide 35MG3700A-J-F-11
PSK QAM
bull デジタル変調スキームは一定時間ごとにキャリアの振幅周波数および位相を変更しデジタルベースバンド信号を送ります
raquo アナログ変調スキームはキャリアの振幅周波数および位相を連続的に変更します
基本的なデジタル変調スキームraquo 振幅シフトキーイング (ASK)
ndash キャリアの振幅がシンボル系列で線形に変化する
raquo 周波数シフトキーイング (FSK)ndash キャリアの周波数がシンボル系列で線形に変化する
raquo 位相シフトキーイング (PSK)ディファレンシャル位相シフトキーイング (DPSK)
ndash キャリアの位相がシンボル系列で線形に変化する
raquo 直交振幅変調 (QAM)ndash キャリアの振幅と位相がシンボル系列で線形に変化する
1 10
Slide 36MG3700A-J-F-11
PSK QAM
bull 本章ではQPSKπ4DQPSK8PSK16QAMの一般例を示します
I
Q
00
Ac-Ac
-Ac
Ac
QPSK
01
10
11
I
Q
Ac-Ac
-Ac
Ac
π4DQPSK
00
01 1011
IAc-Ac
-Ac
Ac
000
001
010
011
Q
100
101
110
111
IAc-Ac-Ac
Ac
0000
0001
0010
0011
Q
1100
1101
1110
1111
8PSK 16QAM
0101
0100
0111
0110
10101000
10111001
3Ac-3Ac
3Ac
-3Ac
19
Slide 37MG3700A-J-F-11
QPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=QPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) Initial phase
pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
Slide 38MG3700A-J-F-11
QPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 round(min(real(g))) round(max(real(g)))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 round(min(imag(g))) round(max(imag(g)))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
20
Slide 39MG3700A-J-F-11
波形位相連続
bull MG3700Aは有限長の波形を再生し絶え間なくリピートします波形の最後と次のリ
ピートの最初との間の位相不連続は周期的なスペクトルリグロースやひずみに至ります
bull 急な位相変化でのリピートは高周波スペクトルリグロースをもたらします
Pd = 16 symbol points波形 ではシンボルデータ長 複製シンボルデータ
波形長
Slide 40MG3700A-J-F-11
π4DQPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=pi4DQPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = dpskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) using phase
shift pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
21
Slide 41MG3700A-J-F-11
π4DQPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 42MG3700A-J-F-11
8PSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=8PSKcsv
M = 8 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
22
Slide 43MG3700A-J-F-11
8PSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 44MG3700A-J-F-11
16QAM
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=16QAMcsv
M = 16 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
23
Slide 45MG3700A-J-F-11
16QAM
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 46MG3700A-J-F-11
Simulinkbull Simulinkとは
raquo Simulinkregはダイナミックシステムのモデル化シミュレーション解析を行
うためのソフトウェアパッケージです連続時間サンプリングした時間または混在のハイブリッドにおいてモデル化された線形や非線形システムをサポートします
bull シミュレーション用ツールraquo 簡単にゼロからモデルを構築できあるいは既存のモデルを取得し追加で
きますMATLAB内のすべての分析ツールに素早くアクセスし結果を取得
し分析および視覚化できます
bull モデルベースデザイン用ツールraquo モデル化ではSimulinkはドラッグampドロップマウス操作を使用してブロッ
クダイヤグラムのようなモデルを構築するためのGUIを提供します自分の
ブロックをカスタマイズし生成することもできますraquo モデルは階層的でトップダウンとボトムアップの両方のアプローチを用いて
構築できますraquo モデルの定義後シミュレートできますシミュレーション結果は後処理と視
覚化のためにMATLABワークスペースに入れることができますCSV file
Simulinkに関する詳細についてはサイバネットシステム(株)ウェブサイトを参照してくださいhttpdlcybernetcojpmatlabsupportmanualr2006toolboxsimulinkindexshtml
24
Slide 47MG3700A-J-F-11
Simulink デモ
bull Simulinkデモは役に立つモデル化コンセプトを図解しますMATLAB Command Windowからデモにアクセスできます
Slide 48MG3700A-J-F-11
Simulink Blockset デモ
bull Blocksetは特定分野での設計やシミュレーションのために設計された専門Simulinkブロックの集まりです
bull 例えば Communications Blocksetは通信システムやコンポーネントのフィジカルレイヤを設計しシミュレートするために Simulinkのブロックの包括的ライブラリを拡張しますBlocksetは通信システムや半導体コン
ポーネント例えば商業か防衛のワイヤレスか有線システムなどを設計するのに役立ちます
Communications Blockset内のブロックを用い適応変調を含んだIEEE 80211a WLANスタンダードのフィジカルレイヤのモデル
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
1
Slide 1MG3700A-J-F-11
アプリケーションノート- アプリケーション -
アンリツ
2008年1月(300)
Slide 2MG3700A-J-F-11
目次
bull はじめに 3bull 変調の基礎 5bull シグナルパターンファイルを理解する 10bull IQデータファイルを生成するプログラミング例
18raquo アナログ変調 19raquo パルス変調 26raquo PSK QAM 35raquo Simulink 46
bull IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例 68
2
Slide 3MG3700A-J-F-11
はじめに
bull MATLABやMicrowave OfficeのようなEDA(Electronic Design Automation)ツールはIQシミュレーションデータをCSVテキストファイル
にセーブできますraquo シミュレーションと計測データの容易な比較
bull アプリケーションソフトウェアIQプロデューサ(MG3700A標準付属品)はユーザのIQサンプルデータをCSVファイルからMG700Aへインポートで
き様々なアプリケーションに役立ちますraquo 次世代ワイヤレスシステムへのRampD RFID PMW アナログ変調 (AM FM
PM)
ベースバンド信号のCSVファイル生成
CプログラムやMATLABのようなEDAツール
による信号処理(シミュレーション)
MG3700A用シグナル
パターンファイルへ変換
FTP
ユーザ独自のソフトウェア
Slide 4MG3700A-J-F-11
はじめに
bull MG3700Aは任意波形発生器(AWG)の機能をサポートしま
すraquo サンプルレート (Fs)
ndash 20 k sim 160 MHzraquo 波形メモリ
ndash 2times 128 Mサンプルチャネル (1 GB)ndash 2times 256 Mサンプルチャネル (2 GB) メモリアップグレードオプション付で
bull デュアルベースバンドメモリ
raquo DAC分解能ndash 14 ビット
raquo マーカ出力ndash 3 定義可能 TTL
bull 本書は MATLAB使用例を紹介します
3
Slide 5MG3700A-J-F-11
変調の基礎
bull 変調は振幅や位相あるいはその両方の変化を用いて搬送波周波数ƒc上の帯域通過信号にデータを変換します
信号処理 周波数変更データ 被変調信号
変調信号m(t)
ベースバンド信号g(t)
帯域通過信号s(t)ベースバンド回路 RF回路
fm-fm
振幅
fc+fmfc-fm fc0 f
ベースバンド帯域幅
帯域通過帯域幅
Slide 6MG3700A-J-F-11
変調送信機
bull 振幅位相変調テクニック
bull 直交(IQ)変調
テクニック
ベースバンド信号処理 ƒc
m(t)
R(t) v(t)=R(t) cos[ωct+θ(t)]
ベースバンド回路 RF回路
sum
θ(t)φM cos[ωct+θ(t)]
ωc=2πƒc
ベースバンド信号処理
ƒcm(t)
x(t)
v(t)=x(t) cos(ωct) - y(t) sin(ωct)
ベースバンド回路 RF回路
y(t)
-π2 シフト
+
-
cos(ωct)
cos(ωct)
sin(ωct)
等価
)()()( 22 tytxtR +=
x(t)=R(t) cosθ(t)y(t)=R(t) sinθ(t)
I
Q
4
Slide 7MG3700A-J-F-11
ベースバンド波形
Dp 位相偏移 [radV]Acsin[Dpm(t)]Accos[Dpm(t)]Dpm(t)AcPM
m1(t) = plusmn1m2(t) = plusmn1
Dƒ 周波数偏移[radVmiddots]
m(t)=micro sin(2πƒmt)micro 変調度
ƒm 変調周波数
備考
Acm2(t)Acm1(t)QM
AcFM
0Ac[1+m(t)]0Ac[1+m(t)]AM
y(t)x(t)θ(t)R(t)変調方式
直交変調振幅位相変調
int infinminus
t
f dmD σσ )(
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
)()( 22
21 tmtmAc + )(
)(tan1
21
tmtmminus
QM 直交変調 Quadrature Modulation
Slide 8MG3700A-J-F-11
ベースバンド信号
bull どのようなタイプの被変調信号も振幅位相変調あるいは直交変調のどちらかのテクニックを用いて発生されます
bull 適切なソフトウェアアルゴリズムを選択することによってどのような変調方式も実現できます
bull ベクトル信号発生器(VSG)では帯域通過信号s(t)は2チャネルに分解して考えられることが多く1つはI(in-phase 同相)チャネルもう1つはQ (quadrature-phase 直交)チャネルでありそれぞれx(t)とy(t)に対応しま
すbull 帯域通過信号のコンピュータシミュレーションを行う場合帯域通過信号
s(t)の代わりにその等価低域信号であるベースバンド信号を用いることに
よってシミュレーションでのサンプリングレートを小さくすることができます
5
Slide 9MG3700A-J-F-11
bull CW
bull FM
bull AM
bull PSK
基本IQコンスタレーション
I
Q
I
Q
振幅 R(t)
I
Q
I
Q位相シフトπ2 [rad]
Ac
Ac-Ac
-Ac
Ac
角速度[rads]
Ac
Ac
Ac
Ac
Slide 10MG3700A-J-F-11
シグナルパターンファイルを理解する
bull シグナルパターンファイルは3つのデータから成りますraquo IQデータ
raquo マーカデータraquo ファイルヘッダ
ユーザ作成IQデータ
とマーカデータ
wvdバイナリファイル
wviテキストファイル
FTP
CF
FTP接続
HDD
テキストファイルをバイナリファイルへ大 ltltlt ファイルサイズ gtgtgt 小
ファイルヘッダ
IQデータはDAC入力値へ目盛り付けされるダウンロード rarr
larr抽出
6
Slide 11MG3700A-J-F-11
IQデータ
bull データファイル(wvd)はIおよびQデータポイント(IおよびQのデータポイントごとの符号付き14ビット整数)を含みます各IQポイントは1つのベース
バンド波形ポイントに相当しますbull MG3700AはIおよびQデータポイントの2バイト整数値のそれぞれを処
理するために14ビットDACを使用します14ビットDACは0sim16383のレンジを持ちますがMG3700Aは正数と負数にこのレンジを分けます
IQデータレンジ DACレンジ IQ出力電圧ndash 8191 ----------------- 16383 ----------------- Vmax 正数(+) フルスケールndash 0 ----------------- 8191 ----------------- 0 Vndash -8192 ----------------- 0 ----------------- Vmin 負数(-) フルスケール
DACIデータ LPF
DACQデータ LPF Q
I
Slide 12MG3700A-J-F-11
IQデータレンジ
bull MG3700A性能はIQ DAC RMS値1157sim1634内で保証されますraquo クレストファクタ(ピークパワーRMSパワー)を考慮した調整できるDAC RMS
値raquo MG3700Aディスプレイ上で調整できる RMSパワー22 QI +
Q
+8191
+8191
-8191
-8191
+1634
+1157
0
11 dB
3 dB
210 8191log202778 asympdB
22 QI +
2210 16341634log202867 +asympdB
2210 11571157log202864 +asympdB
I+1157 +1634
クレストファクタのためのマージン
7
Slide 13MG3700A-J-F-11
マーカデータ
bull マーカデータはIQデータポイントごとにOn(1)またはOff(0)の4マーカ状態をセットするためにIQデータポイントあたり4ビットを使用します
bull マーカデータは3イベントマーカとRFゲートフラグから成りますbull イベントマーカがアクティブ(On)のときアクティブマーカ番号1sim3に対応
するリアパネルマーカコネクタでトリガ信号を出力しますbull RFゲートフラグはパルス変調のために使用され内部パルス変調器を駆
動します
raquo マーカデータなしでIQデータをインポートすると自動的にイベントマーカはインアクティブ(Off)RFゲートフラグはアクティブ(On)になります
Slide 14MG3700A-J-F-11
内部パルス変調器
バーストパワー
RFゲートフラグが使用されない場合キャリアリークが存在する
規格 le -40 dBc
RFゲートフラグ
1
0
RFゲートフラグが使用されるとRF出力がオフになる
規格 le -60 dBc (OnOff比 gt 60 dB)
IQ = 0でのパワー
IQ変調器
パルス変調器ベースバンド
ジェネレータ
ディレイ調整
RF
RFゲート
I
Q
RFゲートフラグOffでのパワー
8
Slide 15MG3700A-J-F-11
タイミング
bull マーカがIQデータポイントごとにセットされるのでマーカデータはIQデ
ータポイントと同じサンプル数をもちます
bull イベントマーカ出力コネクタとRFコネクタの間の時間差はplusmn1サンプル内に調整されています
IQ変調器
パルス変調器
ベースバンドジェネレータ
ディレイ調整
RF
RFゲート
マーカ 1マーカ 2マーカ 3
IQ1 IQ2 IQ3 hellip
hellip
IQ4
ゲート1(1) ゲート2(0) ゲート3(1) ゲート4(1) hellip
RFI
Q
Slide 16MG3700A-J-F-11
ファイルヘッダ
bull データファイル(wvd)とファイルヘッダ(wvi)は同じファイル名を持ちますMG3700Aは同じパッケージフォルダにファイルを格納します
bull ファイルヘッダはサンプルレートサンプル数IQ DAC RMS値などのARB変調フォーマット用設定を収録してます
raquo MG3700Aは不特定のヘッダ設定を見つけた場合デフォルト設定かシ
グナルパターンが以前再生されたときの前のシグナルパターンからの設定のどちらかを使用します
9
Slide 17MG3700A-J-F-11
データファイルサイズ
bull データファイル(wvd)はベースバンドメモリにロードされます使用メモリサ
イズがデータファイルサイズに等しいことを意味しますbull ベースバンド波形はサンプル点から成ります1サンプルは4バイトをもち
ますraquo IQデータ + マーカデータ = 1 波形サンプル
14ビット I 4ビット 4バイト (32ビット)14ビット Q
チャネルI Q ( マーカ1 マーカ2 マーカ3 RFゲートフラグ)
最大256000000 サンプル512000000 サンプル オプション付
サンプリングレート(サンプル秒) FsHzで表されるサンプリング周波数
サンプリング間隔 Ts=1Fs一様なサンプリングでのサンプル間の時間
Slide 18MG3700A-J-F-11
IQデータファイルを生成するプログラミング例
bull ARB IQデータを生成するために様々なプログラミング環境があります
概して2タイプありますraquo シミュレーションソフトウェア (EDAツール)
ndash MATLAB Microwave Office など
raquo 高度なプログラミング言語ndash CC++ VB LabView など
bull 実例ではMATLABを使用しプログラマブルなM-ファイルを示しますraquo M-ファイル コマンドスクリプト用MATLABプログラム
10
Slide 19MG3700A-J-F-11
アナログ変調
bull アナログ変調スキームは最も基本テクニックでありIQデータを生成する
ことは単純です
基本的なアナログ変調スキームraquo 振幅変調 (AM)raquo 周波数変調 (FM)raquo 位相変調 (PM)
I
Q変調度 []micro = Vp Ac
Ac
I
Q
I
Q 位相シフトπ2 [rad]
Vp
AM FM PM
Vp角速度[rads]
Ac
Ac Ac
Ac
Slide 20MG3700A-J-F-11
AM
c(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
s(t)
-2
-15
-1
-05
0
05
1
15
2
t
Am
plitu
de [V
]
変調度 micro 80 []
包絡線 R(t)
キャリア
被変調信号
m(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号
11
Slide 21MG3700A-J-F-11
AM プログラミング例
bull I = x(t) = Ac[1+m(t)] = 1+micro sin(2πƒmt)bull Q = y(t) = 0
bull Ac キャリア信号振幅 = 1bull micro 変調度 = 変調信号ピークキャリア信号ピーク (振幅)
clear all close all clc
fm = 1 Modulating frequency [kHz]Depth = 08 Modulating depthCSVfile = AM1kHzDepth80csv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = 1+Depthsin(2pifmtDataPoints)Q = zeros(1DataPoints)data = [I Q]csvwrite(CSVfiledata)
Slide 22MG3700A-J-F-11
FMm(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
Df
-60
-40
-20
0
20
40
60
t
Freq
uenc
y de
viat
ion
[kH
z]
s(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号
ピーク周波数偏移 ∆ƒ 50 [kHz]
c(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
被変調信号キャリア
12
Slide 23MG3700A-J-F-11
FM プログラミング例
bull I = x(t) = = cos[β sin(2πƒmt)]bull Q = y(t) = = sin[β sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull β 変調指数 = ∆ƒƒmbull ∆ƒ ピーク周波数偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 50 Peak frequency deviation [kHz]CSVfile = FM1kHzDeviation50kHzcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationfmsin(2pifmtDataPoints))Q = sin(Deviationfmsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
Slide 24MG3700A-J-F-11
PMm(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号Dp
-2
-15
-1
-05
0
05
1
15
2
t
Pha
se d
evia
tion
[π r
ad]
ピーク位相偏移 5 [rad] asymp 16 π [rad]
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
c(t) s(t)被変調信号キャリア
13
Slide 25MG3700A-J-F-11
PM プログラミング例
bull I = x(t) = Ac cos[Dp m(t)] = cos[Dp sin(2πƒmt)]bull Q = y(t) = Ac sin[Dp m(t)] = sin[Dp sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull Dp ピーク位相偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 5 Peak phase deviation [kHz]CSVfile = PM1kHzDeviation5radcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationsin(2pifmtDataPoints))Q = sin(Deviationsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
Slide 26MG3700A-J-F-11
パルス変調
bull パルス変調はFMかPMのいずれかと時間多重化バースト信号との組
み合わせを使用してレーダや衛星の信号に使用されますndash PRFPRR パルス繰り返し周波数速度 [pps] [pulses]ndash パルス周期 [s] 1PRFndash パルス幅 [s] 立ち上がり時間含むndash デューティ比 [] パルス幅パルス周期ndash バーストあたりのパルス数 [pulsesburst]ndash バースト長 [s]ndash バースト周期 [s]ndash 立ち上がり時間 [s]
パルス周期
パルス幅
バーストあたりのパルス数バースト長 バースト周期
立ち上がり時間
14
Slide 27MG3700A-J-F-11
パルス変調 プログラミング例
bull I = x(t) = Ac = 1bull Q = y(t) = Ac = 1
bull Ac キャリア信号振幅 = 1bull PRF 700 [pps]bull パルス幅 1 [micros]bull Pulses burst 18bull バースト周期 10 [s]
clear all close all clc
PRF = 700 [pps]PulseWidth = 1E-6 [s]PulsesPerBurst = 18 [pulsesburst]BurstPeriod = 10 [s]CSVfile = Pulse700ppsW1us18ppbB10scsvzerofile = Pulse700ppsW1us18ppbB10sZerocsv
Fs = LCM(PRF1PulseWidth) Sampling rate [Hz] LCM Least Common Multiple Number of samplesW = PulseWidthFsPulseGap = (1PRF-PulseWidth)Fs
(次ページにつづく)
CW
Slide 28MG3700A-J-F-11
パルス変調 プログラミング例
(前ページからつづく)
I = [ ones(1W+2) zeros(1PulseGap-2) ]Q = [ ones(1W+2) zeros(1PulseGap-2) ]RFgateFlag = [ zeros(11) ones(1W) zeros(1PulseGap) ]Burst = [ zeros(11) ones(1W) ]for n = 2PulsesPerBurst
I = [ I ones(1W+2) zeros(1PulseGap-2) ]Q = [ Q ones(1W+2) zeros(1PulseGap-2) ]Burst = [ Burst ones(1PulseGap+W) ]if n == PulsesPerBurst
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap-1) ]else
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap) ]end
end
Marker1 = [ Burst zeros(1PulseGap-1) ] BurstMarker2 = RFgateFlag PulseMarker3 = RFgateFlag Pulsedata = [I Q Marker1 Marker2 Marker3 RFgateFlag]csvwrite(CSVfiledata)
BurstGapPulseLength = PRFBurstPeriod-PulsesPerBurstzero = zeros(1FsPRF) samplespulsezerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)zerofileMultiple = PRFBurstPeriod-PulsesPerBurst Pulse length in Burst gap
IQ
RF gate flag
15
Slide 29MG3700A-J-F-11
パルス変調 プログラミング例
繰り返し
シーケンス機能テクニック
Slide 30MG3700A-J-F-11
パルス変調 プログラミング例
繰り返しエレメント1 エレメント2
シーケンスファイルを生成
16
Slide 31MG3700A-J-F-11
パルスチャープ変調 プログラミング例
bull I = x(t) =bull Q = y(t) =
bull Ac キャリア信号振幅 = 1bull PRF 2000 [pps]bull パルス幅 20 [micros]bull Pulses burst 20
clear all close all clc
PW = 20 Pulse Width [us]PRF = 2000 [pps]Fpeak = 25 Peak Frequency Deviation [MHz]CSVfile = RTS6W20us2000ppscsvzerofile =RTS6W20us2000ppsZerocsv
Fs = Fpeak 40 Sampling rate [MHz]DataPoints = PW Fs
(次ページにつづく)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
FM
Slide 32MG3700A-J-F-11
パルスチャープ変調 プログラミング例
(前ページからつづく)
t = 0DataPointsdPhi = 2pi(-Fpeak + 2 Fpeak tDataPoints)Fs Frequency deviation from -Fpeak to
+FpeakPhi = cumsum(dPhi2) Comulative SumI = cos(Phi)Q = sin(Phi)
I = [zeros(11) I zeros(12)]Q = [zeros(11) Q zeros(12)]BurstFlag = ones(1DataPoints+4)RFgateFlag = [ones(1DataPoints+3) zeros(11)]
data=[I Q BurstFlag RFgateFlag RFgateFlag RFgateFlag] Marker1 Burst OnOff Flag Marker2amp3 RF OnOff Flag
csvwrite(CSVfiledata)
zero = zeros(1DataPoints+4)zerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)
PulsePeriod = Fs 1E6 PRF Pulse period samplesFrameLength = DataPoints + 4GapLength = PulsePeriod - DataPoints - 4
IQ
RF gate flag
17
Slide 33MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンス機能テクニック
Slide 34MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンスファイルを生成
18
Slide 35MG3700A-J-F-11
PSK QAM
bull デジタル変調スキームは一定時間ごとにキャリアの振幅周波数および位相を変更しデジタルベースバンド信号を送ります
raquo アナログ変調スキームはキャリアの振幅周波数および位相を連続的に変更します
基本的なデジタル変調スキームraquo 振幅シフトキーイング (ASK)
ndash キャリアの振幅がシンボル系列で線形に変化する
raquo 周波数シフトキーイング (FSK)ndash キャリアの周波数がシンボル系列で線形に変化する
raquo 位相シフトキーイング (PSK)ディファレンシャル位相シフトキーイング (DPSK)
ndash キャリアの位相がシンボル系列で線形に変化する
raquo 直交振幅変調 (QAM)ndash キャリアの振幅と位相がシンボル系列で線形に変化する
1 10
Slide 36MG3700A-J-F-11
PSK QAM
bull 本章ではQPSKπ4DQPSK8PSK16QAMの一般例を示します
I
Q
00
Ac-Ac
-Ac
Ac
QPSK
01
10
11
I
Q
Ac-Ac
-Ac
Ac
π4DQPSK
00
01 1011
IAc-Ac
-Ac
Ac
000
001
010
011
Q
100
101
110
111
IAc-Ac-Ac
Ac
0000
0001
0010
0011
Q
1100
1101
1110
1111
8PSK 16QAM
0101
0100
0111
0110
10101000
10111001
3Ac-3Ac
3Ac
-3Ac
19
Slide 37MG3700A-J-F-11
QPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=QPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) Initial phase
pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
Slide 38MG3700A-J-F-11
QPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 round(min(real(g))) round(max(real(g)))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 round(min(imag(g))) round(max(imag(g)))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
20
Slide 39MG3700A-J-F-11
波形位相連続
bull MG3700Aは有限長の波形を再生し絶え間なくリピートします波形の最後と次のリ
ピートの最初との間の位相不連続は周期的なスペクトルリグロースやひずみに至ります
bull 急な位相変化でのリピートは高周波スペクトルリグロースをもたらします
Pd = 16 symbol points波形 ではシンボルデータ長 複製シンボルデータ
波形長
Slide 40MG3700A-J-F-11
π4DQPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=pi4DQPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = dpskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) using phase
shift pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
21
Slide 41MG3700A-J-F-11
π4DQPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 42MG3700A-J-F-11
8PSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=8PSKcsv
M = 8 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
22
Slide 43MG3700A-J-F-11
8PSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 44MG3700A-J-F-11
16QAM
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=16QAMcsv
M = 16 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
23
Slide 45MG3700A-J-F-11
16QAM
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 46MG3700A-J-F-11
Simulinkbull Simulinkとは
raquo Simulinkregはダイナミックシステムのモデル化シミュレーション解析を行
うためのソフトウェアパッケージです連続時間サンプリングした時間または混在のハイブリッドにおいてモデル化された線形や非線形システムをサポートします
bull シミュレーション用ツールraquo 簡単にゼロからモデルを構築できあるいは既存のモデルを取得し追加で
きますMATLAB内のすべての分析ツールに素早くアクセスし結果を取得
し分析および視覚化できます
bull モデルベースデザイン用ツールraquo モデル化ではSimulinkはドラッグampドロップマウス操作を使用してブロッ
クダイヤグラムのようなモデルを構築するためのGUIを提供します自分の
ブロックをカスタマイズし生成することもできますraquo モデルは階層的でトップダウンとボトムアップの両方のアプローチを用いて
構築できますraquo モデルの定義後シミュレートできますシミュレーション結果は後処理と視
覚化のためにMATLABワークスペースに入れることができますCSV file
Simulinkに関する詳細についてはサイバネットシステム(株)ウェブサイトを参照してくださいhttpdlcybernetcojpmatlabsupportmanualr2006toolboxsimulinkindexshtml
24
Slide 47MG3700A-J-F-11
Simulink デモ
bull Simulinkデモは役に立つモデル化コンセプトを図解しますMATLAB Command Windowからデモにアクセスできます
Slide 48MG3700A-J-F-11
Simulink Blockset デモ
bull Blocksetは特定分野での設計やシミュレーションのために設計された専門Simulinkブロックの集まりです
bull 例えば Communications Blocksetは通信システムやコンポーネントのフィジカルレイヤを設計しシミュレートするために Simulinkのブロックの包括的ライブラリを拡張しますBlocksetは通信システムや半導体コン
ポーネント例えば商業か防衛のワイヤレスか有線システムなどを設計するのに役立ちます
Communications Blockset内のブロックを用い適応変調を含んだIEEE 80211a WLANスタンダードのフィジカルレイヤのモデル
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
2
Slide 3MG3700A-J-F-11
はじめに
bull MATLABやMicrowave OfficeのようなEDA(Electronic Design Automation)ツールはIQシミュレーションデータをCSVテキストファイル
にセーブできますraquo シミュレーションと計測データの容易な比較
bull アプリケーションソフトウェアIQプロデューサ(MG3700A標準付属品)はユーザのIQサンプルデータをCSVファイルからMG700Aへインポートで
き様々なアプリケーションに役立ちますraquo 次世代ワイヤレスシステムへのRampD RFID PMW アナログ変調 (AM FM
PM)
ベースバンド信号のCSVファイル生成
CプログラムやMATLABのようなEDAツール
による信号処理(シミュレーション)
MG3700A用シグナル
パターンファイルへ変換
FTP
ユーザ独自のソフトウェア
Slide 4MG3700A-J-F-11
はじめに
bull MG3700Aは任意波形発生器(AWG)の機能をサポートしま
すraquo サンプルレート (Fs)
ndash 20 k sim 160 MHzraquo 波形メモリ
ndash 2times 128 Mサンプルチャネル (1 GB)ndash 2times 256 Mサンプルチャネル (2 GB) メモリアップグレードオプション付で
bull デュアルベースバンドメモリ
raquo DAC分解能ndash 14 ビット
raquo マーカ出力ndash 3 定義可能 TTL
bull 本書は MATLAB使用例を紹介します
3
Slide 5MG3700A-J-F-11
変調の基礎
bull 変調は振幅や位相あるいはその両方の変化を用いて搬送波周波数ƒc上の帯域通過信号にデータを変換します
信号処理 周波数変更データ 被変調信号
変調信号m(t)
ベースバンド信号g(t)
帯域通過信号s(t)ベースバンド回路 RF回路
fm-fm
振幅
fc+fmfc-fm fc0 f
ベースバンド帯域幅
帯域通過帯域幅
Slide 6MG3700A-J-F-11
変調送信機
bull 振幅位相変調テクニック
bull 直交(IQ)変調
テクニック
ベースバンド信号処理 ƒc
m(t)
R(t) v(t)=R(t) cos[ωct+θ(t)]
ベースバンド回路 RF回路
sum
θ(t)φM cos[ωct+θ(t)]
ωc=2πƒc
ベースバンド信号処理
ƒcm(t)
x(t)
v(t)=x(t) cos(ωct) - y(t) sin(ωct)
ベースバンド回路 RF回路
y(t)
-π2 シフト
+
-
cos(ωct)
cos(ωct)
sin(ωct)
等価
)()()( 22 tytxtR +=
x(t)=R(t) cosθ(t)y(t)=R(t) sinθ(t)
I
Q
4
Slide 7MG3700A-J-F-11
ベースバンド波形
Dp 位相偏移 [radV]Acsin[Dpm(t)]Accos[Dpm(t)]Dpm(t)AcPM
m1(t) = plusmn1m2(t) = plusmn1
Dƒ 周波数偏移[radVmiddots]
m(t)=micro sin(2πƒmt)micro 変調度
ƒm 変調周波数
備考
Acm2(t)Acm1(t)QM
AcFM
0Ac[1+m(t)]0Ac[1+m(t)]AM
y(t)x(t)θ(t)R(t)変調方式
直交変調振幅位相変調
int infinminus
t
f dmD σσ )(
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
)()( 22
21 tmtmAc + )(
)(tan1
21
tmtmminus
QM 直交変調 Quadrature Modulation
Slide 8MG3700A-J-F-11
ベースバンド信号
bull どのようなタイプの被変調信号も振幅位相変調あるいは直交変調のどちらかのテクニックを用いて発生されます
bull 適切なソフトウェアアルゴリズムを選択することによってどのような変調方式も実現できます
bull ベクトル信号発生器(VSG)では帯域通過信号s(t)は2チャネルに分解して考えられることが多く1つはI(in-phase 同相)チャネルもう1つはQ (quadrature-phase 直交)チャネルでありそれぞれx(t)とy(t)に対応しま
すbull 帯域通過信号のコンピュータシミュレーションを行う場合帯域通過信号
s(t)の代わりにその等価低域信号であるベースバンド信号を用いることに
よってシミュレーションでのサンプリングレートを小さくすることができます
5
Slide 9MG3700A-J-F-11
bull CW
bull FM
bull AM
bull PSK
基本IQコンスタレーション
I
Q
I
Q
振幅 R(t)
I
Q
I
Q位相シフトπ2 [rad]
Ac
Ac-Ac
-Ac
Ac
角速度[rads]
Ac
Ac
Ac
Ac
Slide 10MG3700A-J-F-11
シグナルパターンファイルを理解する
bull シグナルパターンファイルは3つのデータから成りますraquo IQデータ
raquo マーカデータraquo ファイルヘッダ
ユーザ作成IQデータ
とマーカデータ
wvdバイナリファイル
wviテキストファイル
FTP
CF
FTP接続
HDD
テキストファイルをバイナリファイルへ大 ltltlt ファイルサイズ gtgtgt 小
ファイルヘッダ
IQデータはDAC入力値へ目盛り付けされるダウンロード rarr
larr抽出
6
Slide 11MG3700A-J-F-11
IQデータ
bull データファイル(wvd)はIおよびQデータポイント(IおよびQのデータポイントごとの符号付き14ビット整数)を含みます各IQポイントは1つのベース
バンド波形ポイントに相当しますbull MG3700AはIおよびQデータポイントの2バイト整数値のそれぞれを処
理するために14ビットDACを使用します14ビットDACは0sim16383のレンジを持ちますがMG3700Aは正数と負数にこのレンジを分けます
IQデータレンジ DACレンジ IQ出力電圧ndash 8191 ----------------- 16383 ----------------- Vmax 正数(+) フルスケールndash 0 ----------------- 8191 ----------------- 0 Vndash -8192 ----------------- 0 ----------------- Vmin 負数(-) フルスケール
DACIデータ LPF
DACQデータ LPF Q
I
Slide 12MG3700A-J-F-11
IQデータレンジ
bull MG3700A性能はIQ DAC RMS値1157sim1634内で保証されますraquo クレストファクタ(ピークパワーRMSパワー)を考慮した調整できるDAC RMS
値raquo MG3700Aディスプレイ上で調整できる RMSパワー22 QI +
Q
+8191
+8191
-8191
-8191
+1634
+1157
0
11 dB
3 dB
210 8191log202778 asympdB
22 QI +
2210 16341634log202867 +asympdB
2210 11571157log202864 +asympdB
I+1157 +1634
クレストファクタのためのマージン
7
Slide 13MG3700A-J-F-11
マーカデータ
bull マーカデータはIQデータポイントごとにOn(1)またはOff(0)の4マーカ状態をセットするためにIQデータポイントあたり4ビットを使用します
bull マーカデータは3イベントマーカとRFゲートフラグから成りますbull イベントマーカがアクティブ(On)のときアクティブマーカ番号1sim3に対応
するリアパネルマーカコネクタでトリガ信号を出力しますbull RFゲートフラグはパルス変調のために使用され内部パルス変調器を駆
動します
raquo マーカデータなしでIQデータをインポートすると自動的にイベントマーカはインアクティブ(Off)RFゲートフラグはアクティブ(On)になります
Slide 14MG3700A-J-F-11
内部パルス変調器
バーストパワー
RFゲートフラグが使用されない場合キャリアリークが存在する
規格 le -40 dBc
RFゲートフラグ
1
0
RFゲートフラグが使用されるとRF出力がオフになる
規格 le -60 dBc (OnOff比 gt 60 dB)
IQ = 0でのパワー
IQ変調器
パルス変調器ベースバンド
ジェネレータ
ディレイ調整
RF
RFゲート
I
Q
RFゲートフラグOffでのパワー
8
Slide 15MG3700A-J-F-11
タイミング
bull マーカがIQデータポイントごとにセットされるのでマーカデータはIQデ
ータポイントと同じサンプル数をもちます
bull イベントマーカ出力コネクタとRFコネクタの間の時間差はplusmn1サンプル内に調整されています
IQ変調器
パルス変調器
ベースバンドジェネレータ
ディレイ調整
RF
RFゲート
マーカ 1マーカ 2マーカ 3
IQ1 IQ2 IQ3 hellip
hellip
IQ4
ゲート1(1) ゲート2(0) ゲート3(1) ゲート4(1) hellip
RFI
Q
Slide 16MG3700A-J-F-11
ファイルヘッダ
bull データファイル(wvd)とファイルヘッダ(wvi)は同じファイル名を持ちますMG3700Aは同じパッケージフォルダにファイルを格納します
bull ファイルヘッダはサンプルレートサンプル数IQ DAC RMS値などのARB変調フォーマット用設定を収録してます
raquo MG3700Aは不特定のヘッダ設定を見つけた場合デフォルト設定かシ
グナルパターンが以前再生されたときの前のシグナルパターンからの設定のどちらかを使用します
9
Slide 17MG3700A-J-F-11
データファイルサイズ
bull データファイル(wvd)はベースバンドメモリにロードされます使用メモリサ
イズがデータファイルサイズに等しいことを意味しますbull ベースバンド波形はサンプル点から成ります1サンプルは4バイトをもち
ますraquo IQデータ + マーカデータ = 1 波形サンプル
14ビット I 4ビット 4バイト (32ビット)14ビット Q
チャネルI Q ( マーカ1 マーカ2 マーカ3 RFゲートフラグ)
最大256000000 サンプル512000000 サンプル オプション付
サンプリングレート(サンプル秒) FsHzで表されるサンプリング周波数
サンプリング間隔 Ts=1Fs一様なサンプリングでのサンプル間の時間
Slide 18MG3700A-J-F-11
IQデータファイルを生成するプログラミング例
bull ARB IQデータを生成するために様々なプログラミング環境があります
概して2タイプありますraquo シミュレーションソフトウェア (EDAツール)
ndash MATLAB Microwave Office など
raquo 高度なプログラミング言語ndash CC++ VB LabView など
bull 実例ではMATLABを使用しプログラマブルなM-ファイルを示しますraquo M-ファイル コマンドスクリプト用MATLABプログラム
10
Slide 19MG3700A-J-F-11
アナログ変調
bull アナログ変調スキームは最も基本テクニックでありIQデータを生成する
ことは単純です
基本的なアナログ変調スキームraquo 振幅変調 (AM)raquo 周波数変調 (FM)raquo 位相変調 (PM)
I
Q変調度 []micro = Vp Ac
Ac
I
Q
I
Q 位相シフトπ2 [rad]
Vp
AM FM PM
Vp角速度[rads]
Ac
Ac Ac
Ac
Slide 20MG3700A-J-F-11
AM
c(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
s(t)
-2
-15
-1
-05
0
05
1
15
2
t
Am
plitu
de [V
]
変調度 micro 80 []
包絡線 R(t)
キャリア
被変調信号
m(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号
11
Slide 21MG3700A-J-F-11
AM プログラミング例
bull I = x(t) = Ac[1+m(t)] = 1+micro sin(2πƒmt)bull Q = y(t) = 0
bull Ac キャリア信号振幅 = 1bull micro 変調度 = 変調信号ピークキャリア信号ピーク (振幅)
clear all close all clc
fm = 1 Modulating frequency [kHz]Depth = 08 Modulating depthCSVfile = AM1kHzDepth80csv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = 1+Depthsin(2pifmtDataPoints)Q = zeros(1DataPoints)data = [I Q]csvwrite(CSVfiledata)
Slide 22MG3700A-J-F-11
FMm(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
Df
-60
-40
-20
0
20
40
60
t
Freq
uenc
y de
viat
ion
[kH
z]
s(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号
ピーク周波数偏移 ∆ƒ 50 [kHz]
c(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
被変調信号キャリア
12
Slide 23MG3700A-J-F-11
FM プログラミング例
bull I = x(t) = = cos[β sin(2πƒmt)]bull Q = y(t) = = sin[β sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull β 変調指数 = ∆ƒƒmbull ∆ƒ ピーク周波数偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 50 Peak frequency deviation [kHz]CSVfile = FM1kHzDeviation50kHzcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationfmsin(2pifmtDataPoints))Q = sin(Deviationfmsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
Slide 24MG3700A-J-F-11
PMm(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号Dp
-2
-15
-1
-05
0
05
1
15
2
t
Pha
se d
evia
tion
[π r
ad]
ピーク位相偏移 5 [rad] asymp 16 π [rad]
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
c(t) s(t)被変調信号キャリア
13
Slide 25MG3700A-J-F-11
PM プログラミング例
bull I = x(t) = Ac cos[Dp m(t)] = cos[Dp sin(2πƒmt)]bull Q = y(t) = Ac sin[Dp m(t)] = sin[Dp sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull Dp ピーク位相偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 5 Peak phase deviation [kHz]CSVfile = PM1kHzDeviation5radcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationsin(2pifmtDataPoints))Q = sin(Deviationsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
Slide 26MG3700A-J-F-11
パルス変調
bull パルス変調はFMかPMのいずれかと時間多重化バースト信号との組
み合わせを使用してレーダや衛星の信号に使用されますndash PRFPRR パルス繰り返し周波数速度 [pps] [pulses]ndash パルス周期 [s] 1PRFndash パルス幅 [s] 立ち上がり時間含むndash デューティ比 [] パルス幅パルス周期ndash バーストあたりのパルス数 [pulsesburst]ndash バースト長 [s]ndash バースト周期 [s]ndash 立ち上がり時間 [s]
パルス周期
パルス幅
バーストあたりのパルス数バースト長 バースト周期
立ち上がり時間
14
Slide 27MG3700A-J-F-11
パルス変調 プログラミング例
bull I = x(t) = Ac = 1bull Q = y(t) = Ac = 1
bull Ac キャリア信号振幅 = 1bull PRF 700 [pps]bull パルス幅 1 [micros]bull Pulses burst 18bull バースト周期 10 [s]
clear all close all clc
PRF = 700 [pps]PulseWidth = 1E-6 [s]PulsesPerBurst = 18 [pulsesburst]BurstPeriod = 10 [s]CSVfile = Pulse700ppsW1us18ppbB10scsvzerofile = Pulse700ppsW1us18ppbB10sZerocsv
Fs = LCM(PRF1PulseWidth) Sampling rate [Hz] LCM Least Common Multiple Number of samplesW = PulseWidthFsPulseGap = (1PRF-PulseWidth)Fs
(次ページにつづく)
CW
Slide 28MG3700A-J-F-11
パルス変調 プログラミング例
(前ページからつづく)
I = [ ones(1W+2) zeros(1PulseGap-2) ]Q = [ ones(1W+2) zeros(1PulseGap-2) ]RFgateFlag = [ zeros(11) ones(1W) zeros(1PulseGap) ]Burst = [ zeros(11) ones(1W) ]for n = 2PulsesPerBurst
I = [ I ones(1W+2) zeros(1PulseGap-2) ]Q = [ Q ones(1W+2) zeros(1PulseGap-2) ]Burst = [ Burst ones(1PulseGap+W) ]if n == PulsesPerBurst
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap-1) ]else
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap) ]end
end
Marker1 = [ Burst zeros(1PulseGap-1) ] BurstMarker2 = RFgateFlag PulseMarker3 = RFgateFlag Pulsedata = [I Q Marker1 Marker2 Marker3 RFgateFlag]csvwrite(CSVfiledata)
BurstGapPulseLength = PRFBurstPeriod-PulsesPerBurstzero = zeros(1FsPRF) samplespulsezerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)zerofileMultiple = PRFBurstPeriod-PulsesPerBurst Pulse length in Burst gap
IQ
RF gate flag
15
Slide 29MG3700A-J-F-11
パルス変調 プログラミング例
繰り返し
シーケンス機能テクニック
Slide 30MG3700A-J-F-11
パルス変調 プログラミング例
繰り返しエレメント1 エレメント2
シーケンスファイルを生成
16
Slide 31MG3700A-J-F-11
パルスチャープ変調 プログラミング例
bull I = x(t) =bull Q = y(t) =
bull Ac キャリア信号振幅 = 1bull PRF 2000 [pps]bull パルス幅 20 [micros]bull Pulses burst 20
clear all close all clc
PW = 20 Pulse Width [us]PRF = 2000 [pps]Fpeak = 25 Peak Frequency Deviation [MHz]CSVfile = RTS6W20us2000ppscsvzerofile =RTS6W20us2000ppsZerocsv
Fs = Fpeak 40 Sampling rate [MHz]DataPoints = PW Fs
(次ページにつづく)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
FM
Slide 32MG3700A-J-F-11
パルスチャープ変調 プログラミング例
(前ページからつづく)
t = 0DataPointsdPhi = 2pi(-Fpeak + 2 Fpeak tDataPoints)Fs Frequency deviation from -Fpeak to
+FpeakPhi = cumsum(dPhi2) Comulative SumI = cos(Phi)Q = sin(Phi)
I = [zeros(11) I zeros(12)]Q = [zeros(11) Q zeros(12)]BurstFlag = ones(1DataPoints+4)RFgateFlag = [ones(1DataPoints+3) zeros(11)]
data=[I Q BurstFlag RFgateFlag RFgateFlag RFgateFlag] Marker1 Burst OnOff Flag Marker2amp3 RF OnOff Flag
csvwrite(CSVfiledata)
zero = zeros(1DataPoints+4)zerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)
PulsePeriod = Fs 1E6 PRF Pulse period samplesFrameLength = DataPoints + 4GapLength = PulsePeriod - DataPoints - 4
IQ
RF gate flag
17
Slide 33MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンス機能テクニック
Slide 34MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンスファイルを生成
18
Slide 35MG3700A-J-F-11
PSK QAM
bull デジタル変調スキームは一定時間ごとにキャリアの振幅周波数および位相を変更しデジタルベースバンド信号を送ります
raquo アナログ変調スキームはキャリアの振幅周波数および位相を連続的に変更します
基本的なデジタル変調スキームraquo 振幅シフトキーイング (ASK)
ndash キャリアの振幅がシンボル系列で線形に変化する
raquo 周波数シフトキーイング (FSK)ndash キャリアの周波数がシンボル系列で線形に変化する
raquo 位相シフトキーイング (PSK)ディファレンシャル位相シフトキーイング (DPSK)
ndash キャリアの位相がシンボル系列で線形に変化する
raquo 直交振幅変調 (QAM)ndash キャリアの振幅と位相がシンボル系列で線形に変化する
1 10
Slide 36MG3700A-J-F-11
PSK QAM
bull 本章ではQPSKπ4DQPSK8PSK16QAMの一般例を示します
I
Q
00
Ac-Ac
-Ac
Ac
QPSK
01
10
11
I
Q
Ac-Ac
-Ac
Ac
π4DQPSK
00
01 1011
IAc-Ac
-Ac
Ac
000
001
010
011
Q
100
101
110
111
IAc-Ac-Ac
Ac
0000
0001
0010
0011
Q
1100
1101
1110
1111
8PSK 16QAM
0101
0100
0111
0110
10101000
10111001
3Ac-3Ac
3Ac
-3Ac
19
Slide 37MG3700A-J-F-11
QPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=QPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) Initial phase
pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
Slide 38MG3700A-J-F-11
QPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 round(min(real(g))) round(max(real(g)))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 round(min(imag(g))) round(max(imag(g)))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
20
Slide 39MG3700A-J-F-11
波形位相連続
bull MG3700Aは有限長の波形を再生し絶え間なくリピートします波形の最後と次のリ
ピートの最初との間の位相不連続は周期的なスペクトルリグロースやひずみに至ります
bull 急な位相変化でのリピートは高周波スペクトルリグロースをもたらします
Pd = 16 symbol points波形 ではシンボルデータ長 複製シンボルデータ
波形長
Slide 40MG3700A-J-F-11
π4DQPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=pi4DQPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = dpskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) using phase
shift pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
21
Slide 41MG3700A-J-F-11
π4DQPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 42MG3700A-J-F-11
8PSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=8PSKcsv
M = 8 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
22
Slide 43MG3700A-J-F-11
8PSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 44MG3700A-J-F-11
16QAM
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=16QAMcsv
M = 16 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
23
Slide 45MG3700A-J-F-11
16QAM
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 46MG3700A-J-F-11
Simulinkbull Simulinkとは
raquo Simulinkregはダイナミックシステムのモデル化シミュレーション解析を行
うためのソフトウェアパッケージです連続時間サンプリングした時間または混在のハイブリッドにおいてモデル化された線形や非線形システムをサポートします
bull シミュレーション用ツールraquo 簡単にゼロからモデルを構築できあるいは既存のモデルを取得し追加で
きますMATLAB内のすべての分析ツールに素早くアクセスし結果を取得
し分析および視覚化できます
bull モデルベースデザイン用ツールraquo モデル化ではSimulinkはドラッグampドロップマウス操作を使用してブロッ
クダイヤグラムのようなモデルを構築するためのGUIを提供します自分の
ブロックをカスタマイズし生成することもできますraquo モデルは階層的でトップダウンとボトムアップの両方のアプローチを用いて
構築できますraquo モデルの定義後シミュレートできますシミュレーション結果は後処理と視
覚化のためにMATLABワークスペースに入れることができますCSV file
Simulinkに関する詳細についてはサイバネットシステム(株)ウェブサイトを参照してくださいhttpdlcybernetcojpmatlabsupportmanualr2006toolboxsimulinkindexshtml
24
Slide 47MG3700A-J-F-11
Simulink デモ
bull Simulinkデモは役に立つモデル化コンセプトを図解しますMATLAB Command Windowからデモにアクセスできます
Slide 48MG3700A-J-F-11
Simulink Blockset デモ
bull Blocksetは特定分野での設計やシミュレーションのために設計された専門Simulinkブロックの集まりです
bull 例えば Communications Blocksetは通信システムやコンポーネントのフィジカルレイヤを設計しシミュレートするために Simulinkのブロックの包括的ライブラリを拡張しますBlocksetは通信システムや半導体コン
ポーネント例えば商業か防衛のワイヤレスか有線システムなどを設計するのに役立ちます
Communications Blockset内のブロックを用い適応変調を含んだIEEE 80211a WLANスタンダードのフィジカルレイヤのモデル
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
3
Slide 5MG3700A-J-F-11
変調の基礎
bull 変調は振幅や位相あるいはその両方の変化を用いて搬送波周波数ƒc上の帯域通過信号にデータを変換します
信号処理 周波数変更データ 被変調信号
変調信号m(t)
ベースバンド信号g(t)
帯域通過信号s(t)ベースバンド回路 RF回路
fm-fm
振幅
fc+fmfc-fm fc0 f
ベースバンド帯域幅
帯域通過帯域幅
Slide 6MG3700A-J-F-11
変調送信機
bull 振幅位相変調テクニック
bull 直交(IQ)変調
テクニック
ベースバンド信号処理 ƒc
m(t)
R(t) v(t)=R(t) cos[ωct+θ(t)]
ベースバンド回路 RF回路
sum
θ(t)φM cos[ωct+θ(t)]
ωc=2πƒc
ベースバンド信号処理
ƒcm(t)
x(t)
v(t)=x(t) cos(ωct) - y(t) sin(ωct)
ベースバンド回路 RF回路
y(t)
-π2 シフト
+
-
cos(ωct)
cos(ωct)
sin(ωct)
等価
)()()( 22 tytxtR +=
x(t)=R(t) cosθ(t)y(t)=R(t) sinθ(t)
I
Q
4
Slide 7MG3700A-J-F-11
ベースバンド波形
Dp 位相偏移 [radV]Acsin[Dpm(t)]Accos[Dpm(t)]Dpm(t)AcPM
m1(t) = plusmn1m2(t) = plusmn1
Dƒ 周波数偏移[radVmiddots]
m(t)=micro sin(2πƒmt)micro 変調度
ƒm 変調周波数
備考
Acm2(t)Acm1(t)QM
AcFM
0Ac[1+m(t)]0Ac[1+m(t)]AM
y(t)x(t)θ(t)R(t)変調方式
直交変調振幅位相変調
int infinminus
t
f dmD σσ )(
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
)()( 22
21 tmtmAc + )(
)(tan1
21
tmtmminus
QM 直交変調 Quadrature Modulation
Slide 8MG3700A-J-F-11
ベースバンド信号
bull どのようなタイプの被変調信号も振幅位相変調あるいは直交変調のどちらかのテクニックを用いて発生されます
bull 適切なソフトウェアアルゴリズムを選択することによってどのような変調方式も実現できます
bull ベクトル信号発生器(VSG)では帯域通過信号s(t)は2チャネルに分解して考えられることが多く1つはI(in-phase 同相)チャネルもう1つはQ (quadrature-phase 直交)チャネルでありそれぞれx(t)とy(t)に対応しま
すbull 帯域通過信号のコンピュータシミュレーションを行う場合帯域通過信号
s(t)の代わりにその等価低域信号であるベースバンド信号を用いることに
よってシミュレーションでのサンプリングレートを小さくすることができます
5
Slide 9MG3700A-J-F-11
bull CW
bull FM
bull AM
bull PSK
基本IQコンスタレーション
I
Q
I
Q
振幅 R(t)
I
Q
I
Q位相シフトπ2 [rad]
Ac
Ac-Ac
-Ac
Ac
角速度[rads]
Ac
Ac
Ac
Ac
Slide 10MG3700A-J-F-11
シグナルパターンファイルを理解する
bull シグナルパターンファイルは3つのデータから成りますraquo IQデータ
raquo マーカデータraquo ファイルヘッダ
ユーザ作成IQデータ
とマーカデータ
wvdバイナリファイル
wviテキストファイル
FTP
CF
FTP接続
HDD
テキストファイルをバイナリファイルへ大 ltltlt ファイルサイズ gtgtgt 小
ファイルヘッダ
IQデータはDAC入力値へ目盛り付けされるダウンロード rarr
larr抽出
6
Slide 11MG3700A-J-F-11
IQデータ
bull データファイル(wvd)はIおよびQデータポイント(IおよびQのデータポイントごとの符号付き14ビット整数)を含みます各IQポイントは1つのベース
バンド波形ポイントに相当しますbull MG3700AはIおよびQデータポイントの2バイト整数値のそれぞれを処
理するために14ビットDACを使用します14ビットDACは0sim16383のレンジを持ちますがMG3700Aは正数と負数にこのレンジを分けます
IQデータレンジ DACレンジ IQ出力電圧ndash 8191 ----------------- 16383 ----------------- Vmax 正数(+) フルスケールndash 0 ----------------- 8191 ----------------- 0 Vndash -8192 ----------------- 0 ----------------- Vmin 負数(-) フルスケール
DACIデータ LPF
DACQデータ LPF Q
I
Slide 12MG3700A-J-F-11
IQデータレンジ
bull MG3700A性能はIQ DAC RMS値1157sim1634内で保証されますraquo クレストファクタ(ピークパワーRMSパワー)を考慮した調整できるDAC RMS
値raquo MG3700Aディスプレイ上で調整できる RMSパワー22 QI +
Q
+8191
+8191
-8191
-8191
+1634
+1157
0
11 dB
3 dB
210 8191log202778 asympdB
22 QI +
2210 16341634log202867 +asympdB
2210 11571157log202864 +asympdB
I+1157 +1634
クレストファクタのためのマージン
7
Slide 13MG3700A-J-F-11
マーカデータ
bull マーカデータはIQデータポイントごとにOn(1)またはOff(0)の4マーカ状態をセットするためにIQデータポイントあたり4ビットを使用します
bull マーカデータは3イベントマーカとRFゲートフラグから成りますbull イベントマーカがアクティブ(On)のときアクティブマーカ番号1sim3に対応
するリアパネルマーカコネクタでトリガ信号を出力しますbull RFゲートフラグはパルス変調のために使用され内部パルス変調器を駆
動します
raquo マーカデータなしでIQデータをインポートすると自動的にイベントマーカはインアクティブ(Off)RFゲートフラグはアクティブ(On)になります
Slide 14MG3700A-J-F-11
内部パルス変調器
バーストパワー
RFゲートフラグが使用されない場合キャリアリークが存在する
規格 le -40 dBc
RFゲートフラグ
1
0
RFゲートフラグが使用されるとRF出力がオフになる
規格 le -60 dBc (OnOff比 gt 60 dB)
IQ = 0でのパワー
IQ変調器
パルス変調器ベースバンド
ジェネレータ
ディレイ調整
RF
RFゲート
I
Q
RFゲートフラグOffでのパワー
8
Slide 15MG3700A-J-F-11
タイミング
bull マーカがIQデータポイントごとにセットされるのでマーカデータはIQデ
ータポイントと同じサンプル数をもちます
bull イベントマーカ出力コネクタとRFコネクタの間の時間差はplusmn1サンプル内に調整されています
IQ変調器
パルス変調器
ベースバンドジェネレータ
ディレイ調整
RF
RFゲート
マーカ 1マーカ 2マーカ 3
IQ1 IQ2 IQ3 hellip
hellip
IQ4
ゲート1(1) ゲート2(0) ゲート3(1) ゲート4(1) hellip
RFI
Q
Slide 16MG3700A-J-F-11
ファイルヘッダ
bull データファイル(wvd)とファイルヘッダ(wvi)は同じファイル名を持ちますMG3700Aは同じパッケージフォルダにファイルを格納します
bull ファイルヘッダはサンプルレートサンプル数IQ DAC RMS値などのARB変調フォーマット用設定を収録してます
raquo MG3700Aは不特定のヘッダ設定を見つけた場合デフォルト設定かシ
グナルパターンが以前再生されたときの前のシグナルパターンからの設定のどちらかを使用します
9
Slide 17MG3700A-J-F-11
データファイルサイズ
bull データファイル(wvd)はベースバンドメモリにロードされます使用メモリサ
イズがデータファイルサイズに等しいことを意味しますbull ベースバンド波形はサンプル点から成ります1サンプルは4バイトをもち
ますraquo IQデータ + マーカデータ = 1 波形サンプル
14ビット I 4ビット 4バイト (32ビット)14ビット Q
チャネルI Q ( マーカ1 マーカ2 マーカ3 RFゲートフラグ)
最大256000000 サンプル512000000 サンプル オプション付
サンプリングレート(サンプル秒) FsHzで表されるサンプリング周波数
サンプリング間隔 Ts=1Fs一様なサンプリングでのサンプル間の時間
Slide 18MG3700A-J-F-11
IQデータファイルを生成するプログラミング例
bull ARB IQデータを生成するために様々なプログラミング環境があります
概して2タイプありますraquo シミュレーションソフトウェア (EDAツール)
ndash MATLAB Microwave Office など
raquo 高度なプログラミング言語ndash CC++ VB LabView など
bull 実例ではMATLABを使用しプログラマブルなM-ファイルを示しますraquo M-ファイル コマンドスクリプト用MATLABプログラム
10
Slide 19MG3700A-J-F-11
アナログ変調
bull アナログ変調スキームは最も基本テクニックでありIQデータを生成する
ことは単純です
基本的なアナログ変調スキームraquo 振幅変調 (AM)raquo 周波数変調 (FM)raquo 位相変調 (PM)
I
Q変調度 []micro = Vp Ac
Ac
I
Q
I
Q 位相シフトπ2 [rad]
Vp
AM FM PM
Vp角速度[rads]
Ac
Ac Ac
Ac
Slide 20MG3700A-J-F-11
AM
c(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
s(t)
-2
-15
-1
-05
0
05
1
15
2
t
Am
plitu
de [V
]
変調度 micro 80 []
包絡線 R(t)
キャリア
被変調信号
m(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号
11
Slide 21MG3700A-J-F-11
AM プログラミング例
bull I = x(t) = Ac[1+m(t)] = 1+micro sin(2πƒmt)bull Q = y(t) = 0
bull Ac キャリア信号振幅 = 1bull micro 変調度 = 変調信号ピークキャリア信号ピーク (振幅)
clear all close all clc
fm = 1 Modulating frequency [kHz]Depth = 08 Modulating depthCSVfile = AM1kHzDepth80csv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = 1+Depthsin(2pifmtDataPoints)Q = zeros(1DataPoints)data = [I Q]csvwrite(CSVfiledata)
Slide 22MG3700A-J-F-11
FMm(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
Df
-60
-40
-20
0
20
40
60
t
Freq
uenc
y de
viat
ion
[kH
z]
s(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号
ピーク周波数偏移 ∆ƒ 50 [kHz]
c(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
被変調信号キャリア
12
Slide 23MG3700A-J-F-11
FM プログラミング例
bull I = x(t) = = cos[β sin(2πƒmt)]bull Q = y(t) = = sin[β sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull β 変調指数 = ∆ƒƒmbull ∆ƒ ピーク周波数偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 50 Peak frequency deviation [kHz]CSVfile = FM1kHzDeviation50kHzcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationfmsin(2pifmtDataPoints))Q = sin(Deviationfmsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
Slide 24MG3700A-J-F-11
PMm(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号Dp
-2
-15
-1
-05
0
05
1
15
2
t
Pha
se d
evia
tion
[π r
ad]
ピーク位相偏移 5 [rad] asymp 16 π [rad]
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
c(t) s(t)被変調信号キャリア
13
Slide 25MG3700A-J-F-11
PM プログラミング例
bull I = x(t) = Ac cos[Dp m(t)] = cos[Dp sin(2πƒmt)]bull Q = y(t) = Ac sin[Dp m(t)] = sin[Dp sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull Dp ピーク位相偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 5 Peak phase deviation [kHz]CSVfile = PM1kHzDeviation5radcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationsin(2pifmtDataPoints))Q = sin(Deviationsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
Slide 26MG3700A-J-F-11
パルス変調
bull パルス変調はFMかPMのいずれかと時間多重化バースト信号との組
み合わせを使用してレーダや衛星の信号に使用されますndash PRFPRR パルス繰り返し周波数速度 [pps] [pulses]ndash パルス周期 [s] 1PRFndash パルス幅 [s] 立ち上がり時間含むndash デューティ比 [] パルス幅パルス周期ndash バーストあたりのパルス数 [pulsesburst]ndash バースト長 [s]ndash バースト周期 [s]ndash 立ち上がり時間 [s]
パルス周期
パルス幅
バーストあたりのパルス数バースト長 バースト周期
立ち上がり時間
14
Slide 27MG3700A-J-F-11
パルス変調 プログラミング例
bull I = x(t) = Ac = 1bull Q = y(t) = Ac = 1
bull Ac キャリア信号振幅 = 1bull PRF 700 [pps]bull パルス幅 1 [micros]bull Pulses burst 18bull バースト周期 10 [s]
clear all close all clc
PRF = 700 [pps]PulseWidth = 1E-6 [s]PulsesPerBurst = 18 [pulsesburst]BurstPeriod = 10 [s]CSVfile = Pulse700ppsW1us18ppbB10scsvzerofile = Pulse700ppsW1us18ppbB10sZerocsv
Fs = LCM(PRF1PulseWidth) Sampling rate [Hz] LCM Least Common Multiple Number of samplesW = PulseWidthFsPulseGap = (1PRF-PulseWidth)Fs
(次ページにつづく)
CW
Slide 28MG3700A-J-F-11
パルス変調 プログラミング例
(前ページからつづく)
I = [ ones(1W+2) zeros(1PulseGap-2) ]Q = [ ones(1W+2) zeros(1PulseGap-2) ]RFgateFlag = [ zeros(11) ones(1W) zeros(1PulseGap) ]Burst = [ zeros(11) ones(1W) ]for n = 2PulsesPerBurst
I = [ I ones(1W+2) zeros(1PulseGap-2) ]Q = [ Q ones(1W+2) zeros(1PulseGap-2) ]Burst = [ Burst ones(1PulseGap+W) ]if n == PulsesPerBurst
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap-1) ]else
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap) ]end
end
Marker1 = [ Burst zeros(1PulseGap-1) ] BurstMarker2 = RFgateFlag PulseMarker3 = RFgateFlag Pulsedata = [I Q Marker1 Marker2 Marker3 RFgateFlag]csvwrite(CSVfiledata)
BurstGapPulseLength = PRFBurstPeriod-PulsesPerBurstzero = zeros(1FsPRF) samplespulsezerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)zerofileMultiple = PRFBurstPeriod-PulsesPerBurst Pulse length in Burst gap
IQ
RF gate flag
15
Slide 29MG3700A-J-F-11
パルス変調 プログラミング例
繰り返し
シーケンス機能テクニック
Slide 30MG3700A-J-F-11
パルス変調 プログラミング例
繰り返しエレメント1 エレメント2
シーケンスファイルを生成
16
Slide 31MG3700A-J-F-11
パルスチャープ変調 プログラミング例
bull I = x(t) =bull Q = y(t) =
bull Ac キャリア信号振幅 = 1bull PRF 2000 [pps]bull パルス幅 20 [micros]bull Pulses burst 20
clear all close all clc
PW = 20 Pulse Width [us]PRF = 2000 [pps]Fpeak = 25 Peak Frequency Deviation [MHz]CSVfile = RTS6W20us2000ppscsvzerofile =RTS6W20us2000ppsZerocsv
Fs = Fpeak 40 Sampling rate [MHz]DataPoints = PW Fs
(次ページにつづく)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
FM
Slide 32MG3700A-J-F-11
パルスチャープ変調 プログラミング例
(前ページからつづく)
t = 0DataPointsdPhi = 2pi(-Fpeak + 2 Fpeak tDataPoints)Fs Frequency deviation from -Fpeak to
+FpeakPhi = cumsum(dPhi2) Comulative SumI = cos(Phi)Q = sin(Phi)
I = [zeros(11) I zeros(12)]Q = [zeros(11) Q zeros(12)]BurstFlag = ones(1DataPoints+4)RFgateFlag = [ones(1DataPoints+3) zeros(11)]
data=[I Q BurstFlag RFgateFlag RFgateFlag RFgateFlag] Marker1 Burst OnOff Flag Marker2amp3 RF OnOff Flag
csvwrite(CSVfiledata)
zero = zeros(1DataPoints+4)zerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)
PulsePeriod = Fs 1E6 PRF Pulse period samplesFrameLength = DataPoints + 4GapLength = PulsePeriod - DataPoints - 4
IQ
RF gate flag
17
Slide 33MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンス機能テクニック
Slide 34MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンスファイルを生成
18
Slide 35MG3700A-J-F-11
PSK QAM
bull デジタル変調スキームは一定時間ごとにキャリアの振幅周波数および位相を変更しデジタルベースバンド信号を送ります
raquo アナログ変調スキームはキャリアの振幅周波数および位相を連続的に変更します
基本的なデジタル変調スキームraquo 振幅シフトキーイング (ASK)
ndash キャリアの振幅がシンボル系列で線形に変化する
raquo 周波数シフトキーイング (FSK)ndash キャリアの周波数がシンボル系列で線形に変化する
raquo 位相シフトキーイング (PSK)ディファレンシャル位相シフトキーイング (DPSK)
ndash キャリアの位相がシンボル系列で線形に変化する
raquo 直交振幅変調 (QAM)ndash キャリアの振幅と位相がシンボル系列で線形に変化する
1 10
Slide 36MG3700A-J-F-11
PSK QAM
bull 本章ではQPSKπ4DQPSK8PSK16QAMの一般例を示します
I
Q
00
Ac-Ac
-Ac
Ac
QPSK
01
10
11
I
Q
Ac-Ac
-Ac
Ac
π4DQPSK
00
01 1011
IAc-Ac
-Ac
Ac
000
001
010
011
Q
100
101
110
111
IAc-Ac-Ac
Ac
0000
0001
0010
0011
Q
1100
1101
1110
1111
8PSK 16QAM
0101
0100
0111
0110
10101000
10111001
3Ac-3Ac
3Ac
-3Ac
19
Slide 37MG3700A-J-F-11
QPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=QPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) Initial phase
pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
Slide 38MG3700A-J-F-11
QPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 round(min(real(g))) round(max(real(g)))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 round(min(imag(g))) round(max(imag(g)))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
20
Slide 39MG3700A-J-F-11
波形位相連続
bull MG3700Aは有限長の波形を再生し絶え間なくリピートします波形の最後と次のリ
ピートの最初との間の位相不連続は周期的なスペクトルリグロースやひずみに至ります
bull 急な位相変化でのリピートは高周波スペクトルリグロースをもたらします
Pd = 16 symbol points波形 ではシンボルデータ長 複製シンボルデータ
波形長
Slide 40MG3700A-J-F-11
π4DQPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=pi4DQPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = dpskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) using phase
shift pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
21
Slide 41MG3700A-J-F-11
π4DQPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 42MG3700A-J-F-11
8PSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=8PSKcsv
M = 8 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
22
Slide 43MG3700A-J-F-11
8PSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 44MG3700A-J-F-11
16QAM
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=16QAMcsv
M = 16 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
23
Slide 45MG3700A-J-F-11
16QAM
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 46MG3700A-J-F-11
Simulinkbull Simulinkとは
raquo Simulinkregはダイナミックシステムのモデル化シミュレーション解析を行
うためのソフトウェアパッケージです連続時間サンプリングした時間または混在のハイブリッドにおいてモデル化された線形や非線形システムをサポートします
bull シミュレーション用ツールraquo 簡単にゼロからモデルを構築できあるいは既存のモデルを取得し追加で
きますMATLAB内のすべての分析ツールに素早くアクセスし結果を取得
し分析および視覚化できます
bull モデルベースデザイン用ツールraquo モデル化ではSimulinkはドラッグampドロップマウス操作を使用してブロッ
クダイヤグラムのようなモデルを構築するためのGUIを提供します自分の
ブロックをカスタマイズし生成することもできますraquo モデルは階層的でトップダウンとボトムアップの両方のアプローチを用いて
構築できますraquo モデルの定義後シミュレートできますシミュレーション結果は後処理と視
覚化のためにMATLABワークスペースに入れることができますCSV file
Simulinkに関する詳細についてはサイバネットシステム(株)ウェブサイトを参照してくださいhttpdlcybernetcojpmatlabsupportmanualr2006toolboxsimulinkindexshtml
24
Slide 47MG3700A-J-F-11
Simulink デモ
bull Simulinkデモは役に立つモデル化コンセプトを図解しますMATLAB Command Windowからデモにアクセスできます
Slide 48MG3700A-J-F-11
Simulink Blockset デモ
bull Blocksetは特定分野での設計やシミュレーションのために設計された専門Simulinkブロックの集まりです
bull 例えば Communications Blocksetは通信システムやコンポーネントのフィジカルレイヤを設計しシミュレートするために Simulinkのブロックの包括的ライブラリを拡張しますBlocksetは通信システムや半導体コン
ポーネント例えば商業か防衛のワイヤレスか有線システムなどを設計するのに役立ちます
Communications Blockset内のブロックを用い適応変調を含んだIEEE 80211a WLANスタンダードのフィジカルレイヤのモデル
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
4
Slide 7MG3700A-J-F-11
ベースバンド波形
Dp 位相偏移 [radV]Acsin[Dpm(t)]Accos[Dpm(t)]Dpm(t)AcPM
m1(t) = plusmn1m2(t) = plusmn1
Dƒ 周波数偏移[radVmiddots]
m(t)=micro sin(2πƒmt)micro 変調度
ƒm 変調周波数
備考
Acm2(t)Acm1(t)QM
AcFM
0Ac[1+m(t)]0Ac[1+m(t)]AM
y(t)x(t)θ(t)R(t)変調方式
直交変調振幅位相変調
int infinminus
t
f dmD σσ )(
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
)()( 22
21 tmtmAc + )(
)(tan1
21
tmtmminus
QM 直交変調 Quadrature Modulation
Slide 8MG3700A-J-F-11
ベースバンド信号
bull どのようなタイプの被変調信号も振幅位相変調あるいは直交変調のどちらかのテクニックを用いて発生されます
bull 適切なソフトウェアアルゴリズムを選択することによってどのような変調方式も実現できます
bull ベクトル信号発生器(VSG)では帯域通過信号s(t)は2チャネルに分解して考えられることが多く1つはI(in-phase 同相)チャネルもう1つはQ (quadrature-phase 直交)チャネルでありそれぞれx(t)とy(t)に対応しま
すbull 帯域通過信号のコンピュータシミュレーションを行う場合帯域通過信号
s(t)の代わりにその等価低域信号であるベースバンド信号を用いることに
よってシミュレーションでのサンプリングレートを小さくすることができます
5
Slide 9MG3700A-J-F-11
bull CW
bull FM
bull AM
bull PSK
基本IQコンスタレーション
I
Q
I
Q
振幅 R(t)
I
Q
I
Q位相シフトπ2 [rad]
Ac
Ac-Ac
-Ac
Ac
角速度[rads]
Ac
Ac
Ac
Ac
Slide 10MG3700A-J-F-11
シグナルパターンファイルを理解する
bull シグナルパターンファイルは3つのデータから成りますraquo IQデータ
raquo マーカデータraquo ファイルヘッダ
ユーザ作成IQデータ
とマーカデータ
wvdバイナリファイル
wviテキストファイル
FTP
CF
FTP接続
HDD
テキストファイルをバイナリファイルへ大 ltltlt ファイルサイズ gtgtgt 小
ファイルヘッダ
IQデータはDAC入力値へ目盛り付けされるダウンロード rarr
larr抽出
6
Slide 11MG3700A-J-F-11
IQデータ
bull データファイル(wvd)はIおよびQデータポイント(IおよびQのデータポイントごとの符号付き14ビット整数)を含みます各IQポイントは1つのベース
バンド波形ポイントに相当しますbull MG3700AはIおよびQデータポイントの2バイト整数値のそれぞれを処
理するために14ビットDACを使用します14ビットDACは0sim16383のレンジを持ちますがMG3700Aは正数と負数にこのレンジを分けます
IQデータレンジ DACレンジ IQ出力電圧ndash 8191 ----------------- 16383 ----------------- Vmax 正数(+) フルスケールndash 0 ----------------- 8191 ----------------- 0 Vndash -8192 ----------------- 0 ----------------- Vmin 負数(-) フルスケール
DACIデータ LPF
DACQデータ LPF Q
I
Slide 12MG3700A-J-F-11
IQデータレンジ
bull MG3700A性能はIQ DAC RMS値1157sim1634内で保証されますraquo クレストファクタ(ピークパワーRMSパワー)を考慮した調整できるDAC RMS
値raquo MG3700Aディスプレイ上で調整できる RMSパワー22 QI +
Q
+8191
+8191
-8191
-8191
+1634
+1157
0
11 dB
3 dB
210 8191log202778 asympdB
22 QI +
2210 16341634log202867 +asympdB
2210 11571157log202864 +asympdB
I+1157 +1634
クレストファクタのためのマージン
7
Slide 13MG3700A-J-F-11
マーカデータ
bull マーカデータはIQデータポイントごとにOn(1)またはOff(0)の4マーカ状態をセットするためにIQデータポイントあたり4ビットを使用します
bull マーカデータは3イベントマーカとRFゲートフラグから成りますbull イベントマーカがアクティブ(On)のときアクティブマーカ番号1sim3に対応
するリアパネルマーカコネクタでトリガ信号を出力しますbull RFゲートフラグはパルス変調のために使用され内部パルス変調器を駆
動します
raquo マーカデータなしでIQデータをインポートすると自動的にイベントマーカはインアクティブ(Off)RFゲートフラグはアクティブ(On)になります
Slide 14MG3700A-J-F-11
内部パルス変調器
バーストパワー
RFゲートフラグが使用されない場合キャリアリークが存在する
規格 le -40 dBc
RFゲートフラグ
1
0
RFゲートフラグが使用されるとRF出力がオフになる
規格 le -60 dBc (OnOff比 gt 60 dB)
IQ = 0でのパワー
IQ変調器
パルス変調器ベースバンド
ジェネレータ
ディレイ調整
RF
RFゲート
I
Q
RFゲートフラグOffでのパワー
8
Slide 15MG3700A-J-F-11
タイミング
bull マーカがIQデータポイントごとにセットされるのでマーカデータはIQデ
ータポイントと同じサンプル数をもちます
bull イベントマーカ出力コネクタとRFコネクタの間の時間差はplusmn1サンプル内に調整されています
IQ変調器
パルス変調器
ベースバンドジェネレータ
ディレイ調整
RF
RFゲート
マーカ 1マーカ 2マーカ 3
IQ1 IQ2 IQ3 hellip
hellip
IQ4
ゲート1(1) ゲート2(0) ゲート3(1) ゲート4(1) hellip
RFI
Q
Slide 16MG3700A-J-F-11
ファイルヘッダ
bull データファイル(wvd)とファイルヘッダ(wvi)は同じファイル名を持ちますMG3700Aは同じパッケージフォルダにファイルを格納します
bull ファイルヘッダはサンプルレートサンプル数IQ DAC RMS値などのARB変調フォーマット用設定を収録してます
raquo MG3700Aは不特定のヘッダ設定を見つけた場合デフォルト設定かシ
グナルパターンが以前再生されたときの前のシグナルパターンからの設定のどちらかを使用します
9
Slide 17MG3700A-J-F-11
データファイルサイズ
bull データファイル(wvd)はベースバンドメモリにロードされます使用メモリサ
イズがデータファイルサイズに等しいことを意味しますbull ベースバンド波形はサンプル点から成ります1サンプルは4バイトをもち
ますraquo IQデータ + マーカデータ = 1 波形サンプル
14ビット I 4ビット 4バイト (32ビット)14ビット Q
チャネルI Q ( マーカ1 マーカ2 マーカ3 RFゲートフラグ)
最大256000000 サンプル512000000 サンプル オプション付
サンプリングレート(サンプル秒) FsHzで表されるサンプリング周波数
サンプリング間隔 Ts=1Fs一様なサンプリングでのサンプル間の時間
Slide 18MG3700A-J-F-11
IQデータファイルを生成するプログラミング例
bull ARB IQデータを生成するために様々なプログラミング環境があります
概して2タイプありますraquo シミュレーションソフトウェア (EDAツール)
ndash MATLAB Microwave Office など
raquo 高度なプログラミング言語ndash CC++ VB LabView など
bull 実例ではMATLABを使用しプログラマブルなM-ファイルを示しますraquo M-ファイル コマンドスクリプト用MATLABプログラム
10
Slide 19MG3700A-J-F-11
アナログ変調
bull アナログ変調スキームは最も基本テクニックでありIQデータを生成する
ことは単純です
基本的なアナログ変調スキームraquo 振幅変調 (AM)raquo 周波数変調 (FM)raquo 位相変調 (PM)
I
Q変調度 []micro = Vp Ac
Ac
I
Q
I
Q 位相シフトπ2 [rad]
Vp
AM FM PM
Vp角速度[rads]
Ac
Ac Ac
Ac
Slide 20MG3700A-J-F-11
AM
c(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
s(t)
-2
-15
-1
-05
0
05
1
15
2
t
Am
plitu
de [V
]
変調度 micro 80 []
包絡線 R(t)
キャリア
被変調信号
m(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号
11
Slide 21MG3700A-J-F-11
AM プログラミング例
bull I = x(t) = Ac[1+m(t)] = 1+micro sin(2πƒmt)bull Q = y(t) = 0
bull Ac キャリア信号振幅 = 1bull micro 変調度 = 変調信号ピークキャリア信号ピーク (振幅)
clear all close all clc
fm = 1 Modulating frequency [kHz]Depth = 08 Modulating depthCSVfile = AM1kHzDepth80csv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = 1+Depthsin(2pifmtDataPoints)Q = zeros(1DataPoints)data = [I Q]csvwrite(CSVfiledata)
Slide 22MG3700A-J-F-11
FMm(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
Df
-60
-40
-20
0
20
40
60
t
Freq
uenc
y de
viat
ion
[kH
z]
s(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号
ピーク周波数偏移 ∆ƒ 50 [kHz]
c(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
被変調信号キャリア
12
Slide 23MG3700A-J-F-11
FM プログラミング例
bull I = x(t) = = cos[β sin(2πƒmt)]bull Q = y(t) = = sin[β sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull β 変調指数 = ∆ƒƒmbull ∆ƒ ピーク周波数偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 50 Peak frequency deviation [kHz]CSVfile = FM1kHzDeviation50kHzcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationfmsin(2pifmtDataPoints))Q = sin(Deviationfmsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
Slide 24MG3700A-J-F-11
PMm(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号Dp
-2
-15
-1
-05
0
05
1
15
2
t
Pha
se d
evia
tion
[π r
ad]
ピーク位相偏移 5 [rad] asymp 16 π [rad]
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
c(t) s(t)被変調信号キャリア
13
Slide 25MG3700A-J-F-11
PM プログラミング例
bull I = x(t) = Ac cos[Dp m(t)] = cos[Dp sin(2πƒmt)]bull Q = y(t) = Ac sin[Dp m(t)] = sin[Dp sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull Dp ピーク位相偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 5 Peak phase deviation [kHz]CSVfile = PM1kHzDeviation5radcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationsin(2pifmtDataPoints))Q = sin(Deviationsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
Slide 26MG3700A-J-F-11
パルス変調
bull パルス変調はFMかPMのいずれかと時間多重化バースト信号との組
み合わせを使用してレーダや衛星の信号に使用されますndash PRFPRR パルス繰り返し周波数速度 [pps] [pulses]ndash パルス周期 [s] 1PRFndash パルス幅 [s] 立ち上がり時間含むndash デューティ比 [] パルス幅パルス周期ndash バーストあたりのパルス数 [pulsesburst]ndash バースト長 [s]ndash バースト周期 [s]ndash 立ち上がり時間 [s]
パルス周期
パルス幅
バーストあたりのパルス数バースト長 バースト周期
立ち上がり時間
14
Slide 27MG3700A-J-F-11
パルス変調 プログラミング例
bull I = x(t) = Ac = 1bull Q = y(t) = Ac = 1
bull Ac キャリア信号振幅 = 1bull PRF 700 [pps]bull パルス幅 1 [micros]bull Pulses burst 18bull バースト周期 10 [s]
clear all close all clc
PRF = 700 [pps]PulseWidth = 1E-6 [s]PulsesPerBurst = 18 [pulsesburst]BurstPeriod = 10 [s]CSVfile = Pulse700ppsW1us18ppbB10scsvzerofile = Pulse700ppsW1us18ppbB10sZerocsv
Fs = LCM(PRF1PulseWidth) Sampling rate [Hz] LCM Least Common Multiple Number of samplesW = PulseWidthFsPulseGap = (1PRF-PulseWidth)Fs
(次ページにつづく)
CW
Slide 28MG3700A-J-F-11
パルス変調 プログラミング例
(前ページからつづく)
I = [ ones(1W+2) zeros(1PulseGap-2) ]Q = [ ones(1W+2) zeros(1PulseGap-2) ]RFgateFlag = [ zeros(11) ones(1W) zeros(1PulseGap) ]Burst = [ zeros(11) ones(1W) ]for n = 2PulsesPerBurst
I = [ I ones(1W+2) zeros(1PulseGap-2) ]Q = [ Q ones(1W+2) zeros(1PulseGap-2) ]Burst = [ Burst ones(1PulseGap+W) ]if n == PulsesPerBurst
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap-1) ]else
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap) ]end
end
Marker1 = [ Burst zeros(1PulseGap-1) ] BurstMarker2 = RFgateFlag PulseMarker3 = RFgateFlag Pulsedata = [I Q Marker1 Marker2 Marker3 RFgateFlag]csvwrite(CSVfiledata)
BurstGapPulseLength = PRFBurstPeriod-PulsesPerBurstzero = zeros(1FsPRF) samplespulsezerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)zerofileMultiple = PRFBurstPeriod-PulsesPerBurst Pulse length in Burst gap
IQ
RF gate flag
15
Slide 29MG3700A-J-F-11
パルス変調 プログラミング例
繰り返し
シーケンス機能テクニック
Slide 30MG3700A-J-F-11
パルス変調 プログラミング例
繰り返しエレメント1 エレメント2
シーケンスファイルを生成
16
Slide 31MG3700A-J-F-11
パルスチャープ変調 プログラミング例
bull I = x(t) =bull Q = y(t) =
bull Ac キャリア信号振幅 = 1bull PRF 2000 [pps]bull パルス幅 20 [micros]bull Pulses burst 20
clear all close all clc
PW = 20 Pulse Width [us]PRF = 2000 [pps]Fpeak = 25 Peak Frequency Deviation [MHz]CSVfile = RTS6W20us2000ppscsvzerofile =RTS6W20us2000ppsZerocsv
Fs = Fpeak 40 Sampling rate [MHz]DataPoints = PW Fs
(次ページにつづく)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
FM
Slide 32MG3700A-J-F-11
パルスチャープ変調 プログラミング例
(前ページからつづく)
t = 0DataPointsdPhi = 2pi(-Fpeak + 2 Fpeak tDataPoints)Fs Frequency deviation from -Fpeak to
+FpeakPhi = cumsum(dPhi2) Comulative SumI = cos(Phi)Q = sin(Phi)
I = [zeros(11) I zeros(12)]Q = [zeros(11) Q zeros(12)]BurstFlag = ones(1DataPoints+4)RFgateFlag = [ones(1DataPoints+3) zeros(11)]
data=[I Q BurstFlag RFgateFlag RFgateFlag RFgateFlag] Marker1 Burst OnOff Flag Marker2amp3 RF OnOff Flag
csvwrite(CSVfiledata)
zero = zeros(1DataPoints+4)zerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)
PulsePeriod = Fs 1E6 PRF Pulse period samplesFrameLength = DataPoints + 4GapLength = PulsePeriod - DataPoints - 4
IQ
RF gate flag
17
Slide 33MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンス機能テクニック
Slide 34MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンスファイルを生成
18
Slide 35MG3700A-J-F-11
PSK QAM
bull デジタル変調スキームは一定時間ごとにキャリアの振幅周波数および位相を変更しデジタルベースバンド信号を送ります
raquo アナログ変調スキームはキャリアの振幅周波数および位相を連続的に変更します
基本的なデジタル変調スキームraquo 振幅シフトキーイング (ASK)
ndash キャリアの振幅がシンボル系列で線形に変化する
raquo 周波数シフトキーイング (FSK)ndash キャリアの周波数がシンボル系列で線形に変化する
raquo 位相シフトキーイング (PSK)ディファレンシャル位相シフトキーイング (DPSK)
ndash キャリアの位相がシンボル系列で線形に変化する
raquo 直交振幅変調 (QAM)ndash キャリアの振幅と位相がシンボル系列で線形に変化する
1 10
Slide 36MG3700A-J-F-11
PSK QAM
bull 本章ではQPSKπ4DQPSK8PSK16QAMの一般例を示します
I
Q
00
Ac-Ac
-Ac
Ac
QPSK
01
10
11
I
Q
Ac-Ac
-Ac
Ac
π4DQPSK
00
01 1011
IAc-Ac
-Ac
Ac
000
001
010
011
Q
100
101
110
111
IAc-Ac-Ac
Ac
0000
0001
0010
0011
Q
1100
1101
1110
1111
8PSK 16QAM
0101
0100
0111
0110
10101000
10111001
3Ac-3Ac
3Ac
-3Ac
19
Slide 37MG3700A-J-F-11
QPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=QPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) Initial phase
pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
Slide 38MG3700A-J-F-11
QPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 round(min(real(g))) round(max(real(g)))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 round(min(imag(g))) round(max(imag(g)))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
20
Slide 39MG3700A-J-F-11
波形位相連続
bull MG3700Aは有限長の波形を再生し絶え間なくリピートします波形の最後と次のリ
ピートの最初との間の位相不連続は周期的なスペクトルリグロースやひずみに至ります
bull 急な位相変化でのリピートは高周波スペクトルリグロースをもたらします
Pd = 16 symbol points波形 ではシンボルデータ長 複製シンボルデータ
波形長
Slide 40MG3700A-J-F-11
π4DQPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=pi4DQPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = dpskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) using phase
shift pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
21
Slide 41MG3700A-J-F-11
π4DQPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 42MG3700A-J-F-11
8PSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=8PSKcsv
M = 8 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
22
Slide 43MG3700A-J-F-11
8PSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 44MG3700A-J-F-11
16QAM
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=16QAMcsv
M = 16 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
23
Slide 45MG3700A-J-F-11
16QAM
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 46MG3700A-J-F-11
Simulinkbull Simulinkとは
raquo Simulinkregはダイナミックシステムのモデル化シミュレーション解析を行
うためのソフトウェアパッケージです連続時間サンプリングした時間または混在のハイブリッドにおいてモデル化された線形や非線形システムをサポートします
bull シミュレーション用ツールraquo 簡単にゼロからモデルを構築できあるいは既存のモデルを取得し追加で
きますMATLAB内のすべての分析ツールに素早くアクセスし結果を取得
し分析および視覚化できます
bull モデルベースデザイン用ツールraquo モデル化ではSimulinkはドラッグampドロップマウス操作を使用してブロッ
クダイヤグラムのようなモデルを構築するためのGUIを提供します自分の
ブロックをカスタマイズし生成することもできますraquo モデルは階層的でトップダウンとボトムアップの両方のアプローチを用いて
構築できますraquo モデルの定義後シミュレートできますシミュレーション結果は後処理と視
覚化のためにMATLABワークスペースに入れることができますCSV file
Simulinkに関する詳細についてはサイバネットシステム(株)ウェブサイトを参照してくださいhttpdlcybernetcojpmatlabsupportmanualr2006toolboxsimulinkindexshtml
24
Slide 47MG3700A-J-F-11
Simulink デモ
bull Simulinkデモは役に立つモデル化コンセプトを図解しますMATLAB Command Windowからデモにアクセスできます
Slide 48MG3700A-J-F-11
Simulink Blockset デモ
bull Blocksetは特定分野での設計やシミュレーションのために設計された専門Simulinkブロックの集まりです
bull 例えば Communications Blocksetは通信システムやコンポーネントのフィジカルレイヤを設計しシミュレートするために Simulinkのブロックの包括的ライブラリを拡張しますBlocksetは通信システムや半導体コン
ポーネント例えば商業か防衛のワイヤレスか有線システムなどを設計するのに役立ちます
Communications Blockset内のブロックを用い適応変調を含んだIEEE 80211a WLANスタンダードのフィジカルレイヤのモデル
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
5
Slide 9MG3700A-J-F-11
bull CW
bull FM
bull AM
bull PSK
基本IQコンスタレーション
I
Q
I
Q
振幅 R(t)
I
Q
I
Q位相シフトπ2 [rad]
Ac
Ac-Ac
-Ac
Ac
角速度[rads]
Ac
Ac
Ac
Ac
Slide 10MG3700A-J-F-11
シグナルパターンファイルを理解する
bull シグナルパターンファイルは3つのデータから成りますraquo IQデータ
raquo マーカデータraquo ファイルヘッダ
ユーザ作成IQデータ
とマーカデータ
wvdバイナリファイル
wviテキストファイル
FTP
CF
FTP接続
HDD
テキストファイルをバイナリファイルへ大 ltltlt ファイルサイズ gtgtgt 小
ファイルヘッダ
IQデータはDAC入力値へ目盛り付けされるダウンロード rarr
larr抽出
6
Slide 11MG3700A-J-F-11
IQデータ
bull データファイル(wvd)はIおよびQデータポイント(IおよびQのデータポイントごとの符号付き14ビット整数)を含みます各IQポイントは1つのベース
バンド波形ポイントに相当しますbull MG3700AはIおよびQデータポイントの2バイト整数値のそれぞれを処
理するために14ビットDACを使用します14ビットDACは0sim16383のレンジを持ちますがMG3700Aは正数と負数にこのレンジを分けます
IQデータレンジ DACレンジ IQ出力電圧ndash 8191 ----------------- 16383 ----------------- Vmax 正数(+) フルスケールndash 0 ----------------- 8191 ----------------- 0 Vndash -8192 ----------------- 0 ----------------- Vmin 負数(-) フルスケール
DACIデータ LPF
DACQデータ LPF Q
I
Slide 12MG3700A-J-F-11
IQデータレンジ
bull MG3700A性能はIQ DAC RMS値1157sim1634内で保証されますraquo クレストファクタ(ピークパワーRMSパワー)を考慮した調整できるDAC RMS
値raquo MG3700Aディスプレイ上で調整できる RMSパワー22 QI +
Q
+8191
+8191
-8191
-8191
+1634
+1157
0
11 dB
3 dB
210 8191log202778 asympdB
22 QI +
2210 16341634log202867 +asympdB
2210 11571157log202864 +asympdB
I+1157 +1634
クレストファクタのためのマージン
7
Slide 13MG3700A-J-F-11
マーカデータ
bull マーカデータはIQデータポイントごとにOn(1)またはOff(0)の4マーカ状態をセットするためにIQデータポイントあたり4ビットを使用します
bull マーカデータは3イベントマーカとRFゲートフラグから成りますbull イベントマーカがアクティブ(On)のときアクティブマーカ番号1sim3に対応
するリアパネルマーカコネクタでトリガ信号を出力しますbull RFゲートフラグはパルス変調のために使用され内部パルス変調器を駆
動します
raquo マーカデータなしでIQデータをインポートすると自動的にイベントマーカはインアクティブ(Off)RFゲートフラグはアクティブ(On)になります
Slide 14MG3700A-J-F-11
内部パルス変調器
バーストパワー
RFゲートフラグが使用されない場合キャリアリークが存在する
規格 le -40 dBc
RFゲートフラグ
1
0
RFゲートフラグが使用されるとRF出力がオフになる
規格 le -60 dBc (OnOff比 gt 60 dB)
IQ = 0でのパワー
IQ変調器
パルス変調器ベースバンド
ジェネレータ
ディレイ調整
RF
RFゲート
I
Q
RFゲートフラグOffでのパワー
8
Slide 15MG3700A-J-F-11
タイミング
bull マーカがIQデータポイントごとにセットされるのでマーカデータはIQデ
ータポイントと同じサンプル数をもちます
bull イベントマーカ出力コネクタとRFコネクタの間の時間差はplusmn1サンプル内に調整されています
IQ変調器
パルス変調器
ベースバンドジェネレータ
ディレイ調整
RF
RFゲート
マーカ 1マーカ 2マーカ 3
IQ1 IQ2 IQ3 hellip
hellip
IQ4
ゲート1(1) ゲート2(0) ゲート3(1) ゲート4(1) hellip
RFI
Q
Slide 16MG3700A-J-F-11
ファイルヘッダ
bull データファイル(wvd)とファイルヘッダ(wvi)は同じファイル名を持ちますMG3700Aは同じパッケージフォルダにファイルを格納します
bull ファイルヘッダはサンプルレートサンプル数IQ DAC RMS値などのARB変調フォーマット用設定を収録してます
raquo MG3700Aは不特定のヘッダ設定を見つけた場合デフォルト設定かシ
グナルパターンが以前再生されたときの前のシグナルパターンからの設定のどちらかを使用します
9
Slide 17MG3700A-J-F-11
データファイルサイズ
bull データファイル(wvd)はベースバンドメモリにロードされます使用メモリサ
イズがデータファイルサイズに等しいことを意味しますbull ベースバンド波形はサンプル点から成ります1サンプルは4バイトをもち
ますraquo IQデータ + マーカデータ = 1 波形サンプル
14ビット I 4ビット 4バイト (32ビット)14ビット Q
チャネルI Q ( マーカ1 マーカ2 マーカ3 RFゲートフラグ)
最大256000000 サンプル512000000 サンプル オプション付
サンプリングレート(サンプル秒) FsHzで表されるサンプリング周波数
サンプリング間隔 Ts=1Fs一様なサンプリングでのサンプル間の時間
Slide 18MG3700A-J-F-11
IQデータファイルを生成するプログラミング例
bull ARB IQデータを生成するために様々なプログラミング環境があります
概して2タイプありますraquo シミュレーションソフトウェア (EDAツール)
ndash MATLAB Microwave Office など
raquo 高度なプログラミング言語ndash CC++ VB LabView など
bull 実例ではMATLABを使用しプログラマブルなM-ファイルを示しますraquo M-ファイル コマンドスクリプト用MATLABプログラム
10
Slide 19MG3700A-J-F-11
アナログ変調
bull アナログ変調スキームは最も基本テクニックでありIQデータを生成する
ことは単純です
基本的なアナログ変調スキームraquo 振幅変調 (AM)raquo 周波数変調 (FM)raquo 位相変調 (PM)
I
Q変調度 []micro = Vp Ac
Ac
I
Q
I
Q 位相シフトπ2 [rad]
Vp
AM FM PM
Vp角速度[rads]
Ac
Ac Ac
Ac
Slide 20MG3700A-J-F-11
AM
c(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
s(t)
-2
-15
-1
-05
0
05
1
15
2
t
Am
plitu
de [V
]
変調度 micro 80 []
包絡線 R(t)
キャリア
被変調信号
m(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号
11
Slide 21MG3700A-J-F-11
AM プログラミング例
bull I = x(t) = Ac[1+m(t)] = 1+micro sin(2πƒmt)bull Q = y(t) = 0
bull Ac キャリア信号振幅 = 1bull micro 変調度 = 変調信号ピークキャリア信号ピーク (振幅)
clear all close all clc
fm = 1 Modulating frequency [kHz]Depth = 08 Modulating depthCSVfile = AM1kHzDepth80csv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = 1+Depthsin(2pifmtDataPoints)Q = zeros(1DataPoints)data = [I Q]csvwrite(CSVfiledata)
Slide 22MG3700A-J-F-11
FMm(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
Df
-60
-40
-20
0
20
40
60
t
Freq
uenc
y de
viat
ion
[kH
z]
s(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号
ピーク周波数偏移 ∆ƒ 50 [kHz]
c(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
被変調信号キャリア
12
Slide 23MG3700A-J-F-11
FM プログラミング例
bull I = x(t) = = cos[β sin(2πƒmt)]bull Q = y(t) = = sin[β sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull β 変調指数 = ∆ƒƒmbull ∆ƒ ピーク周波数偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 50 Peak frequency deviation [kHz]CSVfile = FM1kHzDeviation50kHzcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationfmsin(2pifmtDataPoints))Q = sin(Deviationfmsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
Slide 24MG3700A-J-F-11
PMm(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号Dp
-2
-15
-1
-05
0
05
1
15
2
t
Pha
se d
evia
tion
[π r
ad]
ピーク位相偏移 5 [rad] asymp 16 π [rad]
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
c(t) s(t)被変調信号キャリア
13
Slide 25MG3700A-J-F-11
PM プログラミング例
bull I = x(t) = Ac cos[Dp m(t)] = cos[Dp sin(2πƒmt)]bull Q = y(t) = Ac sin[Dp m(t)] = sin[Dp sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull Dp ピーク位相偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 5 Peak phase deviation [kHz]CSVfile = PM1kHzDeviation5radcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationsin(2pifmtDataPoints))Q = sin(Deviationsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
Slide 26MG3700A-J-F-11
パルス変調
bull パルス変調はFMかPMのいずれかと時間多重化バースト信号との組
み合わせを使用してレーダや衛星の信号に使用されますndash PRFPRR パルス繰り返し周波数速度 [pps] [pulses]ndash パルス周期 [s] 1PRFndash パルス幅 [s] 立ち上がり時間含むndash デューティ比 [] パルス幅パルス周期ndash バーストあたりのパルス数 [pulsesburst]ndash バースト長 [s]ndash バースト周期 [s]ndash 立ち上がり時間 [s]
パルス周期
パルス幅
バーストあたりのパルス数バースト長 バースト周期
立ち上がり時間
14
Slide 27MG3700A-J-F-11
パルス変調 プログラミング例
bull I = x(t) = Ac = 1bull Q = y(t) = Ac = 1
bull Ac キャリア信号振幅 = 1bull PRF 700 [pps]bull パルス幅 1 [micros]bull Pulses burst 18bull バースト周期 10 [s]
clear all close all clc
PRF = 700 [pps]PulseWidth = 1E-6 [s]PulsesPerBurst = 18 [pulsesburst]BurstPeriod = 10 [s]CSVfile = Pulse700ppsW1us18ppbB10scsvzerofile = Pulse700ppsW1us18ppbB10sZerocsv
Fs = LCM(PRF1PulseWidth) Sampling rate [Hz] LCM Least Common Multiple Number of samplesW = PulseWidthFsPulseGap = (1PRF-PulseWidth)Fs
(次ページにつづく)
CW
Slide 28MG3700A-J-F-11
パルス変調 プログラミング例
(前ページからつづく)
I = [ ones(1W+2) zeros(1PulseGap-2) ]Q = [ ones(1W+2) zeros(1PulseGap-2) ]RFgateFlag = [ zeros(11) ones(1W) zeros(1PulseGap) ]Burst = [ zeros(11) ones(1W) ]for n = 2PulsesPerBurst
I = [ I ones(1W+2) zeros(1PulseGap-2) ]Q = [ Q ones(1W+2) zeros(1PulseGap-2) ]Burst = [ Burst ones(1PulseGap+W) ]if n == PulsesPerBurst
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap-1) ]else
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap) ]end
end
Marker1 = [ Burst zeros(1PulseGap-1) ] BurstMarker2 = RFgateFlag PulseMarker3 = RFgateFlag Pulsedata = [I Q Marker1 Marker2 Marker3 RFgateFlag]csvwrite(CSVfiledata)
BurstGapPulseLength = PRFBurstPeriod-PulsesPerBurstzero = zeros(1FsPRF) samplespulsezerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)zerofileMultiple = PRFBurstPeriod-PulsesPerBurst Pulse length in Burst gap
IQ
RF gate flag
15
Slide 29MG3700A-J-F-11
パルス変調 プログラミング例
繰り返し
シーケンス機能テクニック
Slide 30MG3700A-J-F-11
パルス変調 プログラミング例
繰り返しエレメント1 エレメント2
シーケンスファイルを生成
16
Slide 31MG3700A-J-F-11
パルスチャープ変調 プログラミング例
bull I = x(t) =bull Q = y(t) =
bull Ac キャリア信号振幅 = 1bull PRF 2000 [pps]bull パルス幅 20 [micros]bull Pulses burst 20
clear all close all clc
PW = 20 Pulse Width [us]PRF = 2000 [pps]Fpeak = 25 Peak Frequency Deviation [MHz]CSVfile = RTS6W20us2000ppscsvzerofile =RTS6W20us2000ppsZerocsv
Fs = Fpeak 40 Sampling rate [MHz]DataPoints = PW Fs
(次ページにつづく)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
FM
Slide 32MG3700A-J-F-11
パルスチャープ変調 プログラミング例
(前ページからつづく)
t = 0DataPointsdPhi = 2pi(-Fpeak + 2 Fpeak tDataPoints)Fs Frequency deviation from -Fpeak to
+FpeakPhi = cumsum(dPhi2) Comulative SumI = cos(Phi)Q = sin(Phi)
I = [zeros(11) I zeros(12)]Q = [zeros(11) Q zeros(12)]BurstFlag = ones(1DataPoints+4)RFgateFlag = [ones(1DataPoints+3) zeros(11)]
data=[I Q BurstFlag RFgateFlag RFgateFlag RFgateFlag] Marker1 Burst OnOff Flag Marker2amp3 RF OnOff Flag
csvwrite(CSVfiledata)
zero = zeros(1DataPoints+4)zerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)
PulsePeriod = Fs 1E6 PRF Pulse period samplesFrameLength = DataPoints + 4GapLength = PulsePeriod - DataPoints - 4
IQ
RF gate flag
17
Slide 33MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンス機能テクニック
Slide 34MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンスファイルを生成
18
Slide 35MG3700A-J-F-11
PSK QAM
bull デジタル変調スキームは一定時間ごとにキャリアの振幅周波数および位相を変更しデジタルベースバンド信号を送ります
raquo アナログ変調スキームはキャリアの振幅周波数および位相を連続的に変更します
基本的なデジタル変調スキームraquo 振幅シフトキーイング (ASK)
ndash キャリアの振幅がシンボル系列で線形に変化する
raquo 周波数シフトキーイング (FSK)ndash キャリアの周波数がシンボル系列で線形に変化する
raquo 位相シフトキーイング (PSK)ディファレンシャル位相シフトキーイング (DPSK)
ndash キャリアの位相がシンボル系列で線形に変化する
raquo 直交振幅変調 (QAM)ndash キャリアの振幅と位相がシンボル系列で線形に変化する
1 10
Slide 36MG3700A-J-F-11
PSK QAM
bull 本章ではQPSKπ4DQPSK8PSK16QAMの一般例を示します
I
Q
00
Ac-Ac
-Ac
Ac
QPSK
01
10
11
I
Q
Ac-Ac
-Ac
Ac
π4DQPSK
00
01 1011
IAc-Ac
-Ac
Ac
000
001
010
011
Q
100
101
110
111
IAc-Ac-Ac
Ac
0000
0001
0010
0011
Q
1100
1101
1110
1111
8PSK 16QAM
0101
0100
0111
0110
10101000
10111001
3Ac-3Ac
3Ac
-3Ac
19
Slide 37MG3700A-J-F-11
QPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=QPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) Initial phase
pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
Slide 38MG3700A-J-F-11
QPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 round(min(real(g))) round(max(real(g)))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 round(min(imag(g))) round(max(imag(g)))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
20
Slide 39MG3700A-J-F-11
波形位相連続
bull MG3700Aは有限長の波形を再生し絶え間なくリピートします波形の最後と次のリ
ピートの最初との間の位相不連続は周期的なスペクトルリグロースやひずみに至ります
bull 急な位相変化でのリピートは高周波スペクトルリグロースをもたらします
Pd = 16 symbol points波形 ではシンボルデータ長 複製シンボルデータ
波形長
Slide 40MG3700A-J-F-11
π4DQPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=pi4DQPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = dpskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) using phase
shift pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
21
Slide 41MG3700A-J-F-11
π4DQPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 42MG3700A-J-F-11
8PSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=8PSKcsv
M = 8 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
22
Slide 43MG3700A-J-F-11
8PSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 44MG3700A-J-F-11
16QAM
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=16QAMcsv
M = 16 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
23
Slide 45MG3700A-J-F-11
16QAM
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 46MG3700A-J-F-11
Simulinkbull Simulinkとは
raquo Simulinkregはダイナミックシステムのモデル化シミュレーション解析を行
うためのソフトウェアパッケージです連続時間サンプリングした時間または混在のハイブリッドにおいてモデル化された線形や非線形システムをサポートします
bull シミュレーション用ツールraquo 簡単にゼロからモデルを構築できあるいは既存のモデルを取得し追加で
きますMATLAB内のすべての分析ツールに素早くアクセスし結果を取得
し分析および視覚化できます
bull モデルベースデザイン用ツールraquo モデル化ではSimulinkはドラッグampドロップマウス操作を使用してブロッ
クダイヤグラムのようなモデルを構築するためのGUIを提供します自分の
ブロックをカスタマイズし生成することもできますraquo モデルは階層的でトップダウンとボトムアップの両方のアプローチを用いて
構築できますraquo モデルの定義後シミュレートできますシミュレーション結果は後処理と視
覚化のためにMATLABワークスペースに入れることができますCSV file
Simulinkに関する詳細についてはサイバネットシステム(株)ウェブサイトを参照してくださいhttpdlcybernetcojpmatlabsupportmanualr2006toolboxsimulinkindexshtml
24
Slide 47MG3700A-J-F-11
Simulink デモ
bull Simulinkデモは役に立つモデル化コンセプトを図解しますMATLAB Command Windowからデモにアクセスできます
Slide 48MG3700A-J-F-11
Simulink Blockset デモ
bull Blocksetは特定分野での設計やシミュレーションのために設計された専門Simulinkブロックの集まりです
bull 例えば Communications Blocksetは通信システムやコンポーネントのフィジカルレイヤを設計しシミュレートするために Simulinkのブロックの包括的ライブラリを拡張しますBlocksetは通信システムや半導体コン
ポーネント例えば商業か防衛のワイヤレスか有線システムなどを設計するのに役立ちます
Communications Blockset内のブロックを用い適応変調を含んだIEEE 80211a WLANスタンダードのフィジカルレイヤのモデル
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
6
Slide 11MG3700A-J-F-11
IQデータ
bull データファイル(wvd)はIおよびQデータポイント(IおよびQのデータポイントごとの符号付き14ビット整数)を含みます各IQポイントは1つのベース
バンド波形ポイントに相当しますbull MG3700AはIおよびQデータポイントの2バイト整数値のそれぞれを処
理するために14ビットDACを使用します14ビットDACは0sim16383のレンジを持ちますがMG3700Aは正数と負数にこのレンジを分けます
IQデータレンジ DACレンジ IQ出力電圧ndash 8191 ----------------- 16383 ----------------- Vmax 正数(+) フルスケールndash 0 ----------------- 8191 ----------------- 0 Vndash -8192 ----------------- 0 ----------------- Vmin 負数(-) フルスケール
DACIデータ LPF
DACQデータ LPF Q
I
Slide 12MG3700A-J-F-11
IQデータレンジ
bull MG3700A性能はIQ DAC RMS値1157sim1634内で保証されますraquo クレストファクタ(ピークパワーRMSパワー)を考慮した調整できるDAC RMS
値raquo MG3700Aディスプレイ上で調整できる RMSパワー22 QI +
Q
+8191
+8191
-8191
-8191
+1634
+1157
0
11 dB
3 dB
210 8191log202778 asympdB
22 QI +
2210 16341634log202867 +asympdB
2210 11571157log202864 +asympdB
I+1157 +1634
クレストファクタのためのマージン
7
Slide 13MG3700A-J-F-11
マーカデータ
bull マーカデータはIQデータポイントごとにOn(1)またはOff(0)の4マーカ状態をセットするためにIQデータポイントあたり4ビットを使用します
bull マーカデータは3イベントマーカとRFゲートフラグから成りますbull イベントマーカがアクティブ(On)のときアクティブマーカ番号1sim3に対応
するリアパネルマーカコネクタでトリガ信号を出力しますbull RFゲートフラグはパルス変調のために使用され内部パルス変調器を駆
動します
raquo マーカデータなしでIQデータをインポートすると自動的にイベントマーカはインアクティブ(Off)RFゲートフラグはアクティブ(On)になります
Slide 14MG3700A-J-F-11
内部パルス変調器
バーストパワー
RFゲートフラグが使用されない場合キャリアリークが存在する
規格 le -40 dBc
RFゲートフラグ
1
0
RFゲートフラグが使用されるとRF出力がオフになる
規格 le -60 dBc (OnOff比 gt 60 dB)
IQ = 0でのパワー
IQ変調器
パルス変調器ベースバンド
ジェネレータ
ディレイ調整
RF
RFゲート
I
Q
RFゲートフラグOffでのパワー
8
Slide 15MG3700A-J-F-11
タイミング
bull マーカがIQデータポイントごとにセットされるのでマーカデータはIQデ
ータポイントと同じサンプル数をもちます
bull イベントマーカ出力コネクタとRFコネクタの間の時間差はplusmn1サンプル内に調整されています
IQ変調器
パルス変調器
ベースバンドジェネレータ
ディレイ調整
RF
RFゲート
マーカ 1マーカ 2マーカ 3
IQ1 IQ2 IQ3 hellip
hellip
IQ4
ゲート1(1) ゲート2(0) ゲート3(1) ゲート4(1) hellip
RFI
Q
Slide 16MG3700A-J-F-11
ファイルヘッダ
bull データファイル(wvd)とファイルヘッダ(wvi)は同じファイル名を持ちますMG3700Aは同じパッケージフォルダにファイルを格納します
bull ファイルヘッダはサンプルレートサンプル数IQ DAC RMS値などのARB変調フォーマット用設定を収録してます
raquo MG3700Aは不特定のヘッダ設定を見つけた場合デフォルト設定かシ
グナルパターンが以前再生されたときの前のシグナルパターンからの設定のどちらかを使用します
9
Slide 17MG3700A-J-F-11
データファイルサイズ
bull データファイル(wvd)はベースバンドメモリにロードされます使用メモリサ
イズがデータファイルサイズに等しいことを意味しますbull ベースバンド波形はサンプル点から成ります1サンプルは4バイトをもち
ますraquo IQデータ + マーカデータ = 1 波形サンプル
14ビット I 4ビット 4バイト (32ビット)14ビット Q
チャネルI Q ( マーカ1 マーカ2 マーカ3 RFゲートフラグ)
最大256000000 サンプル512000000 サンプル オプション付
サンプリングレート(サンプル秒) FsHzで表されるサンプリング周波数
サンプリング間隔 Ts=1Fs一様なサンプリングでのサンプル間の時間
Slide 18MG3700A-J-F-11
IQデータファイルを生成するプログラミング例
bull ARB IQデータを生成するために様々なプログラミング環境があります
概して2タイプありますraquo シミュレーションソフトウェア (EDAツール)
ndash MATLAB Microwave Office など
raquo 高度なプログラミング言語ndash CC++ VB LabView など
bull 実例ではMATLABを使用しプログラマブルなM-ファイルを示しますraquo M-ファイル コマンドスクリプト用MATLABプログラム
10
Slide 19MG3700A-J-F-11
アナログ変調
bull アナログ変調スキームは最も基本テクニックでありIQデータを生成する
ことは単純です
基本的なアナログ変調スキームraquo 振幅変調 (AM)raquo 周波数変調 (FM)raquo 位相変調 (PM)
I
Q変調度 []micro = Vp Ac
Ac
I
Q
I
Q 位相シフトπ2 [rad]
Vp
AM FM PM
Vp角速度[rads]
Ac
Ac Ac
Ac
Slide 20MG3700A-J-F-11
AM
c(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
s(t)
-2
-15
-1
-05
0
05
1
15
2
t
Am
plitu
de [V
]
変調度 micro 80 []
包絡線 R(t)
キャリア
被変調信号
m(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号
11
Slide 21MG3700A-J-F-11
AM プログラミング例
bull I = x(t) = Ac[1+m(t)] = 1+micro sin(2πƒmt)bull Q = y(t) = 0
bull Ac キャリア信号振幅 = 1bull micro 変調度 = 変調信号ピークキャリア信号ピーク (振幅)
clear all close all clc
fm = 1 Modulating frequency [kHz]Depth = 08 Modulating depthCSVfile = AM1kHzDepth80csv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = 1+Depthsin(2pifmtDataPoints)Q = zeros(1DataPoints)data = [I Q]csvwrite(CSVfiledata)
Slide 22MG3700A-J-F-11
FMm(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
Df
-60
-40
-20
0
20
40
60
t
Freq
uenc
y de
viat
ion
[kH
z]
s(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号
ピーク周波数偏移 ∆ƒ 50 [kHz]
c(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
被変調信号キャリア
12
Slide 23MG3700A-J-F-11
FM プログラミング例
bull I = x(t) = = cos[β sin(2πƒmt)]bull Q = y(t) = = sin[β sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull β 変調指数 = ∆ƒƒmbull ∆ƒ ピーク周波数偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 50 Peak frequency deviation [kHz]CSVfile = FM1kHzDeviation50kHzcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationfmsin(2pifmtDataPoints))Q = sin(Deviationfmsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
Slide 24MG3700A-J-F-11
PMm(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号Dp
-2
-15
-1
-05
0
05
1
15
2
t
Pha
se d
evia
tion
[π r
ad]
ピーク位相偏移 5 [rad] asymp 16 π [rad]
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
c(t) s(t)被変調信号キャリア
13
Slide 25MG3700A-J-F-11
PM プログラミング例
bull I = x(t) = Ac cos[Dp m(t)] = cos[Dp sin(2πƒmt)]bull Q = y(t) = Ac sin[Dp m(t)] = sin[Dp sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull Dp ピーク位相偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 5 Peak phase deviation [kHz]CSVfile = PM1kHzDeviation5radcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationsin(2pifmtDataPoints))Q = sin(Deviationsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
Slide 26MG3700A-J-F-11
パルス変調
bull パルス変調はFMかPMのいずれかと時間多重化バースト信号との組
み合わせを使用してレーダや衛星の信号に使用されますndash PRFPRR パルス繰り返し周波数速度 [pps] [pulses]ndash パルス周期 [s] 1PRFndash パルス幅 [s] 立ち上がり時間含むndash デューティ比 [] パルス幅パルス周期ndash バーストあたりのパルス数 [pulsesburst]ndash バースト長 [s]ndash バースト周期 [s]ndash 立ち上がり時間 [s]
パルス周期
パルス幅
バーストあたりのパルス数バースト長 バースト周期
立ち上がり時間
14
Slide 27MG3700A-J-F-11
パルス変調 プログラミング例
bull I = x(t) = Ac = 1bull Q = y(t) = Ac = 1
bull Ac キャリア信号振幅 = 1bull PRF 700 [pps]bull パルス幅 1 [micros]bull Pulses burst 18bull バースト周期 10 [s]
clear all close all clc
PRF = 700 [pps]PulseWidth = 1E-6 [s]PulsesPerBurst = 18 [pulsesburst]BurstPeriod = 10 [s]CSVfile = Pulse700ppsW1us18ppbB10scsvzerofile = Pulse700ppsW1us18ppbB10sZerocsv
Fs = LCM(PRF1PulseWidth) Sampling rate [Hz] LCM Least Common Multiple Number of samplesW = PulseWidthFsPulseGap = (1PRF-PulseWidth)Fs
(次ページにつづく)
CW
Slide 28MG3700A-J-F-11
パルス変調 プログラミング例
(前ページからつづく)
I = [ ones(1W+2) zeros(1PulseGap-2) ]Q = [ ones(1W+2) zeros(1PulseGap-2) ]RFgateFlag = [ zeros(11) ones(1W) zeros(1PulseGap) ]Burst = [ zeros(11) ones(1W) ]for n = 2PulsesPerBurst
I = [ I ones(1W+2) zeros(1PulseGap-2) ]Q = [ Q ones(1W+2) zeros(1PulseGap-2) ]Burst = [ Burst ones(1PulseGap+W) ]if n == PulsesPerBurst
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap-1) ]else
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap) ]end
end
Marker1 = [ Burst zeros(1PulseGap-1) ] BurstMarker2 = RFgateFlag PulseMarker3 = RFgateFlag Pulsedata = [I Q Marker1 Marker2 Marker3 RFgateFlag]csvwrite(CSVfiledata)
BurstGapPulseLength = PRFBurstPeriod-PulsesPerBurstzero = zeros(1FsPRF) samplespulsezerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)zerofileMultiple = PRFBurstPeriod-PulsesPerBurst Pulse length in Burst gap
IQ
RF gate flag
15
Slide 29MG3700A-J-F-11
パルス変調 プログラミング例
繰り返し
シーケンス機能テクニック
Slide 30MG3700A-J-F-11
パルス変調 プログラミング例
繰り返しエレメント1 エレメント2
シーケンスファイルを生成
16
Slide 31MG3700A-J-F-11
パルスチャープ変調 プログラミング例
bull I = x(t) =bull Q = y(t) =
bull Ac キャリア信号振幅 = 1bull PRF 2000 [pps]bull パルス幅 20 [micros]bull Pulses burst 20
clear all close all clc
PW = 20 Pulse Width [us]PRF = 2000 [pps]Fpeak = 25 Peak Frequency Deviation [MHz]CSVfile = RTS6W20us2000ppscsvzerofile =RTS6W20us2000ppsZerocsv
Fs = Fpeak 40 Sampling rate [MHz]DataPoints = PW Fs
(次ページにつづく)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
FM
Slide 32MG3700A-J-F-11
パルスチャープ変調 プログラミング例
(前ページからつづく)
t = 0DataPointsdPhi = 2pi(-Fpeak + 2 Fpeak tDataPoints)Fs Frequency deviation from -Fpeak to
+FpeakPhi = cumsum(dPhi2) Comulative SumI = cos(Phi)Q = sin(Phi)
I = [zeros(11) I zeros(12)]Q = [zeros(11) Q zeros(12)]BurstFlag = ones(1DataPoints+4)RFgateFlag = [ones(1DataPoints+3) zeros(11)]
data=[I Q BurstFlag RFgateFlag RFgateFlag RFgateFlag] Marker1 Burst OnOff Flag Marker2amp3 RF OnOff Flag
csvwrite(CSVfiledata)
zero = zeros(1DataPoints+4)zerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)
PulsePeriod = Fs 1E6 PRF Pulse period samplesFrameLength = DataPoints + 4GapLength = PulsePeriod - DataPoints - 4
IQ
RF gate flag
17
Slide 33MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンス機能テクニック
Slide 34MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンスファイルを生成
18
Slide 35MG3700A-J-F-11
PSK QAM
bull デジタル変調スキームは一定時間ごとにキャリアの振幅周波数および位相を変更しデジタルベースバンド信号を送ります
raquo アナログ変調スキームはキャリアの振幅周波数および位相を連続的に変更します
基本的なデジタル変調スキームraquo 振幅シフトキーイング (ASK)
ndash キャリアの振幅がシンボル系列で線形に変化する
raquo 周波数シフトキーイング (FSK)ndash キャリアの周波数がシンボル系列で線形に変化する
raquo 位相シフトキーイング (PSK)ディファレンシャル位相シフトキーイング (DPSK)
ndash キャリアの位相がシンボル系列で線形に変化する
raquo 直交振幅変調 (QAM)ndash キャリアの振幅と位相がシンボル系列で線形に変化する
1 10
Slide 36MG3700A-J-F-11
PSK QAM
bull 本章ではQPSKπ4DQPSK8PSK16QAMの一般例を示します
I
Q
00
Ac-Ac
-Ac
Ac
QPSK
01
10
11
I
Q
Ac-Ac
-Ac
Ac
π4DQPSK
00
01 1011
IAc-Ac
-Ac
Ac
000
001
010
011
Q
100
101
110
111
IAc-Ac-Ac
Ac
0000
0001
0010
0011
Q
1100
1101
1110
1111
8PSK 16QAM
0101
0100
0111
0110
10101000
10111001
3Ac-3Ac
3Ac
-3Ac
19
Slide 37MG3700A-J-F-11
QPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=QPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) Initial phase
pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
Slide 38MG3700A-J-F-11
QPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 round(min(real(g))) round(max(real(g)))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 round(min(imag(g))) round(max(imag(g)))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
20
Slide 39MG3700A-J-F-11
波形位相連続
bull MG3700Aは有限長の波形を再生し絶え間なくリピートします波形の最後と次のリ
ピートの最初との間の位相不連続は周期的なスペクトルリグロースやひずみに至ります
bull 急な位相変化でのリピートは高周波スペクトルリグロースをもたらします
Pd = 16 symbol points波形 ではシンボルデータ長 複製シンボルデータ
波形長
Slide 40MG3700A-J-F-11
π4DQPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=pi4DQPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = dpskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) using phase
shift pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
21
Slide 41MG3700A-J-F-11
π4DQPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 42MG3700A-J-F-11
8PSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=8PSKcsv
M = 8 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
22
Slide 43MG3700A-J-F-11
8PSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 44MG3700A-J-F-11
16QAM
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=16QAMcsv
M = 16 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
23
Slide 45MG3700A-J-F-11
16QAM
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 46MG3700A-J-F-11
Simulinkbull Simulinkとは
raquo Simulinkregはダイナミックシステムのモデル化シミュレーション解析を行
うためのソフトウェアパッケージです連続時間サンプリングした時間または混在のハイブリッドにおいてモデル化された線形や非線形システムをサポートします
bull シミュレーション用ツールraquo 簡単にゼロからモデルを構築できあるいは既存のモデルを取得し追加で
きますMATLAB内のすべての分析ツールに素早くアクセスし結果を取得
し分析および視覚化できます
bull モデルベースデザイン用ツールraquo モデル化ではSimulinkはドラッグampドロップマウス操作を使用してブロッ
クダイヤグラムのようなモデルを構築するためのGUIを提供します自分の
ブロックをカスタマイズし生成することもできますraquo モデルは階層的でトップダウンとボトムアップの両方のアプローチを用いて
構築できますraquo モデルの定義後シミュレートできますシミュレーション結果は後処理と視
覚化のためにMATLABワークスペースに入れることができますCSV file
Simulinkに関する詳細についてはサイバネットシステム(株)ウェブサイトを参照してくださいhttpdlcybernetcojpmatlabsupportmanualr2006toolboxsimulinkindexshtml
24
Slide 47MG3700A-J-F-11
Simulink デモ
bull Simulinkデモは役に立つモデル化コンセプトを図解しますMATLAB Command Windowからデモにアクセスできます
Slide 48MG3700A-J-F-11
Simulink Blockset デモ
bull Blocksetは特定分野での設計やシミュレーションのために設計された専門Simulinkブロックの集まりです
bull 例えば Communications Blocksetは通信システムやコンポーネントのフィジカルレイヤを設計しシミュレートするために Simulinkのブロックの包括的ライブラリを拡張しますBlocksetは通信システムや半導体コン
ポーネント例えば商業か防衛のワイヤレスか有線システムなどを設計するのに役立ちます
Communications Blockset内のブロックを用い適応変調を含んだIEEE 80211a WLANスタンダードのフィジカルレイヤのモデル
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
7
Slide 13MG3700A-J-F-11
マーカデータ
bull マーカデータはIQデータポイントごとにOn(1)またはOff(0)の4マーカ状態をセットするためにIQデータポイントあたり4ビットを使用します
bull マーカデータは3イベントマーカとRFゲートフラグから成りますbull イベントマーカがアクティブ(On)のときアクティブマーカ番号1sim3に対応
するリアパネルマーカコネクタでトリガ信号を出力しますbull RFゲートフラグはパルス変調のために使用され内部パルス変調器を駆
動します
raquo マーカデータなしでIQデータをインポートすると自動的にイベントマーカはインアクティブ(Off)RFゲートフラグはアクティブ(On)になります
Slide 14MG3700A-J-F-11
内部パルス変調器
バーストパワー
RFゲートフラグが使用されない場合キャリアリークが存在する
規格 le -40 dBc
RFゲートフラグ
1
0
RFゲートフラグが使用されるとRF出力がオフになる
規格 le -60 dBc (OnOff比 gt 60 dB)
IQ = 0でのパワー
IQ変調器
パルス変調器ベースバンド
ジェネレータ
ディレイ調整
RF
RFゲート
I
Q
RFゲートフラグOffでのパワー
8
Slide 15MG3700A-J-F-11
タイミング
bull マーカがIQデータポイントごとにセットされるのでマーカデータはIQデ
ータポイントと同じサンプル数をもちます
bull イベントマーカ出力コネクタとRFコネクタの間の時間差はplusmn1サンプル内に調整されています
IQ変調器
パルス変調器
ベースバンドジェネレータ
ディレイ調整
RF
RFゲート
マーカ 1マーカ 2マーカ 3
IQ1 IQ2 IQ3 hellip
hellip
IQ4
ゲート1(1) ゲート2(0) ゲート3(1) ゲート4(1) hellip
RFI
Q
Slide 16MG3700A-J-F-11
ファイルヘッダ
bull データファイル(wvd)とファイルヘッダ(wvi)は同じファイル名を持ちますMG3700Aは同じパッケージフォルダにファイルを格納します
bull ファイルヘッダはサンプルレートサンプル数IQ DAC RMS値などのARB変調フォーマット用設定を収録してます
raquo MG3700Aは不特定のヘッダ設定を見つけた場合デフォルト設定かシ
グナルパターンが以前再生されたときの前のシグナルパターンからの設定のどちらかを使用します
9
Slide 17MG3700A-J-F-11
データファイルサイズ
bull データファイル(wvd)はベースバンドメモリにロードされます使用メモリサ
イズがデータファイルサイズに等しいことを意味しますbull ベースバンド波形はサンプル点から成ります1サンプルは4バイトをもち
ますraquo IQデータ + マーカデータ = 1 波形サンプル
14ビット I 4ビット 4バイト (32ビット)14ビット Q
チャネルI Q ( マーカ1 マーカ2 マーカ3 RFゲートフラグ)
最大256000000 サンプル512000000 サンプル オプション付
サンプリングレート(サンプル秒) FsHzで表されるサンプリング周波数
サンプリング間隔 Ts=1Fs一様なサンプリングでのサンプル間の時間
Slide 18MG3700A-J-F-11
IQデータファイルを生成するプログラミング例
bull ARB IQデータを生成するために様々なプログラミング環境があります
概して2タイプありますraquo シミュレーションソフトウェア (EDAツール)
ndash MATLAB Microwave Office など
raquo 高度なプログラミング言語ndash CC++ VB LabView など
bull 実例ではMATLABを使用しプログラマブルなM-ファイルを示しますraquo M-ファイル コマンドスクリプト用MATLABプログラム
10
Slide 19MG3700A-J-F-11
アナログ変調
bull アナログ変調スキームは最も基本テクニックでありIQデータを生成する
ことは単純です
基本的なアナログ変調スキームraquo 振幅変調 (AM)raquo 周波数変調 (FM)raquo 位相変調 (PM)
I
Q変調度 []micro = Vp Ac
Ac
I
Q
I
Q 位相シフトπ2 [rad]
Vp
AM FM PM
Vp角速度[rads]
Ac
Ac Ac
Ac
Slide 20MG3700A-J-F-11
AM
c(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
s(t)
-2
-15
-1
-05
0
05
1
15
2
t
Am
plitu
de [V
]
変調度 micro 80 []
包絡線 R(t)
キャリア
被変調信号
m(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号
11
Slide 21MG3700A-J-F-11
AM プログラミング例
bull I = x(t) = Ac[1+m(t)] = 1+micro sin(2πƒmt)bull Q = y(t) = 0
bull Ac キャリア信号振幅 = 1bull micro 変調度 = 変調信号ピークキャリア信号ピーク (振幅)
clear all close all clc
fm = 1 Modulating frequency [kHz]Depth = 08 Modulating depthCSVfile = AM1kHzDepth80csv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = 1+Depthsin(2pifmtDataPoints)Q = zeros(1DataPoints)data = [I Q]csvwrite(CSVfiledata)
Slide 22MG3700A-J-F-11
FMm(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
Df
-60
-40
-20
0
20
40
60
t
Freq
uenc
y de
viat
ion
[kH
z]
s(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号
ピーク周波数偏移 ∆ƒ 50 [kHz]
c(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
被変調信号キャリア
12
Slide 23MG3700A-J-F-11
FM プログラミング例
bull I = x(t) = = cos[β sin(2πƒmt)]bull Q = y(t) = = sin[β sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull β 変調指数 = ∆ƒƒmbull ∆ƒ ピーク周波数偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 50 Peak frequency deviation [kHz]CSVfile = FM1kHzDeviation50kHzcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationfmsin(2pifmtDataPoints))Q = sin(Deviationfmsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
Slide 24MG3700A-J-F-11
PMm(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号Dp
-2
-15
-1
-05
0
05
1
15
2
t
Pha
se d
evia
tion
[π r
ad]
ピーク位相偏移 5 [rad] asymp 16 π [rad]
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
c(t) s(t)被変調信号キャリア
13
Slide 25MG3700A-J-F-11
PM プログラミング例
bull I = x(t) = Ac cos[Dp m(t)] = cos[Dp sin(2πƒmt)]bull Q = y(t) = Ac sin[Dp m(t)] = sin[Dp sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull Dp ピーク位相偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 5 Peak phase deviation [kHz]CSVfile = PM1kHzDeviation5radcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationsin(2pifmtDataPoints))Q = sin(Deviationsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
Slide 26MG3700A-J-F-11
パルス変調
bull パルス変調はFMかPMのいずれかと時間多重化バースト信号との組
み合わせを使用してレーダや衛星の信号に使用されますndash PRFPRR パルス繰り返し周波数速度 [pps] [pulses]ndash パルス周期 [s] 1PRFndash パルス幅 [s] 立ち上がり時間含むndash デューティ比 [] パルス幅パルス周期ndash バーストあたりのパルス数 [pulsesburst]ndash バースト長 [s]ndash バースト周期 [s]ndash 立ち上がり時間 [s]
パルス周期
パルス幅
バーストあたりのパルス数バースト長 バースト周期
立ち上がり時間
14
Slide 27MG3700A-J-F-11
パルス変調 プログラミング例
bull I = x(t) = Ac = 1bull Q = y(t) = Ac = 1
bull Ac キャリア信号振幅 = 1bull PRF 700 [pps]bull パルス幅 1 [micros]bull Pulses burst 18bull バースト周期 10 [s]
clear all close all clc
PRF = 700 [pps]PulseWidth = 1E-6 [s]PulsesPerBurst = 18 [pulsesburst]BurstPeriod = 10 [s]CSVfile = Pulse700ppsW1us18ppbB10scsvzerofile = Pulse700ppsW1us18ppbB10sZerocsv
Fs = LCM(PRF1PulseWidth) Sampling rate [Hz] LCM Least Common Multiple Number of samplesW = PulseWidthFsPulseGap = (1PRF-PulseWidth)Fs
(次ページにつづく)
CW
Slide 28MG3700A-J-F-11
パルス変調 プログラミング例
(前ページからつづく)
I = [ ones(1W+2) zeros(1PulseGap-2) ]Q = [ ones(1W+2) zeros(1PulseGap-2) ]RFgateFlag = [ zeros(11) ones(1W) zeros(1PulseGap) ]Burst = [ zeros(11) ones(1W) ]for n = 2PulsesPerBurst
I = [ I ones(1W+2) zeros(1PulseGap-2) ]Q = [ Q ones(1W+2) zeros(1PulseGap-2) ]Burst = [ Burst ones(1PulseGap+W) ]if n == PulsesPerBurst
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap-1) ]else
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap) ]end
end
Marker1 = [ Burst zeros(1PulseGap-1) ] BurstMarker2 = RFgateFlag PulseMarker3 = RFgateFlag Pulsedata = [I Q Marker1 Marker2 Marker3 RFgateFlag]csvwrite(CSVfiledata)
BurstGapPulseLength = PRFBurstPeriod-PulsesPerBurstzero = zeros(1FsPRF) samplespulsezerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)zerofileMultiple = PRFBurstPeriod-PulsesPerBurst Pulse length in Burst gap
IQ
RF gate flag
15
Slide 29MG3700A-J-F-11
パルス変調 プログラミング例
繰り返し
シーケンス機能テクニック
Slide 30MG3700A-J-F-11
パルス変調 プログラミング例
繰り返しエレメント1 エレメント2
シーケンスファイルを生成
16
Slide 31MG3700A-J-F-11
パルスチャープ変調 プログラミング例
bull I = x(t) =bull Q = y(t) =
bull Ac キャリア信号振幅 = 1bull PRF 2000 [pps]bull パルス幅 20 [micros]bull Pulses burst 20
clear all close all clc
PW = 20 Pulse Width [us]PRF = 2000 [pps]Fpeak = 25 Peak Frequency Deviation [MHz]CSVfile = RTS6W20us2000ppscsvzerofile =RTS6W20us2000ppsZerocsv
Fs = Fpeak 40 Sampling rate [MHz]DataPoints = PW Fs
(次ページにつづく)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
FM
Slide 32MG3700A-J-F-11
パルスチャープ変調 プログラミング例
(前ページからつづく)
t = 0DataPointsdPhi = 2pi(-Fpeak + 2 Fpeak tDataPoints)Fs Frequency deviation from -Fpeak to
+FpeakPhi = cumsum(dPhi2) Comulative SumI = cos(Phi)Q = sin(Phi)
I = [zeros(11) I zeros(12)]Q = [zeros(11) Q zeros(12)]BurstFlag = ones(1DataPoints+4)RFgateFlag = [ones(1DataPoints+3) zeros(11)]
data=[I Q BurstFlag RFgateFlag RFgateFlag RFgateFlag] Marker1 Burst OnOff Flag Marker2amp3 RF OnOff Flag
csvwrite(CSVfiledata)
zero = zeros(1DataPoints+4)zerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)
PulsePeriod = Fs 1E6 PRF Pulse period samplesFrameLength = DataPoints + 4GapLength = PulsePeriod - DataPoints - 4
IQ
RF gate flag
17
Slide 33MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンス機能テクニック
Slide 34MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンスファイルを生成
18
Slide 35MG3700A-J-F-11
PSK QAM
bull デジタル変調スキームは一定時間ごとにキャリアの振幅周波数および位相を変更しデジタルベースバンド信号を送ります
raquo アナログ変調スキームはキャリアの振幅周波数および位相を連続的に変更します
基本的なデジタル変調スキームraquo 振幅シフトキーイング (ASK)
ndash キャリアの振幅がシンボル系列で線形に変化する
raquo 周波数シフトキーイング (FSK)ndash キャリアの周波数がシンボル系列で線形に変化する
raquo 位相シフトキーイング (PSK)ディファレンシャル位相シフトキーイング (DPSK)
ndash キャリアの位相がシンボル系列で線形に変化する
raquo 直交振幅変調 (QAM)ndash キャリアの振幅と位相がシンボル系列で線形に変化する
1 10
Slide 36MG3700A-J-F-11
PSK QAM
bull 本章ではQPSKπ4DQPSK8PSK16QAMの一般例を示します
I
Q
00
Ac-Ac
-Ac
Ac
QPSK
01
10
11
I
Q
Ac-Ac
-Ac
Ac
π4DQPSK
00
01 1011
IAc-Ac
-Ac
Ac
000
001
010
011
Q
100
101
110
111
IAc-Ac-Ac
Ac
0000
0001
0010
0011
Q
1100
1101
1110
1111
8PSK 16QAM
0101
0100
0111
0110
10101000
10111001
3Ac-3Ac
3Ac
-3Ac
19
Slide 37MG3700A-J-F-11
QPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=QPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) Initial phase
pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
Slide 38MG3700A-J-F-11
QPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 round(min(real(g))) round(max(real(g)))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 round(min(imag(g))) round(max(imag(g)))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
20
Slide 39MG3700A-J-F-11
波形位相連続
bull MG3700Aは有限長の波形を再生し絶え間なくリピートします波形の最後と次のリ
ピートの最初との間の位相不連続は周期的なスペクトルリグロースやひずみに至ります
bull 急な位相変化でのリピートは高周波スペクトルリグロースをもたらします
Pd = 16 symbol points波形 ではシンボルデータ長 複製シンボルデータ
波形長
Slide 40MG3700A-J-F-11
π4DQPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=pi4DQPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = dpskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) using phase
shift pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
21
Slide 41MG3700A-J-F-11
π4DQPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 42MG3700A-J-F-11
8PSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=8PSKcsv
M = 8 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
22
Slide 43MG3700A-J-F-11
8PSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 44MG3700A-J-F-11
16QAM
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=16QAMcsv
M = 16 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
23
Slide 45MG3700A-J-F-11
16QAM
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 46MG3700A-J-F-11
Simulinkbull Simulinkとは
raquo Simulinkregはダイナミックシステムのモデル化シミュレーション解析を行
うためのソフトウェアパッケージです連続時間サンプリングした時間または混在のハイブリッドにおいてモデル化された線形や非線形システムをサポートします
bull シミュレーション用ツールraquo 簡単にゼロからモデルを構築できあるいは既存のモデルを取得し追加で
きますMATLAB内のすべての分析ツールに素早くアクセスし結果を取得
し分析および視覚化できます
bull モデルベースデザイン用ツールraquo モデル化ではSimulinkはドラッグampドロップマウス操作を使用してブロッ
クダイヤグラムのようなモデルを構築するためのGUIを提供します自分の
ブロックをカスタマイズし生成することもできますraquo モデルは階層的でトップダウンとボトムアップの両方のアプローチを用いて
構築できますraquo モデルの定義後シミュレートできますシミュレーション結果は後処理と視
覚化のためにMATLABワークスペースに入れることができますCSV file
Simulinkに関する詳細についてはサイバネットシステム(株)ウェブサイトを参照してくださいhttpdlcybernetcojpmatlabsupportmanualr2006toolboxsimulinkindexshtml
24
Slide 47MG3700A-J-F-11
Simulink デモ
bull Simulinkデモは役に立つモデル化コンセプトを図解しますMATLAB Command Windowからデモにアクセスできます
Slide 48MG3700A-J-F-11
Simulink Blockset デモ
bull Blocksetは特定分野での設計やシミュレーションのために設計された専門Simulinkブロックの集まりです
bull 例えば Communications Blocksetは通信システムやコンポーネントのフィジカルレイヤを設計しシミュレートするために Simulinkのブロックの包括的ライブラリを拡張しますBlocksetは通信システムや半導体コン
ポーネント例えば商業か防衛のワイヤレスか有線システムなどを設計するのに役立ちます
Communications Blockset内のブロックを用い適応変調を含んだIEEE 80211a WLANスタンダードのフィジカルレイヤのモデル
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
8
Slide 15MG3700A-J-F-11
タイミング
bull マーカがIQデータポイントごとにセットされるのでマーカデータはIQデ
ータポイントと同じサンプル数をもちます
bull イベントマーカ出力コネクタとRFコネクタの間の時間差はplusmn1サンプル内に調整されています
IQ変調器
パルス変調器
ベースバンドジェネレータ
ディレイ調整
RF
RFゲート
マーカ 1マーカ 2マーカ 3
IQ1 IQ2 IQ3 hellip
hellip
IQ4
ゲート1(1) ゲート2(0) ゲート3(1) ゲート4(1) hellip
RFI
Q
Slide 16MG3700A-J-F-11
ファイルヘッダ
bull データファイル(wvd)とファイルヘッダ(wvi)は同じファイル名を持ちますMG3700Aは同じパッケージフォルダにファイルを格納します
bull ファイルヘッダはサンプルレートサンプル数IQ DAC RMS値などのARB変調フォーマット用設定を収録してます
raquo MG3700Aは不特定のヘッダ設定を見つけた場合デフォルト設定かシ
グナルパターンが以前再生されたときの前のシグナルパターンからの設定のどちらかを使用します
9
Slide 17MG3700A-J-F-11
データファイルサイズ
bull データファイル(wvd)はベースバンドメモリにロードされます使用メモリサ
イズがデータファイルサイズに等しいことを意味しますbull ベースバンド波形はサンプル点から成ります1サンプルは4バイトをもち
ますraquo IQデータ + マーカデータ = 1 波形サンプル
14ビット I 4ビット 4バイト (32ビット)14ビット Q
チャネルI Q ( マーカ1 マーカ2 マーカ3 RFゲートフラグ)
最大256000000 サンプル512000000 サンプル オプション付
サンプリングレート(サンプル秒) FsHzで表されるサンプリング周波数
サンプリング間隔 Ts=1Fs一様なサンプリングでのサンプル間の時間
Slide 18MG3700A-J-F-11
IQデータファイルを生成するプログラミング例
bull ARB IQデータを生成するために様々なプログラミング環境があります
概して2タイプありますraquo シミュレーションソフトウェア (EDAツール)
ndash MATLAB Microwave Office など
raquo 高度なプログラミング言語ndash CC++ VB LabView など
bull 実例ではMATLABを使用しプログラマブルなM-ファイルを示しますraquo M-ファイル コマンドスクリプト用MATLABプログラム
10
Slide 19MG3700A-J-F-11
アナログ変調
bull アナログ変調スキームは最も基本テクニックでありIQデータを生成する
ことは単純です
基本的なアナログ変調スキームraquo 振幅変調 (AM)raquo 周波数変調 (FM)raquo 位相変調 (PM)
I
Q変調度 []micro = Vp Ac
Ac
I
Q
I
Q 位相シフトπ2 [rad]
Vp
AM FM PM
Vp角速度[rads]
Ac
Ac Ac
Ac
Slide 20MG3700A-J-F-11
AM
c(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
s(t)
-2
-15
-1
-05
0
05
1
15
2
t
Am
plitu
de [V
]
変調度 micro 80 []
包絡線 R(t)
キャリア
被変調信号
m(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号
11
Slide 21MG3700A-J-F-11
AM プログラミング例
bull I = x(t) = Ac[1+m(t)] = 1+micro sin(2πƒmt)bull Q = y(t) = 0
bull Ac キャリア信号振幅 = 1bull micro 変調度 = 変調信号ピークキャリア信号ピーク (振幅)
clear all close all clc
fm = 1 Modulating frequency [kHz]Depth = 08 Modulating depthCSVfile = AM1kHzDepth80csv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = 1+Depthsin(2pifmtDataPoints)Q = zeros(1DataPoints)data = [I Q]csvwrite(CSVfiledata)
Slide 22MG3700A-J-F-11
FMm(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
Df
-60
-40
-20
0
20
40
60
t
Freq
uenc
y de
viat
ion
[kH
z]
s(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号
ピーク周波数偏移 ∆ƒ 50 [kHz]
c(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
被変調信号キャリア
12
Slide 23MG3700A-J-F-11
FM プログラミング例
bull I = x(t) = = cos[β sin(2πƒmt)]bull Q = y(t) = = sin[β sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull β 変調指数 = ∆ƒƒmbull ∆ƒ ピーク周波数偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 50 Peak frequency deviation [kHz]CSVfile = FM1kHzDeviation50kHzcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationfmsin(2pifmtDataPoints))Q = sin(Deviationfmsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
Slide 24MG3700A-J-F-11
PMm(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号Dp
-2
-15
-1
-05
0
05
1
15
2
t
Pha
se d
evia
tion
[π r
ad]
ピーク位相偏移 5 [rad] asymp 16 π [rad]
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
c(t) s(t)被変調信号キャリア
13
Slide 25MG3700A-J-F-11
PM プログラミング例
bull I = x(t) = Ac cos[Dp m(t)] = cos[Dp sin(2πƒmt)]bull Q = y(t) = Ac sin[Dp m(t)] = sin[Dp sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull Dp ピーク位相偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 5 Peak phase deviation [kHz]CSVfile = PM1kHzDeviation5radcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationsin(2pifmtDataPoints))Q = sin(Deviationsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
Slide 26MG3700A-J-F-11
パルス変調
bull パルス変調はFMかPMのいずれかと時間多重化バースト信号との組
み合わせを使用してレーダや衛星の信号に使用されますndash PRFPRR パルス繰り返し周波数速度 [pps] [pulses]ndash パルス周期 [s] 1PRFndash パルス幅 [s] 立ち上がり時間含むndash デューティ比 [] パルス幅パルス周期ndash バーストあたりのパルス数 [pulsesburst]ndash バースト長 [s]ndash バースト周期 [s]ndash 立ち上がり時間 [s]
パルス周期
パルス幅
バーストあたりのパルス数バースト長 バースト周期
立ち上がり時間
14
Slide 27MG3700A-J-F-11
パルス変調 プログラミング例
bull I = x(t) = Ac = 1bull Q = y(t) = Ac = 1
bull Ac キャリア信号振幅 = 1bull PRF 700 [pps]bull パルス幅 1 [micros]bull Pulses burst 18bull バースト周期 10 [s]
clear all close all clc
PRF = 700 [pps]PulseWidth = 1E-6 [s]PulsesPerBurst = 18 [pulsesburst]BurstPeriod = 10 [s]CSVfile = Pulse700ppsW1us18ppbB10scsvzerofile = Pulse700ppsW1us18ppbB10sZerocsv
Fs = LCM(PRF1PulseWidth) Sampling rate [Hz] LCM Least Common Multiple Number of samplesW = PulseWidthFsPulseGap = (1PRF-PulseWidth)Fs
(次ページにつづく)
CW
Slide 28MG3700A-J-F-11
パルス変調 プログラミング例
(前ページからつづく)
I = [ ones(1W+2) zeros(1PulseGap-2) ]Q = [ ones(1W+2) zeros(1PulseGap-2) ]RFgateFlag = [ zeros(11) ones(1W) zeros(1PulseGap) ]Burst = [ zeros(11) ones(1W) ]for n = 2PulsesPerBurst
I = [ I ones(1W+2) zeros(1PulseGap-2) ]Q = [ Q ones(1W+2) zeros(1PulseGap-2) ]Burst = [ Burst ones(1PulseGap+W) ]if n == PulsesPerBurst
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap-1) ]else
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap) ]end
end
Marker1 = [ Burst zeros(1PulseGap-1) ] BurstMarker2 = RFgateFlag PulseMarker3 = RFgateFlag Pulsedata = [I Q Marker1 Marker2 Marker3 RFgateFlag]csvwrite(CSVfiledata)
BurstGapPulseLength = PRFBurstPeriod-PulsesPerBurstzero = zeros(1FsPRF) samplespulsezerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)zerofileMultiple = PRFBurstPeriod-PulsesPerBurst Pulse length in Burst gap
IQ
RF gate flag
15
Slide 29MG3700A-J-F-11
パルス変調 プログラミング例
繰り返し
シーケンス機能テクニック
Slide 30MG3700A-J-F-11
パルス変調 プログラミング例
繰り返しエレメント1 エレメント2
シーケンスファイルを生成
16
Slide 31MG3700A-J-F-11
パルスチャープ変調 プログラミング例
bull I = x(t) =bull Q = y(t) =
bull Ac キャリア信号振幅 = 1bull PRF 2000 [pps]bull パルス幅 20 [micros]bull Pulses burst 20
clear all close all clc
PW = 20 Pulse Width [us]PRF = 2000 [pps]Fpeak = 25 Peak Frequency Deviation [MHz]CSVfile = RTS6W20us2000ppscsvzerofile =RTS6W20us2000ppsZerocsv
Fs = Fpeak 40 Sampling rate [MHz]DataPoints = PW Fs
(次ページにつづく)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
FM
Slide 32MG3700A-J-F-11
パルスチャープ変調 プログラミング例
(前ページからつづく)
t = 0DataPointsdPhi = 2pi(-Fpeak + 2 Fpeak tDataPoints)Fs Frequency deviation from -Fpeak to
+FpeakPhi = cumsum(dPhi2) Comulative SumI = cos(Phi)Q = sin(Phi)
I = [zeros(11) I zeros(12)]Q = [zeros(11) Q zeros(12)]BurstFlag = ones(1DataPoints+4)RFgateFlag = [ones(1DataPoints+3) zeros(11)]
data=[I Q BurstFlag RFgateFlag RFgateFlag RFgateFlag] Marker1 Burst OnOff Flag Marker2amp3 RF OnOff Flag
csvwrite(CSVfiledata)
zero = zeros(1DataPoints+4)zerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)
PulsePeriod = Fs 1E6 PRF Pulse period samplesFrameLength = DataPoints + 4GapLength = PulsePeriod - DataPoints - 4
IQ
RF gate flag
17
Slide 33MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンス機能テクニック
Slide 34MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンスファイルを生成
18
Slide 35MG3700A-J-F-11
PSK QAM
bull デジタル変調スキームは一定時間ごとにキャリアの振幅周波数および位相を変更しデジタルベースバンド信号を送ります
raquo アナログ変調スキームはキャリアの振幅周波数および位相を連続的に変更します
基本的なデジタル変調スキームraquo 振幅シフトキーイング (ASK)
ndash キャリアの振幅がシンボル系列で線形に変化する
raquo 周波数シフトキーイング (FSK)ndash キャリアの周波数がシンボル系列で線形に変化する
raquo 位相シフトキーイング (PSK)ディファレンシャル位相シフトキーイング (DPSK)
ndash キャリアの位相がシンボル系列で線形に変化する
raquo 直交振幅変調 (QAM)ndash キャリアの振幅と位相がシンボル系列で線形に変化する
1 10
Slide 36MG3700A-J-F-11
PSK QAM
bull 本章ではQPSKπ4DQPSK8PSK16QAMの一般例を示します
I
Q
00
Ac-Ac
-Ac
Ac
QPSK
01
10
11
I
Q
Ac-Ac
-Ac
Ac
π4DQPSK
00
01 1011
IAc-Ac
-Ac
Ac
000
001
010
011
Q
100
101
110
111
IAc-Ac-Ac
Ac
0000
0001
0010
0011
Q
1100
1101
1110
1111
8PSK 16QAM
0101
0100
0111
0110
10101000
10111001
3Ac-3Ac
3Ac
-3Ac
19
Slide 37MG3700A-J-F-11
QPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=QPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) Initial phase
pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
Slide 38MG3700A-J-F-11
QPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 round(min(real(g))) round(max(real(g)))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 round(min(imag(g))) round(max(imag(g)))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
20
Slide 39MG3700A-J-F-11
波形位相連続
bull MG3700Aは有限長の波形を再生し絶え間なくリピートします波形の最後と次のリ
ピートの最初との間の位相不連続は周期的なスペクトルリグロースやひずみに至ります
bull 急な位相変化でのリピートは高周波スペクトルリグロースをもたらします
Pd = 16 symbol points波形 ではシンボルデータ長 複製シンボルデータ
波形長
Slide 40MG3700A-J-F-11
π4DQPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=pi4DQPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = dpskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) using phase
shift pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
21
Slide 41MG3700A-J-F-11
π4DQPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 42MG3700A-J-F-11
8PSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=8PSKcsv
M = 8 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
22
Slide 43MG3700A-J-F-11
8PSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 44MG3700A-J-F-11
16QAM
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=16QAMcsv
M = 16 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
23
Slide 45MG3700A-J-F-11
16QAM
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 46MG3700A-J-F-11
Simulinkbull Simulinkとは
raquo Simulinkregはダイナミックシステムのモデル化シミュレーション解析を行
うためのソフトウェアパッケージです連続時間サンプリングした時間または混在のハイブリッドにおいてモデル化された線形や非線形システムをサポートします
bull シミュレーション用ツールraquo 簡単にゼロからモデルを構築できあるいは既存のモデルを取得し追加で
きますMATLAB内のすべての分析ツールに素早くアクセスし結果を取得
し分析および視覚化できます
bull モデルベースデザイン用ツールraquo モデル化ではSimulinkはドラッグampドロップマウス操作を使用してブロッ
クダイヤグラムのようなモデルを構築するためのGUIを提供します自分の
ブロックをカスタマイズし生成することもできますraquo モデルは階層的でトップダウンとボトムアップの両方のアプローチを用いて
構築できますraquo モデルの定義後シミュレートできますシミュレーション結果は後処理と視
覚化のためにMATLABワークスペースに入れることができますCSV file
Simulinkに関する詳細についてはサイバネットシステム(株)ウェブサイトを参照してくださいhttpdlcybernetcojpmatlabsupportmanualr2006toolboxsimulinkindexshtml
24
Slide 47MG3700A-J-F-11
Simulink デモ
bull Simulinkデモは役に立つモデル化コンセプトを図解しますMATLAB Command Windowからデモにアクセスできます
Slide 48MG3700A-J-F-11
Simulink Blockset デモ
bull Blocksetは特定分野での設計やシミュレーションのために設計された専門Simulinkブロックの集まりです
bull 例えば Communications Blocksetは通信システムやコンポーネントのフィジカルレイヤを設計しシミュレートするために Simulinkのブロックの包括的ライブラリを拡張しますBlocksetは通信システムや半導体コン
ポーネント例えば商業か防衛のワイヤレスか有線システムなどを設計するのに役立ちます
Communications Blockset内のブロックを用い適応変調を含んだIEEE 80211a WLANスタンダードのフィジカルレイヤのモデル
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
9
Slide 17MG3700A-J-F-11
データファイルサイズ
bull データファイル(wvd)はベースバンドメモリにロードされます使用メモリサ
イズがデータファイルサイズに等しいことを意味しますbull ベースバンド波形はサンプル点から成ります1サンプルは4バイトをもち
ますraquo IQデータ + マーカデータ = 1 波形サンプル
14ビット I 4ビット 4バイト (32ビット)14ビット Q
チャネルI Q ( マーカ1 マーカ2 マーカ3 RFゲートフラグ)
最大256000000 サンプル512000000 サンプル オプション付
サンプリングレート(サンプル秒) FsHzで表されるサンプリング周波数
サンプリング間隔 Ts=1Fs一様なサンプリングでのサンプル間の時間
Slide 18MG3700A-J-F-11
IQデータファイルを生成するプログラミング例
bull ARB IQデータを生成するために様々なプログラミング環境があります
概して2タイプありますraquo シミュレーションソフトウェア (EDAツール)
ndash MATLAB Microwave Office など
raquo 高度なプログラミング言語ndash CC++ VB LabView など
bull 実例ではMATLABを使用しプログラマブルなM-ファイルを示しますraquo M-ファイル コマンドスクリプト用MATLABプログラム
10
Slide 19MG3700A-J-F-11
アナログ変調
bull アナログ変調スキームは最も基本テクニックでありIQデータを生成する
ことは単純です
基本的なアナログ変調スキームraquo 振幅変調 (AM)raquo 周波数変調 (FM)raquo 位相変調 (PM)
I
Q変調度 []micro = Vp Ac
Ac
I
Q
I
Q 位相シフトπ2 [rad]
Vp
AM FM PM
Vp角速度[rads]
Ac
Ac Ac
Ac
Slide 20MG3700A-J-F-11
AM
c(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
s(t)
-2
-15
-1
-05
0
05
1
15
2
t
Am
plitu
de [V
]
変調度 micro 80 []
包絡線 R(t)
キャリア
被変調信号
m(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号
11
Slide 21MG3700A-J-F-11
AM プログラミング例
bull I = x(t) = Ac[1+m(t)] = 1+micro sin(2πƒmt)bull Q = y(t) = 0
bull Ac キャリア信号振幅 = 1bull micro 変調度 = 変調信号ピークキャリア信号ピーク (振幅)
clear all close all clc
fm = 1 Modulating frequency [kHz]Depth = 08 Modulating depthCSVfile = AM1kHzDepth80csv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = 1+Depthsin(2pifmtDataPoints)Q = zeros(1DataPoints)data = [I Q]csvwrite(CSVfiledata)
Slide 22MG3700A-J-F-11
FMm(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
Df
-60
-40
-20
0
20
40
60
t
Freq
uenc
y de
viat
ion
[kH
z]
s(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号
ピーク周波数偏移 ∆ƒ 50 [kHz]
c(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
被変調信号キャリア
12
Slide 23MG3700A-J-F-11
FM プログラミング例
bull I = x(t) = = cos[β sin(2πƒmt)]bull Q = y(t) = = sin[β sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull β 変調指数 = ∆ƒƒmbull ∆ƒ ピーク周波数偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 50 Peak frequency deviation [kHz]CSVfile = FM1kHzDeviation50kHzcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationfmsin(2pifmtDataPoints))Q = sin(Deviationfmsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
Slide 24MG3700A-J-F-11
PMm(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号Dp
-2
-15
-1
-05
0
05
1
15
2
t
Pha
se d
evia
tion
[π r
ad]
ピーク位相偏移 5 [rad] asymp 16 π [rad]
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
c(t) s(t)被変調信号キャリア
13
Slide 25MG3700A-J-F-11
PM プログラミング例
bull I = x(t) = Ac cos[Dp m(t)] = cos[Dp sin(2πƒmt)]bull Q = y(t) = Ac sin[Dp m(t)] = sin[Dp sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull Dp ピーク位相偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 5 Peak phase deviation [kHz]CSVfile = PM1kHzDeviation5radcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationsin(2pifmtDataPoints))Q = sin(Deviationsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
Slide 26MG3700A-J-F-11
パルス変調
bull パルス変調はFMかPMのいずれかと時間多重化バースト信号との組
み合わせを使用してレーダや衛星の信号に使用されますndash PRFPRR パルス繰り返し周波数速度 [pps] [pulses]ndash パルス周期 [s] 1PRFndash パルス幅 [s] 立ち上がり時間含むndash デューティ比 [] パルス幅パルス周期ndash バーストあたりのパルス数 [pulsesburst]ndash バースト長 [s]ndash バースト周期 [s]ndash 立ち上がり時間 [s]
パルス周期
パルス幅
バーストあたりのパルス数バースト長 バースト周期
立ち上がり時間
14
Slide 27MG3700A-J-F-11
パルス変調 プログラミング例
bull I = x(t) = Ac = 1bull Q = y(t) = Ac = 1
bull Ac キャリア信号振幅 = 1bull PRF 700 [pps]bull パルス幅 1 [micros]bull Pulses burst 18bull バースト周期 10 [s]
clear all close all clc
PRF = 700 [pps]PulseWidth = 1E-6 [s]PulsesPerBurst = 18 [pulsesburst]BurstPeriod = 10 [s]CSVfile = Pulse700ppsW1us18ppbB10scsvzerofile = Pulse700ppsW1us18ppbB10sZerocsv
Fs = LCM(PRF1PulseWidth) Sampling rate [Hz] LCM Least Common Multiple Number of samplesW = PulseWidthFsPulseGap = (1PRF-PulseWidth)Fs
(次ページにつづく)
CW
Slide 28MG3700A-J-F-11
パルス変調 プログラミング例
(前ページからつづく)
I = [ ones(1W+2) zeros(1PulseGap-2) ]Q = [ ones(1W+2) zeros(1PulseGap-2) ]RFgateFlag = [ zeros(11) ones(1W) zeros(1PulseGap) ]Burst = [ zeros(11) ones(1W) ]for n = 2PulsesPerBurst
I = [ I ones(1W+2) zeros(1PulseGap-2) ]Q = [ Q ones(1W+2) zeros(1PulseGap-2) ]Burst = [ Burst ones(1PulseGap+W) ]if n == PulsesPerBurst
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap-1) ]else
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap) ]end
end
Marker1 = [ Burst zeros(1PulseGap-1) ] BurstMarker2 = RFgateFlag PulseMarker3 = RFgateFlag Pulsedata = [I Q Marker1 Marker2 Marker3 RFgateFlag]csvwrite(CSVfiledata)
BurstGapPulseLength = PRFBurstPeriod-PulsesPerBurstzero = zeros(1FsPRF) samplespulsezerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)zerofileMultiple = PRFBurstPeriod-PulsesPerBurst Pulse length in Burst gap
IQ
RF gate flag
15
Slide 29MG3700A-J-F-11
パルス変調 プログラミング例
繰り返し
シーケンス機能テクニック
Slide 30MG3700A-J-F-11
パルス変調 プログラミング例
繰り返しエレメント1 エレメント2
シーケンスファイルを生成
16
Slide 31MG3700A-J-F-11
パルスチャープ変調 プログラミング例
bull I = x(t) =bull Q = y(t) =
bull Ac キャリア信号振幅 = 1bull PRF 2000 [pps]bull パルス幅 20 [micros]bull Pulses burst 20
clear all close all clc
PW = 20 Pulse Width [us]PRF = 2000 [pps]Fpeak = 25 Peak Frequency Deviation [MHz]CSVfile = RTS6W20us2000ppscsvzerofile =RTS6W20us2000ppsZerocsv
Fs = Fpeak 40 Sampling rate [MHz]DataPoints = PW Fs
(次ページにつづく)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
FM
Slide 32MG3700A-J-F-11
パルスチャープ変調 プログラミング例
(前ページからつづく)
t = 0DataPointsdPhi = 2pi(-Fpeak + 2 Fpeak tDataPoints)Fs Frequency deviation from -Fpeak to
+FpeakPhi = cumsum(dPhi2) Comulative SumI = cos(Phi)Q = sin(Phi)
I = [zeros(11) I zeros(12)]Q = [zeros(11) Q zeros(12)]BurstFlag = ones(1DataPoints+4)RFgateFlag = [ones(1DataPoints+3) zeros(11)]
data=[I Q BurstFlag RFgateFlag RFgateFlag RFgateFlag] Marker1 Burst OnOff Flag Marker2amp3 RF OnOff Flag
csvwrite(CSVfiledata)
zero = zeros(1DataPoints+4)zerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)
PulsePeriod = Fs 1E6 PRF Pulse period samplesFrameLength = DataPoints + 4GapLength = PulsePeriod - DataPoints - 4
IQ
RF gate flag
17
Slide 33MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンス機能テクニック
Slide 34MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンスファイルを生成
18
Slide 35MG3700A-J-F-11
PSK QAM
bull デジタル変調スキームは一定時間ごとにキャリアの振幅周波数および位相を変更しデジタルベースバンド信号を送ります
raquo アナログ変調スキームはキャリアの振幅周波数および位相を連続的に変更します
基本的なデジタル変調スキームraquo 振幅シフトキーイング (ASK)
ndash キャリアの振幅がシンボル系列で線形に変化する
raquo 周波数シフトキーイング (FSK)ndash キャリアの周波数がシンボル系列で線形に変化する
raquo 位相シフトキーイング (PSK)ディファレンシャル位相シフトキーイング (DPSK)
ndash キャリアの位相がシンボル系列で線形に変化する
raquo 直交振幅変調 (QAM)ndash キャリアの振幅と位相がシンボル系列で線形に変化する
1 10
Slide 36MG3700A-J-F-11
PSK QAM
bull 本章ではQPSKπ4DQPSK8PSK16QAMの一般例を示します
I
Q
00
Ac-Ac
-Ac
Ac
QPSK
01
10
11
I
Q
Ac-Ac
-Ac
Ac
π4DQPSK
00
01 1011
IAc-Ac
-Ac
Ac
000
001
010
011
Q
100
101
110
111
IAc-Ac-Ac
Ac
0000
0001
0010
0011
Q
1100
1101
1110
1111
8PSK 16QAM
0101
0100
0111
0110
10101000
10111001
3Ac-3Ac
3Ac
-3Ac
19
Slide 37MG3700A-J-F-11
QPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=QPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) Initial phase
pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
Slide 38MG3700A-J-F-11
QPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 round(min(real(g))) round(max(real(g)))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 round(min(imag(g))) round(max(imag(g)))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
20
Slide 39MG3700A-J-F-11
波形位相連続
bull MG3700Aは有限長の波形を再生し絶え間なくリピートします波形の最後と次のリ
ピートの最初との間の位相不連続は周期的なスペクトルリグロースやひずみに至ります
bull 急な位相変化でのリピートは高周波スペクトルリグロースをもたらします
Pd = 16 symbol points波形 ではシンボルデータ長 複製シンボルデータ
波形長
Slide 40MG3700A-J-F-11
π4DQPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=pi4DQPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = dpskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) using phase
shift pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
21
Slide 41MG3700A-J-F-11
π4DQPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 42MG3700A-J-F-11
8PSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=8PSKcsv
M = 8 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
22
Slide 43MG3700A-J-F-11
8PSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 44MG3700A-J-F-11
16QAM
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=16QAMcsv
M = 16 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
23
Slide 45MG3700A-J-F-11
16QAM
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 46MG3700A-J-F-11
Simulinkbull Simulinkとは
raquo Simulinkregはダイナミックシステムのモデル化シミュレーション解析を行
うためのソフトウェアパッケージです連続時間サンプリングした時間または混在のハイブリッドにおいてモデル化された線形や非線形システムをサポートします
bull シミュレーション用ツールraquo 簡単にゼロからモデルを構築できあるいは既存のモデルを取得し追加で
きますMATLAB内のすべての分析ツールに素早くアクセスし結果を取得
し分析および視覚化できます
bull モデルベースデザイン用ツールraquo モデル化ではSimulinkはドラッグampドロップマウス操作を使用してブロッ
クダイヤグラムのようなモデルを構築するためのGUIを提供します自分の
ブロックをカスタマイズし生成することもできますraquo モデルは階層的でトップダウンとボトムアップの両方のアプローチを用いて
構築できますraquo モデルの定義後シミュレートできますシミュレーション結果は後処理と視
覚化のためにMATLABワークスペースに入れることができますCSV file
Simulinkに関する詳細についてはサイバネットシステム(株)ウェブサイトを参照してくださいhttpdlcybernetcojpmatlabsupportmanualr2006toolboxsimulinkindexshtml
24
Slide 47MG3700A-J-F-11
Simulink デモ
bull Simulinkデモは役に立つモデル化コンセプトを図解しますMATLAB Command Windowからデモにアクセスできます
Slide 48MG3700A-J-F-11
Simulink Blockset デモ
bull Blocksetは特定分野での設計やシミュレーションのために設計された専門Simulinkブロックの集まりです
bull 例えば Communications Blocksetは通信システムやコンポーネントのフィジカルレイヤを設計しシミュレートするために Simulinkのブロックの包括的ライブラリを拡張しますBlocksetは通信システムや半導体コン
ポーネント例えば商業か防衛のワイヤレスか有線システムなどを設計するのに役立ちます
Communications Blockset内のブロックを用い適応変調を含んだIEEE 80211a WLANスタンダードのフィジカルレイヤのモデル
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
10
Slide 19MG3700A-J-F-11
アナログ変調
bull アナログ変調スキームは最も基本テクニックでありIQデータを生成する
ことは単純です
基本的なアナログ変調スキームraquo 振幅変調 (AM)raquo 周波数変調 (FM)raquo 位相変調 (PM)
I
Q変調度 []micro = Vp Ac
Ac
I
Q
I
Q 位相シフトπ2 [rad]
Vp
AM FM PM
Vp角速度[rads]
Ac
Ac Ac
Ac
Slide 20MG3700A-J-F-11
AM
c(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
s(t)
-2
-15
-1
-05
0
05
1
15
2
t
Am
plitu
de [V
]
変調度 micro 80 []
包絡線 R(t)
キャリア
被変調信号
m(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号
11
Slide 21MG3700A-J-F-11
AM プログラミング例
bull I = x(t) = Ac[1+m(t)] = 1+micro sin(2πƒmt)bull Q = y(t) = 0
bull Ac キャリア信号振幅 = 1bull micro 変調度 = 変調信号ピークキャリア信号ピーク (振幅)
clear all close all clc
fm = 1 Modulating frequency [kHz]Depth = 08 Modulating depthCSVfile = AM1kHzDepth80csv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = 1+Depthsin(2pifmtDataPoints)Q = zeros(1DataPoints)data = [I Q]csvwrite(CSVfiledata)
Slide 22MG3700A-J-F-11
FMm(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
Df
-60
-40
-20
0
20
40
60
t
Freq
uenc
y de
viat
ion
[kH
z]
s(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号
ピーク周波数偏移 ∆ƒ 50 [kHz]
c(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
被変調信号キャリア
12
Slide 23MG3700A-J-F-11
FM プログラミング例
bull I = x(t) = = cos[β sin(2πƒmt)]bull Q = y(t) = = sin[β sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull β 変調指数 = ∆ƒƒmbull ∆ƒ ピーク周波数偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 50 Peak frequency deviation [kHz]CSVfile = FM1kHzDeviation50kHzcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationfmsin(2pifmtDataPoints))Q = sin(Deviationfmsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
Slide 24MG3700A-J-F-11
PMm(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号Dp
-2
-15
-1
-05
0
05
1
15
2
t
Pha
se d
evia
tion
[π r
ad]
ピーク位相偏移 5 [rad] asymp 16 π [rad]
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
c(t) s(t)被変調信号キャリア
13
Slide 25MG3700A-J-F-11
PM プログラミング例
bull I = x(t) = Ac cos[Dp m(t)] = cos[Dp sin(2πƒmt)]bull Q = y(t) = Ac sin[Dp m(t)] = sin[Dp sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull Dp ピーク位相偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 5 Peak phase deviation [kHz]CSVfile = PM1kHzDeviation5radcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationsin(2pifmtDataPoints))Q = sin(Deviationsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
Slide 26MG3700A-J-F-11
パルス変調
bull パルス変調はFMかPMのいずれかと時間多重化バースト信号との組
み合わせを使用してレーダや衛星の信号に使用されますndash PRFPRR パルス繰り返し周波数速度 [pps] [pulses]ndash パルス周期 [s] 1PRFndash パルス幅 [s] 立ち上がり時間含むndash デューティ比 [] パルス幅パルス周期ndash バーストあたりのパルス数 [pulsesburst]ndash バースト長 [s]ndash バースト周期 [s]ndash 立ち上がり時間 [s]
パルス周期
パルス幅
バーストあたりのパルス数バースト長 バースト周期
立ち上がり時間
14
Slide 27MG3700A-J-F-11
パルス変調 プログラミング例
bull I = x(t) = Ac = 1bull Q = y(t) = Ac = 1
bull Ac キャリア信号振幅 = 1bull PRF 700 [pps]bull パルス幅 1 [micros]bull Pulses burst 18bull バースト周期 10 [s]
clear all close all clc
PRF = 700 [pps]PulseWidth = 1E-6 [s]PulsesPerBurst = 18 [pulsesburst]BurstPeriod = 10 [s]CSVfile = Pulse700ppsW1us18ppbB10scsvzerofile = Pulse700ppsW1us18ppbB10sZerocsv
Fs = LCM(PRF1PulseWidth) Sampling rate [Hz] LCM Least Common Multiple Number of samplesW = PulseWidthFsPulseGap = (1PRF-PulseWidth)Fs
(次ページにつづく)
CW
Slide 28MG3700A-J-F-11
パルス変調 プログラミング例
(前ページからつづく)
I = [ ones(1W+2) zeros(1PulseGap-2) ]Q = [ ones(1W+2) zeros(1PulseGap-2) ]RFgateFlag = [ zeros(11) ones(1W) zeros(1PulseGap) ]Burst = [ zeros(11) ones(1W) ]for n = 2PulsesPerBurst
I = [ I ones(1W+2) zeros(1PulseGap-2) ]Q = [ Q ones(1W+2) zeros(1PulseGap-2) ]Burst = [ Burst ones(1PulseGap+W) ]if n == PulsesPerBurst
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap-1) ]else
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap) ]end
end
Marker1 = [ Burst zeros(1PulseGap-1) ] BurstMarker2 = RFgateFlag PulseMarker3 = RFgateFlag Pulsedata = [I Q Marker1 Marker2 Marker3 RFgateFlag]csvwrite(CSVfiledata)
BurstGapPulseLength = PRFBurstPeriod-PulsesPerBurstzero = zeros(1FsPRF) samplespulsezerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)zerofileMultiple = PRFBurstPeriod-PulsesPerBurst Pulse length in Burst gap
IQ
RF gate flag
15
Slide 29MG3700A-J-F-11
パルス変調 プログラミング例
繰り返し
シーケンス機能テクニック
Slide 30MG3700A-J-F-11
パルス変調 プログラミング例
繰り返しエレメント1 エレメント2
シーケンスファイルを生成
16
Slide 31MG3700A-J-F-11
パルスチャープ変調 プログラミング例
bull I = x(t) =bull Q = y(t) =
bull Ac キャリア信号振幅 = 1bull PRF 2000 [pps]bull パルス幅 20 [micros]bull Pulses burst 20
clear all close all clc
PW = 20 Pulse Width [us]PRF = 2000 [pps]Fpeak = 25 Peak Frequency Deviation [MHz]CSVfile = RTS6W20us2000ppscsvzerofile =RTS6W20us2000ppsZerocsv
Fs = Fpeak 40 Sampling rate [MHz]DataPoints = PW Fs
(次ページにつづく)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
FM
Slide 32MG3700A-J-F-11
パルスチャープ変調 プログラミング例
(前ページからつづく)
t = 0DataPointsdPhi = 2pi(-Fpeak + 2 Fpeak tDataPoints)Fs Frequency deviation from -Fpeak to
+FpeakPhi = cumsum(dPhi2) Comulative SumI = cos(Phi)Q = sin(Phi)
I = [zeros(11) I zeros(12)]Q = [zeros(11) Q zeros(12)]BurstFlag = ones(1DataPoints+4)RFgateFlag = [ones(1DataPoints+3) zeros(11)]
data=[I Q BurstFlag RFgateFlag RFgateFlag RFgateFlag] Marker1 Burst OnOff Flag Marker2amp3 RF OnOff Flag
csvwrite(CSVfiledata)
zero = zeros(1DataPoints+4)zerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)
PulsePeriod = Fs 1E6 PRF Pulse period samplesFrameLength = DataPoints + 4GapLength = PulsePeriod - DataPoints - 4
IQ
RF gate flag
17
Slide 33MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンス機能テクニック
Slide 34MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンスファイルを生成
18
Slide 35MG3700A-J-F-11
PSK QAM
bull デジタル変調スキームは一定時間ごとにキャリアの振幅周波数および位相を変更しデジタルベースバンド信号を送ります
raquo アナログ変調スキームはキャリアの振幅周波数および位相を連続的に変更します
基本的なデジタル変調スキームraquo 振幅シフトキーイング (ASK)
ndash キャリアの振幅がシンボル系列で線形に変化する
raquo 周波数シフトキーイング (FSK)ndash キャリアの周波数がシンボル系列で線形に変化する
raquo 位相シフトキーイング (PSK)ディファレンシャル位相シフトキーイング (DPSK)
ndash キャリアの位相がシンボル系列で線形に変化する
raquo 直交振幅変調 (QAM)ndash キャリアの振幅と位相がシンボル系列で線形に変化する
1 10
Slide 36MG3700A-J-F-11
PSK QAM
bull 本章ではQPSKπ4DQPSK8PSK16QAMの一般例を示します
I
Q
00
Ac-Ac
-Ac
Ac
QPSK
01
10
11
I
Q
Ac-Ac
-Ac
Ac
π4DQPSK
00
01 1011
IAc-Ac
-Ac
Ac
000
001
010
011
Q
100
101
110
111
IAc-Ac-Ac
Ac
0000
0001
0010
0011
Q
1100
1101
1110
1111
8PSK 16QAM
0101
0100
0111
0110
10101000
10111001
3Ac-3Ac
3Ac
-3Ac
19
Slide 37MG3700A-J-F-11
QPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=QPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) Initial phase
pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
Slide 38MG3700A-J-F-11
QPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 round(min(real(g))) round(max(real(g)))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 round(min(imag(g))) round(max(imag(g)))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
20
Slide 39MG3700A-J-F-11
波形位相連続
bull MG3700Aは有限長の波形を再生し絶え間なくリピートします波形の最後と次のリ
ピートの最初との間の位相不連続は周期的なスペクトルリグロースやひずみに至ります
bull 急な位相変化でのリピートは高周波スペクトルリグロースをもたらします
Pd = 16 symbol points波形 ではシンボルデータ長 複製シンボルデータ
波形長
Slide 40MG3700A-J-F-11
π4DQPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=pi4DQPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = dpskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) using phase
shift pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
21
Slide 41MG3700A-J-F-11
π4DQPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 42MG3700A-J-F-11
8PSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=8PSKcsv
M = 8 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
22
Slide 43MG3700A-J-F-11
8PSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 44MG3700A-J-F-11
16QAM
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=16QAMcsv
M = 16 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
23
Slide 45MG3700A-J-F-11
16QAM
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 46MG3700A-J-F-11
Simulinkbull Simulinkとは
raquo Simulinkregはダイナミックシステムのモデル化シミュレーション解析を行
うためのソフトウェアパッケージです連続時間サンプリングした時間または混在のハイブリッドにおいてモデル化された線形や非線形システムをサポートします
bull シミュレーション用ツールraquo 簡単にゼロからモデルを構築できあるいは既存のモデルを取得し追加で
きますMATLAB内のすべての分析ツールに素早くアクセスし結果を取得
し分析および視覚化できます
bull モデルベースデザイン用ツールraquo モデル化ではSimulinkはドラッグampドロップマウス操作を使用してブロッ
クダイヤグラムのようなモデルを構築するためのGUIを提供します自分の
ブロックをカスタマイズし生成することもできますraquo モデルは階層的でトップダウンとボトムアップの両方のアプローチを用いて
構築できますraquo モデルの定義後シミュレートできますシミュレーション結果は後処理と視
覚化のためにMATLABワークスペースに入れることができますCSV file
Simulinkに関する詳細についてはサイバネットシステム(株)ウェブサイトを参照してくださいhttpdlcybernetcojpmatlabsupportmanualr2006toolboxsimulinkindexshtml
24
Slide 47MG3700A-J-F-11
Simulink デモ
bull Simulinkデモは役に立つモデル化コンセプトを図解しますMATLAB Command Windowからデモにアクセスできます
Slide 48MG3700A-J-F-11
Simulink Blockset デモ
bull Blocksetは特定分野での設計やシミュレーションのために設計された専門Simulinkブロックの集まりです
bull 例えば Communications Blocksetは通信システムやコンポーネントのフィジカルレイヤを設計しシミュレートするために Simulinkのブロックの包括的ライブラリを拡張しますBlocksetは通信システムや半導体コン
ポーネント例えば商業か防衛のワイヤレスか有線システムなどを設計するのに役立ちます
Communications Blockset内のブロックを用い適応変調を含んだIEEE 80211a WLANスタンダードのフィジカルレイヤのモデル
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
11
Slide 21MG3700A-J-F-11
AM プログラミング例
bull I = x(t) = Ac[1+m(t)] = 1+micro sin(2πƒmt)bull Q = y(t) = 0
bull Ac キャリア信号振幅 = 1bull micro 変調度 = 変調信号ピークキャリア信号ピーク (振幅)
clear all close all clc
fm = 1 Modulating frequency [kHz]Depth = 08 Modulating depthCSVfile = AM1kHzDepth80csv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = 1+Depthsin(2pifmtDataPoints)Q = zeros(1DataPoints)data = [I Q]csvwrite(CSVfiledata)
Slide 22MG3700A-J-F-11
FMm(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
Df
-60
-40
-20
0
20
40
60
t
Freq
uenc
y de
viat
ion
[kH
z]
s(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号
ピーク周波数偏移 ∆ƒ 50 [kHz]
c(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
被変調信号キャリア
12
Slide 23MG3700A-J-F-11
FM プログラミング例
bull I = x(t) = = cos[β sin(2πƒmt)]bull Q = y(t) = = sin[β sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull β 変調指数 = ∆ƒƒmbull ∆ƒ ピーク周波数偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 50 Peak frequency deviation [kHz]CSVfile = FM1kHzDeviation50kHzcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationfmsin(2pifmtDataPoints))Q = sin(Deviationfmsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
Slide 24MG3700A-J-F-11
PMm(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号Dp
-2
-15
-1
-05
0
05
1
15
2
t
Pha
se d
evia
tion
[π r
ad]
ピーク位相偏移 5 [rad] asymp 16 π [rad]
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
c(t) s(t)被変調信号キャリア
13
Slide 25MG3700A-J-F-11
PM プログラミング例
bull I = x(t) = Ac cos[Dp m(t)] = cos[Dp sin(2πƒmt)]bull Q = y(t) = Ac sin[Dp m(t)] = sin[Dp sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull Dp ピーク位相偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 5 Peak phase deviation [kHz]CSVfile = PM1kHzDeviation5radcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationsin(2pifmtDataPoints))Q = sin(Deviationsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
Slide 26MG3700A-J-F-11
パルス変調
bull パルス変調はFMかPMのいずれかと時間多重化バースト信号との組
み合わせを使用してレーダや衛星の信号に使用されますndash PRFPRR パルス繰り返し周波数速度 [pps] [pulses]ndash パルス周期 [s] 1PRFndash パルス幅 [s] 立ち上がり時間含むndash デューティ比 [] パルス幅パルス周期ndash バーストあたりのパルス数 [pulsesburst]ndash バースト長 [s]ndash バースト周期 [s]ndash 立ち上がり時間 [s]
パルス周期
パルス幅
バーストあたりのパルス数バースト長 バースト周期
立ち上がり時間
14
Slide 27MG3700A-J-F-11
パルス変調 プログラミング例
bull I = x(t) = Ac = 1bull Q = y(t) = Ac = 1
bull Ac キャリア信号振幅 = 1bull PRF 700 [pps]bull パルス幅 1 [micros]bull Pulses burst 18bull バースト周期 10 [s]
clear all close all clc
PRF = 700 [pps]PulseWidth = 1E-6 [s]PulsesPerBurst = 18 [pulsesburst]BurstPeriod = 10 [s]CSVfile = Pulse700ppsW1us18ppbB10scsvzerofile = Pulse700ppsW1us18ppbB10sZerocsv
Fs = LCM(PRF1PulseWidth) Sampling rate [Hz] LCM Least Common Multiple Number of samplesW = PulseWidthFsPulseGap = (1PRF-PulseWidth)Fs
(次ページにつづく)
CW
Slide 28MG3700A-J-F-11
パルス変調 プログラミング例
(前ページからつづく)
I = [ ones(1W+2) zeros(1PulseGap-2) ]Q = [ ones(1W+2) zeros(1PulseGap-2) ]RFgateFlag = [ zeros(11) ones(1W) zeros(1PulseGap) ]Burst = [ zeros(11) ones(1W) ]for n = 2PulsesPerBurst
I = [ I ones(1W+2) zeros(1PulseGap-2) ]Q = [ Q ones(1W+2) zeros(1PulseGap-2) ]Burst = [ Burst ones(1PulseGap+W) ]if n == PulsesPerBurst
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap-1) ]else
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap) ]end
end
Marker1 = [ Burst zeros(1PulseGap-1) ] BurstMarker2 = RFgateFlag PulseMarker3 = RFgateFlag Pulsedata = [I Q Marker1 Marker2 Marker3 RFgateFlag]csvwrite(CSVfiledata)
BurstGapPulseLength = PRFBurstPeriod-PulsesPerBurstzero = zeros(1FsPRF) samplespulsezerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)zerofileMultiple = PRFBurstPeriod-PulsesPerBurst Pulse length in Burst gap
IQ
RF gate flag
15
Slide 29MG3700A-J-F-11
パルス変調 プログラミング例
繰り返し
シーケンス機能テクニック
Slide 30MG3700A-J-F-11
パルス変調 プログラミング例
繰り返しエレメント1 エレメント2
シーケンスファイルを生成
16
Slide 31MG3700A-J-F-11
パルスチャープ変調 プログラミング例
bull I = x(t) =bull Q = y(t) =
bull Ac キャリア信号振幅 = 1bull PRF 2000 [pps]bull パルス幅 20 [micros]bull Pulses burst 20
clear all close all clc
PW = 20 Pulse Width [us]PRF = 2000 [pps]Fpeak = 25 Peak Frequency Deviation [MHz]CSVfile = RTS6W20us2000ppscsvzerofile =RTS6W20us2000ppsZerocsv
Fs = Fpeak 40 Sampling rate [MHz]DataPoints = PW Fs
(次ページにつづく)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
FM
Slide 32MG3700A-J-F-11
パルスチャープ変調 プログラミング例
(前ページからつづく)
t = 0DataPointsdPhi = 2pi(-Fpeak + 2 Fpeak tDataPoints)Fs Frequency deviation from -Fpeak to
+FpeakPhi = cumsum(dPhi2) Comulative SumI = cos(Phi)Q = sin(Phi)
I = [zeros(11) I zeros(12)]Q = [zeros(11) Q zeros(12)]BurstFlag = ones(1DataPoints+4)RFgateFlag = [ones(1DataPoints+3) zeros(11)]
data=[I Q BurstFlag RFgateFlag RFgateFlag RFgateFlag] Marker1 Burst OnOff Flag Marker2amp3 RF OnOff Flag
csvwrite(CSVfiledata)
zero = zeros(1DataPoints+4)zerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)
PulsePeriod = Fs 1E6 PRF Pulse period samplesFrameLength = DataPoints + 4GapLength = PulsePeriod - DataPoints - 4
IQ
RF gate flag
17
Slide 33MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンス機能テクニック
Slide 34MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンスファイルを生成
18
Slide 35MG3700A-J-F-11
PSK QAM
bull デジタル変調スキームは一定時間ごとにキャリアの振幅周波数および位相を変更しデジタルベースバンド信号を送ります
raquo アナログ変調スキームはキャリアの振幅周波数および位相を連続的に変更します
基本的なデジタル変調スキームraquo 振幅シフトキーイング (ASK)
ndash キャリアの振幅がシンボル系列で線形に変化する
raquo 周波数シフトキーイング (FSK)ndash キャリアの周波数がシンボル系列で線形に変化する
raquo 位相シフトキーイング (PSK)ディファレンシャル位相シフトキーイング (DPSK)
ndash キャリアの位相がシンボル系列で線形に変化する
raquo 直交振幅変調 (QAM)ndash キャリアの振幅と位相がシンボル系列で線形に変化する
1 10
Slide 36MG3700A-J-F-11
PSK QAM
bull 本章ではQPSKπ4DQPSK8PSK16QAMの一般例を示します
I
Q
00
Ac-Ac
-Ac
Ac
QPSK
01
10
11
I
Q
Ac-Ac
-Ac
Ac
π4DQPSK
00
01 1011
IAc-Ac
-Ac
Ac
000
001
010
011
Q
100
101
110
111
IAc-Ac-Ac
Ac
0000
0001
0010
0011
Q
1100
1101
1110
1111
8PSK 16QAM
0101
0100
0111
0110
10101000
10111001
3Ac-3Ac
3Ac
-3Ac
19
Slide 37MG3700A-J-F-11
QPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=QPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) Initial phase
pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
Slide 38MG3700A-J-F-11
QPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 round(min(real(g))) round(max(real(g)))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 round(min(imag(g))) round(max(imag(g)))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
20
Slide 39MG3700A-J-F-11
波形位相連続
bull MG3700Aは有限長の波形を再生し絶え間なくリピートします波形の最後と次のリ
ピートの最初との間の位相不連続は周期的なスペクトルリグロースやひずみに至ります
bull 急な位相変化でのリピートは高周波スペクトルリグロースをもたらします
Pd = 16 symbol points波形 ではシンボルデータ長 複製シンボルデータ
波形長
Slide 40MG3700A-J-F-11
π4DQPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=pi4DQPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = dpskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) using phase
shift pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
21
Slide 41MG3700A-J-F-11
π4DQPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 42MG3700A-J-F-11
8PSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=8PSKcsv
M = 8 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
22
Slide 43MG3700A-J-F-11
8PSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 44MG3700A-J-F-11
16QAM
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=16QAMcsv
M = 16 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
23
Slide 45MG3700A-J-F-11
16QAM
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 46MG3700A-J-F-11
Simulinkbull Simulinkとは
raquo Simulinkregはダイナミックシステムのモデル化シミュレーション解析を行
うためのソフトウェアパッケージです連続時間サンプリングした時間または混在のハイブリッドにおいてモデル化された線形や非線形システムをサポートします
bull シミュレーション用ツールraquo 簡単にゼロからモデルを構築できあるいは既存のモデルを取得し追加で
きますMATLAB内のすべての分析ツールに素早くアクセスし結果を取得
し分析および視覚化できます
bull モデルベースデザイン用ツールraquo モデル化ではSimulinkはドラッグampドロップマウス操作を使用してブロッ
クダイヤグラムのようなモデルを構築するためのGUIを提供します自分の
ブロックをカスタマイズし生成することもできますraquo モデルは階層的でトップダウンとボトムアップの両方のアプローチを用いて
構築できますraquo モデルの定義後シミュレートできますシミュレーション結果は後処理と視
覚化のためにMATLABワークスペースに入れることができますCSV file
Simulinkに関する詳細についてはサイバネットシステム(株)ウェブサイトを参照してくださいhttpdlcybernetcojpmatlabsupportmanualr2006toolboxsimulinkindexshtml
24
Slide 47MG3700A-J-F-11
Simulink デモ
bull Simulinkデモは役に立つモデル化コンセプトを図解しますMATLAB Command Windowからデモにアクセスできます
Slide 48MG3700A-J-F-11
Simulink Blockset デモ
bull Blocksetは特定分野での設計やシミュレーションのために設計された専門Simulinkブロックの集まりです
bull 例えば Communications Blocksetは通信システムやコンポーネントのフィジカルレイヤを設計しシミュレートするために Simulinkのブロックの包括的ライブラリを拡張しますBlocksetは通信システムや半導体コン
ポーネント例えば商業か防衛のワイヤレスか有線システムなどを設計するのに役立ちます
Communications Blockset内のブロックを用い適応変調を含んだIEEE 80211a WLANスタンダードのフィジカルレイヤのモデル
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
12
Slide 23MG3700A-J-F-11
FM プログラミング例
bull I = x(t) = = cos[β sin(2πƒmt)]bull Q = y(t) = = sin[β sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull β 変調指数 = ∆ƒƒmbull ∆ƒ ピーク周波数偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 50 Peak frequency deviation [kHz]CSVfile = FM1kHzDeviation50kHzcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationfmsin(2pifmtDataPoints))Q = sin(Deviationfmsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
Slide 24MG3700A-J-F-11
PMm(t)
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
変調信号Dp
-2
-15
-1
-05
0
05
1
15
2
t
Pha
se d
evia
tion
[π r
ad]
ピーク位相偏移 5 [rad] asymp 16 π [rad]
-15
-1
-05
0
05
1
15
t
Am
plitu
de [V
]
c(t) s(t)被変調信号キャリア
13
Slide 25MG3700A-J-F-11
PM プログラミング例
bull I = x(t) = Ac cos[Dp m(t)] = cos[Dp sin(2πƒmt)]bull Q = y(t) = Ac sin[Dp m(t)] = sin[Dp sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull Dp ピーク位相偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 5 Peak phase deviation [kHz]CSVfile = PM1kHzDeviation5radcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationsin(2pifmtDataPoints))Q = sin(Deviationsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
Slide 26MG3700A-J-F-11
パルス変調
bull パルス変調はFMかPMのいずれかと時間多重化バースト信号との組
み合わせを使用してレーダや衛星の信号に使用されますndash PRFPRR パルス繰り返し周波数速度 [pps] [pulses]ndash パルス周期 [s] 1PRFndash パルス幅 [s] 立ち上がり時間含むndash デューティ比 [] パルス幅パルス周期ndash バーストあたりのパルス数 [pulsesburst]ndash バースト長 [s]ndash バースト周期 [s]ndash 立ち上がり時間 [s]
パルス周期
パルス幅
バーストあたりのパルス数バースト長 バースト周期
立ち上がり時間
14
Slide 27MG3700A-J-F-11
パルス変調 プログラミング例
bull I = x(t) = Ac = 1bull Q = y(t) = Ac = 1
bull Ac キャリア信号振幅 = 1bull PRF 700 [pps]bull パルス幅 1 [micros]bull Pulses burst 18bull バースト周期 10 [s]
clear all close all clc
PRF = 700 [pps]PulseWidth = 1E-6 [s]PulsesPerBurst = 18 [pulsesburst]BurstPeriod = 10 [s]CSVfile = Pulse700ppsW1us18ppbB10scsvzerofile = Pulse700ppsW1us18ppbB10sZerocsv
Fs = LCM(PRF1PulseWidth) Sampling rate [Hz] LCM Least Common Multiple Number of samplesW = PulseWidthFsPulseGap = (1PRF-PulseWidth)Fs
(次ページにつづく)
CW
Slide 28MG3700A-J-F-11
パルス変調 プログラミング例
(前ページからつづく)
I = [ ones(1W+2) zeros(1PulseGap-2) ]Q = [ ones(1W+2) zeros(1PulseGap-2) ]RFgateFlag = [ zeros(11) ones(1W) zeros(1PulseGap) ]Burst = [ zeros(11) ones(1W) ]for n = 2PulsesPerBurst
I = [ I ones(1W+2) zeros(1PulseGap-2) ]Q = [ Q ones(1W+2) zeros(1PulseGap-2) ]Burst = [ Burst ones(1PulseGap+W) ]if n == PulsesPerBurst
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap-1) ]else
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap) ]end
end
Marker1 = [ Burst zeros(1PulseGap-1) ] BurstMarker2 = RFgateFlag PulseMarker3 = RFgateFlag Pulsedata = [I Q Marker1 Marker2 Marker3 RFgateFlag]csvwrite(CSVfiledata)
BurstGapPulseLength = PRFBurstPeriod-PulsesPerBurstzero = zeros(1FsPRF) samplespulsezerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)zerofileMultiple = PRFBurstPeriod-PulsesPerBurst Pulse length in Burst gap
IQ
RF gate flag
15
Slide 29MG3700A-J-F-11
パルス変調 プログラミング例
繰り返し
シーケンス機能テクニック
Slide 30MG3700A-J-F-11
パルス変調 プログラミング例
繰り返しエレメント1 エレメント2
シーケンスファイルを生成
16
Slide 31MG3700A-J-F-11
パルスチャープ変調 プログラミング例
bull I = x(t) =bull Q = y(t) =
bull Ac キャリア信号振幅 = 1bull PRF 2000 [pps]bull パルス幅 20 [micros]bull Pulses burst 20
clear all close all clc
PW = 20 Pulse Width [us]PRF = 2000 [pps]Fpeak = 25 Peak Frequency Deviation [MHz]CSVfile = RTS6W20us2000ppscsvzerofile =RTS6W20us2000ppsZerocsv
Fs = Fpeak 40 Sampling rate [MHz]DataPoints = PW Fs
(次ページにつづく)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
FM
Slide 32MG3700A-J-F-11
パルスチャープ変調 プログラミング例
(前ページからつづく)
t = 0DataPointsdPhi = 2pi(-Fpeak + 2 Fpeak tDataPoints)Fs Frequency deviation from -Fpeak to
+FpeakPhi = cumsum(dPhi2) Comulative SumI = cos(Phi)Q = sin(Phi)
I = [zeros(11) I zeros(12)]Q = [zeros(11) Q zeros(12)]BurstFlag = ones(1DataPoints+4)RFgateFlag = [ones(1DataPoints+3) zeros(11)]
data=[I Q BurstFlag RFgateFlag RFgateFlag RFgateFlag] Marker1 Burst OnOff Flag Marker2amp3 RF OnOff Flag
csvwrite(CSVfiledata)
zero = zeros(1DataPoints+4)zerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)
PulsePeriod = Fs 1E6 PRF Pulse period samplesFrameLength = DataPoints + 4GapLength = PulsePeriod - DataPoints - 4
IQ
RF gate flag
17
Slide 33MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンス機能テクニック
Slide 34MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンスファイルを生成
18
Slide 35MG3700A-J-F-11
PSK QAM
bull デジタル変調スキームは一定時間ごとにキャリアの振幅周波数および位相を変更しデジタルベースバンド信号を送ります
raquo アナログ変調スキームはキャリアの振幅周波数および位相を連続的に変更します
基本的なデジタル変調スキームraquo 振幅シフトキーイング (ASK)
ndash キャリアの振幅がシンボル系列で線形に変化する
raquo 周波数シフトキーイング (FSK)ndash キャリアの周波数がシンボル系列で線形に変化する
raquo 位相シフトキーイング (PSK)ディファレンシャル位相シフトキーイング (DPSK)
ndash キャリアの位相がシンボル系列で線形に変化する
raquo 直交振幅変調 (QAM)ndash キャリアの振幅と位相がシンボル系列で線形に変化する
1 10
Slide 36MG3700A-J-F-11
PSK QAM
bull 本章ではQPSKπ4DQPSK8PSK16QAMの一般例を示します
I
Q
00
Ac-Ac
-Ac
Ac
QPSK
01
10
11
I
Q
Ac-Ac
-Ac
Ac
π4DQPSK
00
01 1011
IAc-Ac
-Ac
Ac
000
001
010
011
Q
100
101
110
111
IAc-Ac-Ac
Ac
0000
0001
0010
0011
Q
1100
1101
1110
1111
8PSK 16QAM
0101
0100
0111
0110
10101000
10111001
3Ac-3Ac
3Ac
-3Ac
19
Slide 37MG3700A-J-F-11
QPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=QPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) Initial phase
pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
Slide 38MG3700A-J-F-11
QPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 round(min(real(g))) round(max(real(g)))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 round(min(imag(g))) round(max(imag(g)))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
20
Slide 39MG3700A-J-F-11
波形位相連続
bull MG3700Aは有限長の波形を再生し絶え間なくリピートします波形の最後と次のリ
ピートの最初との間の位相不連続は周期的なスペクトルリグロースやひずみに至ります
bull 急な位相変化でのリピートは高周波スペクトルリグロースをもたらします
Pd = 16 symbol points波形 ではシンボルデータ長 複製シンボルデータ
波形長
Slide 40MG3700A-J-F-11
π4DQPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=pi4DQPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = dpskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) using phase
shift pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
21
Slide 41MG3700A-J-F-11
π4DQPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 42MG3700A-J-F-11
8PSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=8PSKcsv
M = 8 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
22
Slide 43MG3700A-J-F-11
8PSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 44MG3700A-J-F-11
16QAM
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=16QAMcsv
M = 16 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
23
Slide 45MG3700A-J-F-11
16QAM
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 46MG3700A-J-F-11
Simulinkbull Simulinkとは
raquo Simulinkregはダイナミックシステムのモデル化シミュレーション解析を行
うためのソフトウェアパッケージです連続時間サンプリングした時間または混在のハイブリッドにおいてモデル化された線形や非線形システムをサポートします
bull シミュレーション用ツールraquo 簡単にゼロからモデルを構築できあるいは既存のモデルを取得し追加で
きますMATLAB内のすべての分析ツールに素早くアクセスし結果を取得
し分析および視覚化できます
bull モデルベースデザイン用ツールraquo モデル化ではSimulinkはドラッグampドロップマウス操作を使用してブロッ
クダイヤグラムのようなモデルを構築するためのGUIを提供します自分の
ブロックをカスタマイズし生成することもできますraquo モデルは階層的でトップダウンとボトムアップの両方のアプローチを用いて
構築できますraquo モデルの定義後シミュレートできますシミュレーション結果は後処理と視
覚化のためにMATLABワークスペースに入れることができますCSV file
Simulinkに関する詳細についてはサイバネットシステム(株)ウェブサイトを参照してくださいhttpdlcybernetcojpmatlabsupportmanualr2006toolboxsimulinkindexshtml
24
Slide 47MG3700A-J-F-11
Simulink デモ
bull Simulinkデモは役に立つモデル化コンセプトを図解しますMATLAB Command Windowからデモにアクセスできます
Slide 48MG3700A-J-F-11
Simulink Blockset デモ
bull Blocksetは特定分野での設計やシミュレーションのために設計された専門Simulinkブロックの集まりです
bull 例えば Communications Blocksetは通信システムやコンポーネントのフィジカルレイヤを設計しシミュレートするために Simulinkのブロックの包括的ライブラリを拡張しますBlocksetは通信システムや半導体コン
ポーネント例えば商業か防衛のワイヤレスか有線システムなどを設計するのに役立ちます
Communications Blockset内のブロックを用い適応変調を含んだIEEE 80211a WLANスタンダードのフィジカルレイヤのモデル
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
13
Slide 25MG3700A-J-F-11
PM プログラミング例
bull I = x(t) = Ac cos[Dp m(t)] = cos[Dp sin(2πƒmt)]bull Q = y(t) = Ac sin[Dp m(t)] = sin[Dp sin(2πƒmt)]
bull Ac キャリア信号振幅 = 1bull Dp ピーク位相偏移
clear all close all clc
fm = 1 Modulating frequency [kHz]Deviation = 5 Peak phase deviation [kHz]CSVfile = PM1kHzDeviation5radcsv
DataPoints = 1000Fs = fmDataPoints Sampling rate [kHz]
t = 0DataPoints-1I = cos(Deviationsin(2pifmtDataPoints))Q = sin(Deviationsin(2pifmtDataPoints))data = [I Q]csvwrite(CSVfiledata)
Slide 26MG3700A-J-F-11
パルス変調
bull パルス変調はFMかPMのいずれかと時間多重化バースト信号との組
み合わせを使用してレーダや衛星の信号に使用されますndash PRFPRR パルス繰り返し周波数速度 [pps] [pulses]ndash パルス周期 [s] 1PRFndash パルス幅 [s] 立ち上がり時間含むndash デューティ比 [] パルス幅パルス周期ndash バーストあたりのパルス数 [pulsesburst]ndash バースト長 [s]ndash バースト周期 [s]ndash 立ち上がり時間 [s]
パルス周期
パルス幅
バーストあたりのパルス数バースト長 バースト周期
立ち上がり時間
14
Slide 27MG3700A-J-F-11
パルス変調 プログラミング例
bull I = x(t) = Ac = 1bull Q = y(t) = Ac = 1
bull Ac キャリア信号振幅 = 1bull PRF 700 [pps]bull パルス幅 1 [micros]bull Pulses burst 18bull バースト周期 10 [s]
clear all close all clc
PRF = 700 [pps]PulseWidth = 1E-6 [s]PulsesPerBurst = 18 [pulsesburst]BurstPeriod = 10 [s]CSVfile = Pulse700ppsW1us18ppbB10scsvzerofile = Pulse700ppsW1us18ppbB10sZerocsv
Fs = LCM(PRF1PulseWidth) Sampling rate [Hz] LCM Least Common Multiple Number of samplesW = PulseWidthFsPulseGap = (1PRF-PulseWidth)Fs
(次ページにつづく)
CW
Slide 28MG3700A-J-F-11
パルス変調 プログラミング例
(前ページからつづく)
I = [ ones(1W+2) zeros(1PulseGap-2) ]Q = [ ones(1W+2) zeros(1PulseGap-2) ]RFgateFlag = [ zeros(11) ones(1W) zeros(1PulseGap) ]Burst = [ zeros(11) ones(1W) ]for n = 2PulsesPerBurst
I = [ I ones(1W+2) zeros(1PulseGap-2) ]Q = [ Q ones(1W+2) zeros(1PulseGap-2) ]Burst = [ Burst ones(1PulseGap+W) ]if n == PulsesPerBurst
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap-1) ]else
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap) ]end
end
Marker1 = [ Burst zeros(1PulseGap-1) ] BurstMarker2 = RFgateFlag PulseMarker3 = RFgateFlag Pulsedata = [I Q Marker1 Marker2 Marker3 RFgateFlag]csvwrite(CSVfiledata)
BurstGapPulseLength = PRFBurstPeriod-PulsesPerBurstzero = zeros(1FsPRF) samplespulsezerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)zerofileMultiple = PRFBurstPeriod-PulsesPerBurst Pulse length in Burst gap
IQ
RF gate flag
15
Slide 29MG3700A-J-F-11
パルス変調 プログラミング例
繰り返し
シーケンス機能テクニック
Slide 30MG3700A-J-F-11
パルス変調 プログラミング例
繰り返しエレメント1 エレメント2
シーケンスファイルを生成
16
Slide 31MG3700A-J-F-11
パルスチャープ変調 プログラミング例
bull I = x(t) =bull Q = y(t) =
bull Ac キャリア信号振幅 = 1bull PRF 2000 [pps]bull パルス幅 20 [micros]bull Pulses burst 20
clear all close all clc
PW = 20 Pulse Width [us]PRF = 2000 [pps]Fpeak = 25 Peak Frequency Deviation [MHz]CSVfile = RTS6W20us2000ppscsvzerofile =RTS6W20us2000ppsZerocsv
Fs = Fpeak 40 Sampling rate [MHz]DataPoints = PW Fs
(次ページにつづく)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
FM
Slide 32MG3700A-J-F-11
パルスチャープ変調 プログラミング例
(前ページからつづく)
t = 0DataPointsdPhi = 2pi(-Fpeak + 2 Fpeak tDataPoints)Fs Frequency deviation from -Fpeak to
+FpeakPhi = cumsum(dPhi2) Comulative SumI = cos(Phi)Q = sin(Phi)
I = [zeros(11) I zeros(12)]Q = [zeros(11) Q zeros(12)]BurstFlag = ones(1DataPoints+4)RFgateFlag = [ones(1DataPoints+3) zeros(11)]
data=[I Q BurstFlag RFgateFlag RFgateFlag RFgateFlag] Marker1 Burst OnOff Flag Marker2amp3 RF OnOff Flag
csvwrite(CSVfiledata)
zero = zeros(1DataPoints+4)zerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)
PulsePeriod = Fs 1E6 PRF Pulse period samplesFrameLength = DataPoints + 4GapLength = PulsePeriod - DataPoints - 4
IQ
RF gate flag
17
Slide 33MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンス機能テクニック
Slide 34MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンスファイルを生成
18
Slide 35MG3700A-J-F-11
PSK QAM
bull デジタル変調スキームは一定時間ごとにキャリアの振幅周波数および位相を変更しデジタルベースバンド信号を送ります
raquo アナログ変調スキームはキャリアの振幅周波数および位相を連続的に変更します
基本的なデジタル変調スキームraquo 振幅シフトキーイング (ASK)
ndash キャリアの振幅がシンボル系列で線形に変化する
raquo 周波数シフトキーイング (FSK)ndash キャリアの周波数がシンボル系列で線形に変化する
raquo 位相シフトキーイング (PSK)ディファレンシャル位相シフトキーイング (DPSK)
ndash キャリアの位相がシンボル系列で線形に変化する
raquo 直交振幅変調 (QAM)ndash キャリアの振幅と位相がシンボル系列で線形に変化する
1 10
Slide 36MG3700A-J-F-11
PSK QAM
bull 本章ではQPSKπ4DQPSK8PSK16QAMの一般例を示します
I
Q
00
Ac-Ac
-Ac
Ac
QPSK
01
10
11
I
Q
Ac-Ac
-Ac
Ac
π4DQPSK
00
01 1011
IAc-Ac
-Ac
Ac
000
001
010
011
Q
100
101
110
111
IAc-Ac-Ac
Ac
0000
0001
0010
0011
Q
1100
1101
1110
1111
8PSK 16QAM
0101
0100
0111
0110
10101000
10111001
3Ac-3Ac
3Ac
-3Ac
19
Slide 37MG3700A-J-F-11
QPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=QPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) Initial phase
pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
Slide 38MG3700A-J-F-11
QPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 round(min(real(g))) round(max(real(g)))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 round(min(imag(g))) round(max(imag(g)))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
20
Slide 39MG3700A-J-F-11
波形位相連続
bull MG3700Aは有限長の波形を再生し絶え間なくリピートします波形の最後と次のリ
ピートの最初との間の位相不連続は周期的なスペクトルリグロースやひずみに至ります
bull 急な位相変化でのリピートは高周波スペクトルリグロースをもたらします
Pd = 16 symbol points波形 ではシンボルデータ長 複製シンボルデータ
波形長
Slide 40MG3700A-J-F-11
π4DQPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=pi4DQPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = dpskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) using phase
shift pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
21
Slide 41MG3700A-J-F-11
π4DQPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 42MG3700A-J-F-11
8PSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=8PSKcsv
M = 8 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
22
Slide 43MG3700A-J-F-11
8PSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 44MG3700A-J-F-11
16QAM
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=16QAMcsv
M = 16 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
23
Slide 45MG3700A-J-F-11
16QAM
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 46MG3700A-J-F-11
Simulinkbull Simulinkとは
raquo Simulinkregはダイナミックシステムのモデル化シミュレーション解析を行
うためのソフトウェアパッケージです連続時間サンプリングした時間または混在のハイブリッドにおいてモデル化された線形や非線形システムをサポートします
bull シミュレーション用ツールraquo 簡単にゼロからモデルを構築できあるいは既存のモデルを取得し追加で
きますMATLAB内のすべての分析ツールに素早くアクセスし結果を取得
し分析および視覚化できます
bull モデルベースデザイン用ツールraquo モデル化ではSimulinkはドラッグampドロップマウス操作を使用してブロッ
クダイヤグラムのようなモデルを構築するためのGUIを提供します自分の
ブロックをカスタマイズし生成することもできますraquo モデルは階層的でトップダウンとボトムアップの両方のアプローチを用いて
構築できますraquo モデルの定義後シミュレートできますシミュレーション結果は後処理と視
覚化のためにMATLABワークスペースに入れることができますCSV file
Simulinkに関する詳細についてはサイバネットシステム(株)ウェブサイトを参照してくださいhttpdlcybernetcojpmatlabsupportmanualr2006toolboxsimulinkindexshtml
24
Slide 47MG3700A-J-F-11
Simulink デモ
bull Simulinkデモは役に立つモデル化コンセプトを図解しますMATLAB Command Windowからデモにアクセスできます
Slide 48MG3700A-J-F-11
Simulink Blockset デモ
bull Blocksetは特定分野での設計やシミュレーションのために設計された専門Simulinkブロックの集まりです
bull 例えば Communications Blocksetは通信システムやコンポーネントのフィジカルレイヤを設計しシミュレートするために Simulinkのブロックの包括的ライブラリを拡張しますBlocksetは通信システムや半導体コン
ポーネント例えば商業か防衛のワイヤレスか有線システムなどを設計するのに役立ちます
Communications Blockset内のブロックを用い適応変調を含んだIEEE 80211a WLANスタンダードのフィジカルレイヤのモデル
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
14
Slide 27MG3700A-J-F-11
パルス変調 プログラミング例
bull I = x(t) = Ac = 1bull Q = y(t) = Ac = 1
bull Ac キャリア信号振幅 = 1bull PRF 700 [pps]bull パルス幅 1 [micros]bull Pulses burst 18bull バースト周期 10 [s]
clear all close all clc
PRF = 700 [pps]PulseWidth = 1E-6 [s]PulsesPerBurst = 18 [pulsesburst]BurstPeriod = 10 [s]CSVfile = Pulse700ppsW1us18ppbB10scsvzerofile = Pulse700ppsW1us18ppbB10sZerocsv
Fs = LCM(PRF1PulseWidth) Sampling rate [Hz] LCM Least Common Multiple Number of samplesW = PulseWidthFsPulseGap = (1PRF-PulseWidth)Fs
(次ページにつづく)
CW
Slide 28MG3700A-J-F-11
パルス変調 プログラミング例
(前ページからつづく)
I = [ ones(1W+2) zeros(1PulseGap-2) ]Q = [ ones(1W+2) zeros(1PulseGap-2) ]RFgateFlag = [ zeros(11) ones(1W) zeros(1PulseGap) ]Burst = [ zeros(11) ones(1W) ]for n = 2PulsesPerBurst
I = [ I ones(1W+2) zeros(1PulseGap-2) ]Q = [ Q ones(1W+2) zeros(1PulseGap-2) ]Burst = [ Burst ones(1PulseGap+W) ]if n == PulsesPerBurst
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap-1) ]else
RFgateFlag = [ RFgateFlag ones(1W) zeros(1PulseGap) ]end
end
Marker1 = [ Burst zeros(1PulseGap-1) ] BurstMarker2 = RFgateFlag PulseMarker3 = RFgateFlag Pulsedata = [I Q Marker1 Marker2 Marker3 RFgateFlag]csvwrite(CSVfiledata)
BurstGapPulseLength = PRFBurstPeriod-PulsesPerBurstzero = zeros(1FsPRF) samplespulsezerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)zerofileMultiple = PRFBurstPeriod-PulsesPerBurst Pulse length in Burst gap
IQ
RF gate flag
15
Slide 29MG3700A-J-F-11
パルス変調 プログラミング例
繰り返し
シーケンス機能テクニック
Slide 30MG3700A-J-F-11
パルス変調 プログラミング例
繰り返しエレメント1 エレメント2
シーケンスファイルを生成
16
Slide 31MG3700A-J-F-11
パルスチャープ変調 プログラミング例
bull I = x(t) =bull Q = y(t) =
bull Ac キャリア信号振幅 = 1bull PRF 2000 [pps]bull パルス幅 20 [micros]bull Pulses burst 20
clear all close all clc
PW = 20 Pulse Width [us]PRF = 2000 [pps]Fpeak = 25 Peak Frequency Deviation [MHz]CSVfile = RTS6W20us2000ppscsvzerofile =RTS6W20us2000ppsZerocsv
Fs = Fpeak 40 Sampling rate [MHz]DataPoints = PW Fs
(次ページにつづく)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
FM
Slide 32MG3700A-J-F-11
パルスチャープ変調 プログラミング例
(前ページからつづく)
t = 0DataPointsdPhi = 2pi(-Fpeak + 2 Fpeak tDataPoints)Fs Frequency deviation from -Fpeak to
+FpeakPhi = cumsum(dPhi2) Comulative SumI = cos(Phi)Q = sin(Phi)
I = [zeros(11) I zeros(12)]Q = [zeros(11) Q zeros(12)]BurstFlag = ones(1DataPoints+4)RFgateFlag = [ones(1DataPoints+3) zeros(11)]
data=[I Q BurstFlag RFgateFlag RFgateFlag RFgateFlag] Marker1 Burst OnOff Flag Marker2amp3 RF OnOff Flag
csvwrite(CSVfiledata)
zero = zeros(1DataPoints+4)zerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)
PulsePeriod = Fs 1E6 PRF Pulse period samplesFrameLength = DataPoints + 4GapLength = PulsePeriod - DataPoints - 4
IQ
RF gate flag
17
Slide 33MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンス機能テクニック
Slide 34MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンスファイルを生成
18
Slide 35MG3700A-J-F-11
PSK QAM
bull デジタル変調スキームは一定時間ごとにキャリアの振幅周波数および位相を変更しデジタルベースバンド信号を送ります
raquo アナログ変調スキームはキャリアの振幅周波数および位相を連続的に変更します
基本的なデジタル変調スキームraquo 振幅シフトキーイング (ASK)
ndash キャリアの振幅がシンボル系列で線形に変化する
raquo 周波数シフトキーイング (FSK)ndash キャリアの周波数がシンボル系列で線形に変化する
raquo 位相シフトキーイング (PSK)ディファレンシャル位相シフトキーイング (DPSK)
ndash キャリアの位相がシンボル系列で線形に変化する
raquo 直交振幅変調 (QAM)ndash キャリアの振幅と位相がシンボル系列で線形に変化する
1 10
Slide 36MG3700A-J-F-11
PSK QAM
bull 本章ではQPSKπ4DQPSK8PSK16QAMの一般例を示します
I
Q
00
Ac-Ac
-Ac
Ac
QPSK
01
10
11
I
Q
Ac-Ac
-Ac
Ac
π4DQPSK
00
01 1011
IAc-Ac
-Ac
Ac
000
001
010
011
Q
100
101
110
111
IAc-Ac-Ac
Ac
0000
0001
0010
0011
Q
1100
1101
1110
1111
8PSK 16QAM
0101
0100
0111
0110
10101000
10111001
3Ac-3Ac
3Ac
-3Ac
19
Slide 37MG3700A-J-F-11
QPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=QPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) Initial phase
pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
Slide 38MG3700A-J-F-11
QPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 round(min(real(g))) round(max(real(g)))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 round(min(imag(g))) round(max(imag(g)))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
20
Slide 39MG3700A-J-F-11
波形位相連続
bull MG3700Aは有限長の波形を再生し絶え間なくリピートします波形の最後と次のリ
ピートの最初との間の位相不連続は周期的なスペクトルリグロースやひずみに至ります
bull 急な位相変化でのリピートは高周波スペクトルリグロースをもたらします
Pd = 16 symbol points波形 ではシンボルデータ長 複製シンボルデータ
波形長
Slide 40MG3700A-J-F-11
π4DQPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=pi4DQPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = dpskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) using phase
shift pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
21
Slide 41MG3700A-J-F-11
π4DQPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 42MG3700A-J-F-11
8PSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=8PSKcsv
M = 8 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
22
Slide 43MG3700A-J-F-11
8PSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 44MG3700A-J-F-11
16QAM
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=16QAMcsv
M = 16 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
23
Slide 45MG3700A-J-F-11
16QAM
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 46MG3700A-J-F-11
Simulinkbull Simulinkとは
raquo Simulinkregはダイナミックシステムのモデル化シミュレーション解析を行
うためのソフトウェアパッケージです連続時間サンプリングした時間または混在のハイブリッドにおいてモデル化された線形や非線形システムをサポートします
bull シミュレーション用ツールraquo 簡単にゼロからモデルを構築できあるいは既存のモデルを取得し追加で
きますMATLAB内のすべての分析ツールに素早くアクセスし結果を取得
し分析および視覚化できます
bull モデルベースデザイン用ツールraquo モデル化ではSimulinkはドラッグampドロップマウス操作を使用してブロッ
クダイヤグラムのようなモデルを構築するためのGUIを提供します自分の
ブロックをカスタマイズし生成することもできますraquo モデルは階層的でトップダウンとボトムアップの両方のアプローチを用いて
構築できますraquo モデルの定義後シミュレートできますシミュレーション結果は後処理と視
覚化のためにMATLABワークスペースに入れることができますCSV file
Simulinkに関する詳細についてはサイバネットシステム(株)ウェブサイトを参照してくださいhttpdlcybernetcojpmatlabsupportmanualr2006toolboxsimulinkindexshtml
24
Slide 47MG3700A-J-F-11
Simulink デモ
bull Simulinkデモは役に立つモデル化コンセプトを図解しますMATLAB Command Windowからデモにアクセスできます
Slide 48MG3700A-J-F-11
Simulink Blockset デモ
bull Blocksetは特定分野での設計やシミュレーションのために設計された専門Simulinkブロックの集まりです
bull 例えば Communications Blocksetは通信システムやコンポーネントのフィジカルレイヤを設計しシミュレートするために Simulinkのブロックの包括的ライブラリを拡張しますBlocksetは通信システムや半導体コン
ポーネント例えば商業か防衛のワイヤレスか有線システムなどを設計するのに役立ちます
Communications Blockset内のブロックを用い適応変調を含んだIEEE 80211a WLANスタンダードのフィジカルレイヤのモデル
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
15
Slide 29MG3700A-J-F-11
パルス変調 プログラミング例
繰り返し
シーケンス機能テクニック
Slide 30MG3700A-J-F-11
パルス変調 プログラミング例
繰り返しエレメント1 エレメント2
シーケンスファイルを生成
16
Slide 31MG3700A-J-F-11
パルスチャープ変調 プログラミング例
bull I = x(t) =bull Q = y(t) =
bull Ac キャリア信号振幅 = 1bull PRF 2000 [pps]bull パルス幅 20 [micros]bull Pulses burst 20
clear all close all clc
PW = 20 Pulse Width [us]PRF = 2000 [pps]Fpeak = 25 Peak Frequency Deviation [MHz]CSVfile = RTS6W20us2000ppscsvzerofile =RTS6W20us2000ppsZerocsv
Fs = Fpeak 40 Sampling rate [MHz]DataPoints = PW Fs
(次ページにつづく)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
FM
Slide 32MG3700A-J-F-11
パルスチャープ変調 プログラミング例
(前ページからつづく)
t = 0DataPointsdPhi = 2pi(-Fpeak + 2 Fpeak tDataPoints)Fs Frequency deviation from -Fpeak to
+FpeakPhi = cumsum(dPhi2) Comulative SumI = cos(Phi)Q = sin(Phi)
I = [zeros(11) I zeros(12)]Q = [zeros(11) Q zeros(12)]BurstFlag = ones(1DataPoints+4)RFgateFlag = [ones(1DataPoints+3) zeros(11)]
data=[I Q BurstFlag RFgateFlag RFgateFlag RFgateFlag] Marker1 Burst OnOff Flag Marker2amp3 RF OnOff Flag
csvwrite(CSVfiledata)
zero = zeros(1DataPoints+4)zerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)
PulsePeriod = Fs 1E6 PRF Pulse period samplesFrameLength = DataPoints + 4GapLength = PulsePeriod - DataPoints - 4
IQ
RF gate flag
17
Slide 33MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンス機能テクニック
Slide 34MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンスファイルを生成
18
Slide 35MG3700A-J-F-11
PSK QAM
bull デジタル変調スキームは一定時間ごとにキャリアの振幅周波数および位相を変更しデジタルベースバンド信号を送ります
raquo アナログ変調スキームはキャリアの振幅周波数および位相を連続的に変更します
基本的なデジタル変調スキームraquo 振幅シフトキーイング (ASK)
ndash キャリアの振幅がシンボル系列で線形に変化する
raquo 周波数シフトキーイング (FSK)ndash キャリアの周波数がシンボル系列で線形に変化する
raquo 位相シフトキーイング (PSK)ディファレンシャル位相シフトキーイング (DPSK)
ndash キャリアの位相がシンボル系列で線形に変化する
raquo 直交振幅変調 (QAM)ndash キャリアの振幅と位相がシンボル系列で線形に変化する
1 10
Slide 36MG3700A-J-F-11
PSK QAM
bull 本章ではQPSKπ4DQPSK8PSK16QAMの一般例を示します
I
Q
00
Ac-Ac
-Ac
Ac
QPSK
01
10
11
I
Q
Ac-Ac
-Ac
Ac
π4DQPSK
00
01 1011
IAc-Ac
-Ac
Ac
000
001
010
011
Q
100
101
110
111
IAc-Ac-Ac
Ac
0000
0001
0010
0011
Q
1100
1101
1110
1111
8PSK 16QAM
0101
0100
0111
0110
10101000
10111001
3Ac-3Ac
3Ac
-3Ac
19
Slide 37MG3700A-J-F-11
QPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=QPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) Initial phase
pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
Slide 38MG3700A-J-F-11
QPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 round(min(real(g))) round(max(real(g)))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 round(min(imag(g))) round(max(imag(g)))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
20
Slide 39MG3700A-J-F-11
波形位相連続
bull MG3700Aは有限長の波形を再生し絶え間なくリピートします波形の最後と次のリ
ピートの最初との間の位相不連続は周期的なスペクトルリグロースやひずみに至ります
bull 急な位相変化でのリピートは高周波スペクトルリグロースをもたらします
Pd = 16 symbol points波形 ではシンボルデータ長 複製シンボルデータ
波形長
Slide 40MG3700A-J-F-11
π4DQPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=pi4DQPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = dpskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) using phase
shift pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
21
Slide 41MG3700A-J-F-11
π4DQPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 42MG3700A-J-F-11
8PSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=8PSKcsv
M = 8 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
22
Slide 43MG3700A-J-F-11
8PSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 44MG3700A-J-F-11
16QAM
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=16QAMcsv
M = 16 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
23
Slide 45MG3700A-J-F-11
16QAM
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 46MG3700A-J-F-11
Simulinkbull Simulinkとは
raquo Simulinkregはダイナミックシステムのモデル化シミュレーション解析を行
うためのソフトウェアパッケージです連続時間サンプリングした時間または混在のハイブリッドにおいてモデル化された線形や非線形システムをサポートします
bull シミュレーション用ツールraquo 簡単にゼロからモデルを構築できあるいは既存のモデルを取得し追加で
きますMATLAB内のすべての分析ツールに素早くアクセスし結果を取得
し分析および視覚化できます
bull モデルベースデザイン用ツールraquo モデル化ではSimulinkはドラッグampドロップマウス操作を使用してブロッ
クダイヤグラムのようなモデルを構築するためのGUIを提供します自分の
ブロックをカスタマイズし生成することもできますraquo モデルは階層的でトップダウンとボトムアップの両方のアプローチを用いて
構築できますraquo モデルの定義後シミュレートできますシミュレーション結果は後処理と視
覚化のためにMATLABワークスペースに入れることができますCSV file
Simulinkに関する詳細についてはサイバネットシステム(株)ウェブサイトを参照してくださいhttpdlcybernetcojpmatlabsupportmanualr2006toolboxsimulinkindexshtml
24
Slide 47MG3700A-J-F-11
Simulink デモ
bull Simulinkデモは役に立つモデル化コンセプトを図解しますMATLAB Command Windowからデモにアクセスできます
Slide 48MG3700A-J-F-11
Simulink Blockset デモ
bull Blocksetは特定分野での設計やシミュレーションのために設計された専門Simulinkブロックの集まりです
bull 例えば Communications Blocksetは通信システムやコンポーネントのフィジカルレイヤを設計しシミュレートするために Simulinkのブロックの包括的ライブラリを拡張しますBlocksetは通信システムや半導体コン
ポーネント例えば商業か防衛のワイヤレスか有線システムなどを設計するのに役立ちます
Communications Blockset内のブロックを用い適応変調を含んだIEEE 80211a WLANスタンダードのフィジカルレイヤのモデル
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
16
Slide 31MG3700A-J-F-11
パルスチャープ変調 プログラミング例
bull I = x(t) =bull Q = y(t) =
bull Ac キャリア信号振幅 = 1bull PRF 2000 [pps]bull パルス幅 20 [micros]bull Pulses burst 20
clear all close all clc
PW = 20 Pulse Width [us]PRF = 2000 [pps]Fpeak = 25 Peak Frequency Deviation [MHz]CSVfile = RTS6W20us2000ppscsvzerofile =RTS6W20us2000ppsZerocsv
Fs = Fpeak 40 Sampling rate [MHz]DataPoints = PW Fs
(次ページにつづく)
int infinminus
t
fc dmDA σσ )(cos
int infinminus
t
fc dmDA σσ )(sin
FM
Slide 32MG3700A-J-F-11
パルスチャープ変調 プログラミング例
(前ページからつづく)
t = 0DataPointsdPhi = 2pi(-Fpeak + 2 Fpeak tDataPoints)Fs Frequency deviation from -Fpeak to
+FpeakPhi = cumsum(dPhi2) Comulative SumI = cos(Phi)Q = sin(Phi)
I = [zeros(11) I zeros(12)]Q = [zeros(11) Q zeros(12)]BurstFlag = ones(1DataPoints+4)RFgateFlag = [ones(1DataPoints+3) zeros(11)]
data=[I Q BurstFlag RFgateFlag RFgateFlag RFgateFlag] Marker1 Burst OnOff Flag Marker2amp3 RF OnOff Flag
csvwrite(CSVfiledata)
zero = zeros(1DataPoints+4)zerodata = [zero zero zero zero zero zero]csvwrite(zerofilezerodata)
PulsePeriod = Fs 1E6 PRF Pulse period samplesFrameLength = DataPoints + 4GapLength = PulsePeriod - DataPoints - 4
IQ
RF gate flag
17
Slide 33MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンス機能テクニック
Slide 34MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンスファイルを生成
18
Slide 35MG3700A-J-F-11
PSK QAM
bull デジタル変調スキームは一定時間ごとにキャリアの振幅周波数および位相を変更しデジタルベースバンド信号を送ります
raquo アナログ変調スキームはキャリアの振幅周波数および位相を連続的に変更します
基本的なデジタル変調スキームraquo 振幅シフトキーイング (ASK)
ndash キャリアの振幅がシンボル系列で線形に変化する
raquo 周波数シフトキーイング (FSK)ndash キャリアの周波数がシンボル系列で線形に変化する
raquo 位相シフトキーイング (PSK)ディファレンシャル位相シフトキーイング (DPSK)
ndash キャリアの位相がシンボル系列で線形に変化する
raquo 直交振幅変調 (QAM)ndash キャリアの振幅と位相がシンボル系列で線形に変化する
1 10
Slide 36MG3700A-J-F-11
PSK QAM
bull 本章ではQPSKπ4DQPSK8PSK16QAMの一般例を示します
I
Q
00
Ac-Ac
-Ac
Ac
QPSK
01
10
11
I
Q
Ac-Ac
-Ac
Ac
π4DQPSK
00
01 1011
IAc-Ac
-Ac
Ac
000
001
010
011
Q
100
101
110
111
IAc-Ac-Ac
Ac
0000
0001
0010
0011
Q
1100
1101
1110
1111
8PSK 16QAM
0101
0100
0111
0110
10101000
10111001
3Ac-3Ac
3Ac
-3Ac
19
Slide 37MG3700A-J-F-11
QPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=QPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) Initial phase
pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
Slide 38MG3700A-J-F-11
QPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 round(min(real(g))) round(max(real(g)))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 round(min(imag(g))) round(max(imag(g)))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
20
Slide 39MG3700A-J-F-11
波形位相連続
bull MG3700Aは有限長の波形を再生し絶え間なくリピートします波形の最後と次のリ
ピートの最初との間の位相不連続は周期的なスペクトルリグロースやひずみに至ります
bull 急な位相変化でのリピートは高周波スペクトルリグロースをもたらします
Pd = 16 symbol points波形 ではシンボルデータ長 複製シンボルデータ
波形長
Slide 40MG3700A-J-F-11
π4DQPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=pi4DQPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = dpskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) using phase
shift pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
21
Slide 41MG3700A-J-F-11
π4DQPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 42MG3700A-J-F-11
8PSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=8PSKcsv
M = 8 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
22
Slide 43MG3700A-J-F-11
8PSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 44MG3700A-J-F-11
16QAM
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=16QAMcsv
M = 16 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
23
Slide 45MG3700A-J-F-11
16QAM
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 46MG3700A-J-F-11
Simulinkbull Simulinkとは
raquo Simulinkregはダイナミックシステムのモデル化シミュレーション解析を行
うためのソフトウェアパッケージです連続時間サンプリングした時間または混在のハイブリッドにおいてモデル化された線形や非線形システムをサポートします
bull シミュレーション用ツールraquo 簡単にゼロからモデルを構築できあるいは既存のモデルを取得し追加で
きますMATLAB内のすべての分析ツールに素早くアクセスし結果を取得
し分析および視覚化できます
bull モデルベースデザイン用ツールraquo モデル化ではSimulinkはドラッグampドロップマウス操作を使用してブロッ
クダイヤグラムのようなモデルを構築するためのGUIを提供します自分の
ブロックをカスタマイズし生成することもできますraquo モデルは階層的でトップダウンとボトムアップの両方のアプローチを用いて
構築できますraquo モデルの定義後シミュレートできますシミュレーション結果は後処理と視
覚化のためにMATLABワークスペースに入れることができますCSV file
Simulinkに関する詳細についてはサイバネットシステム(株)ウェブサイトを参照してくださいhttpdlcybernetcojpmatlabsupportmanualr2006toolboxsimulinkindexshtml
24
Slide 47MG3700A-J-F-11
Simulink デモ
bull Simulinkデモは役に立つモデル化コンセプトを図解しますMATLAB Command Windowからデモにアクセスできます
Slide 48MG3700A-J-F-11
Simulink Blockset デモ
bull Blocksetは特定分野での設計やシミュレーションのために設計された専門Simulinkブロックの集まりです
bull 例えば Communications Blocksetは通信システムやコンポーネントのフィジカルレイヤを設計しシミュレートするために Simulinkのブロックの包括的ライブラリを拡張しますBlocksetは通信システムや半導体コン
ポーネント例えば商業か防衛のワイヤレスか有線システムなどを設計するのに役立ちます
Communications Blockset内のブロックを用い適応変調を含んだIEEE 80211a WLANスタンダードのフィジカルレイヤのモデル
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
17
Slide 33MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンス機能テクニック
Slide 34MG3700A-J-F-11
パルスチャープ変調 プログラミング例
繰り返し 繰り返し
シーケンスファイルを生成
18
Slide 35MG3700A-J-F-11
PSK QAM
bull デジタル変調スキームは一定時間ごとにキャリアの振幅周波数および位相を変更しデジタルベースバンド信号を送ります
raquo アナログ変調スキームはキャリアの振幅周波数および位相を連続的に変更します
基本的なデジタル変調スキームraquo 振幅シフトキーイング (ASK)
ndash キャリアの振幅がシンボル系列で線形に変化する
raquo 周波数シフトキーイング (FSK)ndash キャリアの周波数がシンボル系列で線形に変化する
raquo 位相シフトキーイング (PSK)ディファレンシャル位相シフトキーイング (DPSK)
ndash キャリアの位相がシンボル系列で線形に変化する
raquo 直交振幅変調 (QAM)ndash キャリアの振幅と位相がシンボル系列で線形に変化する
1 10
Slide 36MG3700A-J-F-11
PSK QAM
bull 本章ではQPSKπ4DQPSK8PSK16QAMの一般例を示します
I
Q
00
Ac-Ac
-Ac
Ac
QPSK
01
10
11
I
Q
Ac-Ac
-Ac
Ac
π4DQPSK
00
01 1011
IAc-Ac
-Ac
Ac
000
001
010
011
Q
100
101
110
111
IAc-Ac-Ac
Ac
0000
0001
0010
0011
Q
1100
1101
1110
1111
8PSK 16QAM
0101
0100
0111
0110
10101000
10111001
3Ac-3Ac
3Ac
-3Ac
19
Slide 37MG3700A-J-F-11
QPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=QPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) Initial phase
pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
Slide 38MG3700A-J-F-11
QPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 round(min(real(g))) round(max(real(g)))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 round(min(imag(g))) round(max(imag(g)))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
20
Slide 39MG3700A-J-F-11
波形位相連続
bull MG3700Aは有限長の波形を再生し絶え間なくリピートします波形の最後と次のリ
ピートの最初との間の位相不連続は周期的なスペクトルリグロースやひずみに至ります
bull 急な位相変化でのリピートは高周波スペクトルリグロースをもたらします
Pd = 16 symbol points波形 ではシンボルデータ長 複製シンボルデータ
波形長
Slide 40MG3700A-J-F-11
π4DQPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=pi4DQPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = dpskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) using phase
shift pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
21
Slide 41MG3700A-J-F-11
π4DQPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 42MG3700A-J-F-11
8PSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=8PSKcsv
M = 8 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
22
Slide 43MG3700A-J-F-11
8PSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 44MG3700A-J-F-11
16QAM
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=16QAMcsv
M = 16 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
23
Slide 45MG3700A-J-F-11
16QAM
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 46MG3700A-J-F-11
Simulinkbull Simulinkとは
raquo Simulinkregはダイナミックシステムのモデル化シミュレーション解析を行
うためのソフトウェアパッケージです連続時間サンプリングした時間または混在のハイブリッドにおいてモデル化された線形や非線形システムをサポートします
bull シミュレーション用ツールraquo 簡単にゼロからモデルを構築できあるいは既存のモデルを取得し追加で
きますMATLAB内のすべての分析ツールに素早くアクセスし結果を取得
し分析および視覚化できます
bull モデルベースデザイン用ツールraquo モデル化ではSimulinkはドラッグampドロップマウス操作を使用してブロッ
クダイヤグラムのようなモデルを構築するためのGUIを提供します自分の
ブロックをカスタマイズし生成することもできますraquo モデルは階層的でトップダウンとボトムアップの両方のアプローチを用いて
構築できますraquo モデルの定義後シミュレートできますシミュレーション結果は後処理と視
覚化のためにMATLABワークスペースに入れることができますCSV file
Simulinkに関する詳細についてはサイバネットシステム(株)ウェブサイトを参照してくださいhttpdlcybernetcojpmatlabsupportmanualr2006toolboxsimulinkindexshtml
24
Slide 47MG3700A-J-F-11
Simulink デモ
bull Simulinkデモは役に立つモデル化コンセプトを図解しますMATLAB Command Windowからデモにアクセスできます
Slide 48MG3700A-J-F-11
Simulink Blockset デモ
bull Blocksetは特定分野での設計やシミュレーションのために設計された専門Simulinkブロックの集まりです
bull 例えば Communications Blocksetは通信システムやコンポーネントのフィジカルレイヤを設計しシミュレートするために Simulinkのブロックの包括的ライブラリを拡張しますBlocksetは通信システムや半導体コン
ポーネント例えば商業か防衛のワイヤレスか有線システムなどを設計するのに役立ちます
Communications Blockset内のブロックを用い適応変調を含んだIEEE 80211a WLANスタンダードのフィジカルレイヤのモデル
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
18
Slide 35MG3700A-J-F-11
PSK QAM
bull デジタル変調スキームは一定時間ごとにキャリアの振幅周波数および位相を変更しデジタルベースバンド信号を送ります
raquo アナログ変調スキームはキャリアの振幅周波数および位相を連続的に変更します
基本的なデジタル変調スキームraquo 振幅シフトキーイング (ASK)
ndash キャリアの振幅がシンボル系列で線形に変化する
raquo 周波数シフトキーイング (FSK)ndash キャリアの周波数がシンボル系列で線形に変化する
raquo 位相シフトキーイング (PSK)ディファレンシャル位相シフトキーイング (DPSK)
ndash キャリアの位相がシンボル系列で線形に変化する
raquo 直交振幅変調 (QAM)ndash キャリアの振幅と位相がシンボル系列で線形に変化する
1 10
Slide 36MG3700A-J-F-11
PSK QAM
bull 本章ではQPSKπ4DQPSK8PSK16QAMの一般例を示します
I
Q
00
Ac-Ac
-Ac
Ac
QPSK
01
10
11
I
Q
Ac-Ac
-Ac
Ac
π4DQPSK
00
01 1011
IAc-Ac
-Ac
Ac
000
001
010
011
Q
100
101
110
111
IAc-Ac-Ac
Ac
0000
0001
0010
0011
Q
1100
1101
1110
1111
8PSK 16QAM
0101
0100
0111
0110
10101000
10111001
3Ac-3Ac
3Ac
-3Ac
19
Slide 37MG3700A-J-F-11
QPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=QPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) Initial phase
pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
Slide 38MG3700A-J-F-11
QPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 round(min(real(g))) round(max(real(g)))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 round(min(imag(g))) round(max(imag(g)))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
20
Slide 39MG3700A-J-F-11
波形位相連続
bull MG3700Aは有限長の波形を再生し絶え間なくリピートします波形の最後と次のリ
ピートの最初との間の位相不連続は周期的なスペクトルリグロースやひずみに至ります
bull 急な位相変化でのリピートは高周波スペクトルリグロースをもたらします
Pd = 16 symbol points波形 ではシンボルデータ長 複製シンボルデータ
波形長
Slide 40MG3700A-J-F-11
π4DQPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=pi4DQPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = dpskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) using phase
shift pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
21
Slide 41MG3700A-J-F-11
π4DQPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 42MG3700A-J-F-11
8PSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=8PSKcsv
M = 8 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
22
Slide 43MG3700A-J-F-11
8PSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 44MG3700A-J-F-11
16QAM
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=16QAMcsv
M = 16 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
23
Slide 45MG3700A-J-F-11
16QAM
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 46MG3700A-J-F-11
Simulinkbull Simulinkとは
raquo Simulinkregはダイナミックシステムのモデル化シミュレーション解析を行
うためのソフトウェアパッケージです連続時間サンプリングした時間または混在のハイブリッドにおいてモデル化された線形や非線形システムをサポートします
bull シミュレーション用ツールraquo 簡単にゼロからモデルを構築できあるいは既存のモデルを取得し追加で
きますMATLAB内のすべての分析ツールに素早くアクセスし結果を取得
し分析および視覚化できます
bull モデルベースデザイン用ツールraquo モデル化ではSimulinkはドラッグampドロップマウス操作を使用してブロッ
クダイヤグラムのようなモデルを構築するためのGUIを提供します自分の
ブロックをカスタマイズし生成することもできますraquo モデルは階層的でトップダウンとボトムアップの両方のアプローチを用いて
構築できますraquo モデルの定義後シミュレートできますシミュレーション結果は後処理と視
覚化のためにMATLABワークスペースに入れることができますCSV file
Simulinkに関する詳細についてはサイバネットシステム(株)ウェブサイトを参照してくださいhttpdlcybernetcojpmatlabsupportmanualr2006toolboxsimulinkindexshtml
24
Slide 47MG3700A-J-F-11
Simulink デモ
bull Simulinkデモは役に立つモデル化コンセプトを図解しますMATLAB Command Windowからデモにアクセスできます
Slide 48MG3700A-J-F-11
Simulink Blockset デモ
bull Blocksetは特定分野での設計やシミュレーションのために設計された専門Simulinkブロックの集まりです
bull 例えば Communications Blocksetは通信システムやコンポーネントのフィジカルレイヤを設計しシミュレートするために Simulinkのブロックの包括的ライブラリを拡張しますBlocksetは通信システムや半導体コン
ポーネント例えば商業か防衛のワイヤレスか有線システムなどを設計するのに役立ちます
Communications Blockset内のブロックを用い適応変調を含んだIEEE 80211a WLANスタンダードのフィジカルレイヤのモデル
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
19
Slide 37MG3700A-J-F-11
QPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=QPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) Initial phase
pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
Slide 38MG3700A-J-F-11
QPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 round(min(real(g))) round(max(real(g)))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 round(min(imag(g))) round(max(imag(g)))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
20
Slide 39MG3700A-J-F-11
波形位相連続
bull MG3700Aは有限長の波形を再生し絶え間なくリピートします波形の最後と次のリ
ピートの最初との間の位相不連続は周期的なスペクトルリグロースやひずみに至ります
bull 急な位相変化でのリピートは高周波スペクトルリグロースをもたらします
Pd = 16 symbol points波形 ではシンボルデータ長 複製シンボルデータ
波形長
Slide 40MG3700A-J-F-11
π4DQPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=pi4DQPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = dpskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) using phase
shift pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
21
Slide 41MG3700A-J-F-11
π4DQPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 42MG3700A-J-F-11
8PSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=8PSKcsv
M = 8 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
22
Slide 43MG3700A-J-F-11
8PSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 44MG3700A-J-F-11
16QAM
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=16QAMcsv
M = 16 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
23
Slide 45MG3700A-J-F-11
16QAM
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 46MG3700A-J-F-11
Simulinkbull Simulinkとは
raquo Simulinkregはダイナミックシステムのモデル化シミュレーション解析を行
うためのソフトウェアパッケージです連続時間サンプリングした時間または混在のハイブリッドにおいてモデル化された線形や非線形システムをサポートします
bull シミュレーション用ツールraquo 簡単にゼロからモデルを構築できあるいは既存のモデルを取得し追加で
きますMATLAB内のすべての分析ツールに素早くアクセスし結果を取得
し分析および視覚化できます
bull モデルベースデザイン用ツールraquo モデル化ではSimulinkはドラッグampドロップマウス操作を使用してブロッ
クダイヤグラムのようなモデルを構築するためのGUIを提供します自分の
ブロックをカスタマイズし生成することもできますraquo モデルは階層的でトップダウンとボトムアップの両方のアプローチを用いて
構築できますraquo モデルの定義後シミュレートできますシミュレーション結果は後処理と視
覚化のためにMATLABワークスペースに入れることができますCSV file
Simulinkに関する詳細についてはサイバネットシステム(株)ウェブサイトを参照してくださいhttpdlcybernetcojpmatlabsupportmanualr2006toolboxsimulinkindexshtml
24
Slide 47MG3700A-J-F-11
Simulink デモ
bull Simulinkデモは役に立つモデル化コンセプトを図解しますMATLAB Command Windowからデモにアクセスできます
Slide 48MG3700A-J-F-11
Simulink Blockset デモ
bull Blocksetは特定分野での設計やシミュレーションのために設計された専門Simulinkブロックの集まりです
bull 例えば Communications Blocksetは通信システムやコンポーネントのフィジカルレイヤを設計しシミュレートするために Simulinkのブロックの包括的ライブラリを拡張しますBlocksetは通信システムや半導体コン
ポーネント例えば商業か防衛のワイヤレスか有線システムなどを設計するのに役立ちます
Communications Blockset内のブロックを用い適応変調を含んだIEEE 80211a WLANスタンダードのフィジカルレイヤのモデル
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
20
Slide 39MG3700A-J-F-11
波形位相連続
bull MG3700Aは有限長の波形を再生し絶え間なくリピートします波形の最後と次のリ
ピートの最初との間の位相不連続は周期的なスペクトルリグロースやひずみに至ります
bull 急な位相変化でのリピートは高周波スペクトルリグロースをもたらします
Pd = 16 symbol points波形 ではシンボルデータ長 複製シンボルデータ
波形長
Slide 40MG3700A-J-F-11
π4DQPSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=pi4DQPSKcsv
M = 4 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = dpskmod(DuplicateSymbolDataMpi4) Complex envelop g(t) using phase
shift pi4 rad [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
21
Slide 41MG3700A-J-F-11
π4DQPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 42MG3700A-J-F-11
8PSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=8PSKcsv
M = 8 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
22
Slide 43MG3700A-J-F-11
8PSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 44MG3700A-J-F-11
16QAM
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=16QAMcsv
M = 16 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
23
Slide 45MG3700A-J-F-11
16QAM
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 46MG3700A-J-F-11
Simulinkbull Simulinkとは
raquo Simulinkregはダイナミックシステムのモデル化シミュレーション解析を行
うためのソフトウェアパッケージです連続時間サンプリングした時間または混在のハイブリッドにおいてモデル化された線形や非線形システムをサポートします
bull シミュレーション用ツールraquo 簡単にゼロからモデルを構築できあるいは既存のモデルを取得し追加で
きますMATLAB内のすべての分析ツールに素早くアクセスし結果を取得
し分析および視覚化できます
bull モデルベースデザイン用ツールraquo モデル化ではSimulinkはドラッグampドロップマウス操作を使用してブロッ
クダイヤグラムのようなモデルを構築するためのGUIを提供します自分の
ブロックをカスタマイズし生成することもできますraquo モデルは階層的でトップダウンとボトムアップの両方のアプローチを用いて
構築できますraquo モデルの定義後シミュレートできますシミュレーション結果は後処理と視
覚化のためにMATLABワークスペースに入れることができますCSV file
Simulinkに関する詳細についてはサイバネットシステム(株)ウェブサイトを参照してくださいhttpdlcybernetcojpmatlabsupportmanualr2006toolboxsimulinkindexshtml
24
Slide 47MG3700A-J-F-11
Simulink デモ
bull Simulinkデモは役に立つモデル化コンセプトを図解しますMATLAB Command Windowからデモにアクセスできます
Slide 48MG3700A-J-F-11
Simulink Blockset デモ
bull Blocksetは特定分野での設計やシミュレーションのために設計された専門Simulinkブロックの集まりです
bull 例えば Communications Blocksetは通信システムやコンポーネントのフィジカルレイヤを設計しシミュレートするために Simulinkのブロックの包括的ライブラリを拡張しますBlocksetは通信システムや半導体コン
ポーネント例えば商業か防衛のワイヤレスか有線システムなどを設計するのに役立ちます
Communications Blockset内のブロックを用い適応変調を含んだIEEE 80211a WLANスタンダードのフィジカルレイヤのモデル
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
21
Slide 41MG3700A-J-F-11
π4DQPSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 42MG3700A-J-F-11
8PSK
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=8PSKcsv
M = 8 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
22
Slide 43MG3700A-J-F-11
8PSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 44MG3700A-J-F-11
16QAM
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=16QAMcsv
M = 16 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
23
Slide 45MG3700A-J-F-11
16QAM
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 46MG3700A-J-F-11
Simulinkbull Simulinkとは
raquo Simulinkregはダイナミックシステムのモデル化シミュレーション解析を行
うためのソフトウェアパッケージです連続時間サンプリングした時間または混在のハイブリッドにおいてモデル化された線形や非線形システムをサポートします
bull シミュレーション用ツールraquo 簡単にゼロからモデルを構築できあるいは既存のモデルを取得し追加で
きますMATLAB内のすべての分析ツールに素早くアクセスし結果を取得
し分析および視覚化できます
bull モデルベースデザイン用ツールraquo モデル化ではSimulinkはドラッグampドロップマウス操作を使用してブロッ
クダイヤグラムのようなモデルを構築するためのGUIを提供します自分の
ブロックをカスタマイズし生成することもできますraquo モデルは階層的でトップダウンとボトムアップの両方のアプローチを用いて
構築できますraquo モデルの定義後シミュレートできますシミュレーション結果は後処理と視
覚化のためにMATLABワークスペースに入れることができますCSV file
Simulinkに関する詳細についてはサイバネットシステム(株)ウェブサイトを参照してくださいhttpdlcybernetcojpmatlabsupportmanualr2006toolboxsimulinkindexshtml
24
Slide 47MG3700A-J-F-11
Simulink デモ
bull Simulinkデモは役に立つモデル化コンセプトを図解しますMATLAB Command Windowからデモにアクセスできます
Slide 48MG3700A-J-F-11
Simulink Blockset デモ
bull Blocksetは特定分野での設計やシミュレーションのために設計された専門Simulinkブロックの集まりです
bull 例えば Communications Blocksetは通信システムやコンポーネントのフィジカルレイヤを設計しシミュレートするために Simulinkのブロックの包括的ライブラリを拡張しますBlocksetは通信システムや半導体コン
ポーネント例えば商業か防衛のワイヤレスか有線システムなどを設計するのに役立ちます
Communications Blockset内のブロックを用い適応変調を含んだIEEE 80211a WLANスタンダードのフィジカルレイヤのモデル
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
22
Slide 43MG3700A-J-F-11
8PSK
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 44MG3700A-J-F-11
16QAM
複素包絡線bull g(t) = Ac[m1(t)+jm2(t)] = I(t)+jQ(t)
bull Ac キャリア信号振幅 = 1
clear all close all clc
Fd = 1 Symbol rate [sps]Fs = 10Fd Oversampling ratePd = 256 Symbol pointsrepetition = 2 Repetition factor of dataR = 05 Rolloff factor for FIR filterdelay = 3 Filters group delayCSVfile=16QAMcsv
M = 16 Point signal constellationsSymbolData = randint(Pd1M) Random data [Communications Toolbox] Duplicate the symbol data because of waveform phase continuityDuplicateSymbolData = repmat(SymbolDatarepetition1) Replicate the symbol
data [Fixed-Point Toolbox]g = pskmod(DuplicateSymbolDataM) Complex envelop g(t) [Communications Toolbox]
(次ページにつづく)
MATLABが必要とするSignal Processing ToolboxCommunications Toolbox
23
Slide 45MG3700A-J-F-11
16QAM
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 46MG3700A-J-F-11
Simulinkbull Simulinkとは
raquo Simulinkregはダイナミックシステムのモデル化シミュレーション解析を行
うためのソフトウェアパッケージです連続時間サンプリングした時間または混在のハイブリッドにおいてモデル化された線形や非線形システムをサポートします
bull シミュレーション用ツールraquo 簡単にゼロからモデルを構築できあるいは既存のモデルを取得し追加で
きますMATLAB内のすべての分析ツールに素早くアクセスし結果を取得
し分析および視覚化できます
bull モデルベースデザイン用ツールraquo モデル化ではSimulinkはドラッグampドロップマウス操作を使用してブロッ
クダイヤグラムのようなモデルを構築するためのGUIを提供します自分の
ブロックをカスタマイズし生成することもできますraquo モデルは階層的でトップダウンとボトムアップの両方のアプローチを用いて
構築できますraquo モデルの定義後シミュレートできますシミュレーション結果は後処理と視
覚化のためにMATLABワークスペースに入れることができますCSV file
Simulinkに関する詳細についてはサイバネットシステム(株)ウェブサイトを参照してくださいhttpdlcybernetcojpmatlabsupportmanualr2006toolboxsimulinkindexshtml
24
Slide 47MG3700A-J-F-11
Simulink デモ
bull Simulinkデモは役に立つモデル化コンセプトを図解しますMATLAB Command Windowからデモにアクセスできます
Slide 48MG3700A-J-F-11
Simulink Blockset デモ
bull Blocksetは特定分野での設計やシミュレーションのために設計された専門Simulinkブロックの集まりです
bull 例えば Communications Blocksetは通信システムやコンポーネントのフィジカルレイヤを設計しシミュレートするために Simulinkのブロックの包括的ライブラリを拡張しますBlocksetは通信システムや半導体コン
ポーネント例えば商業か防衛のワイヤレスか有線システムなどを設計するのに役立ちます
Communications Blockset内のブロックを用い適応変調を含んだIEEE 80211a WLANスタンダードのフィジカルレイヤのモデル
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
23
Slide 45MG3700A-J-F-11
16QAM
(前ページからつづく)
filtering = rcosflt(gFdFsfirnormalRdelay) Filter input signal using FIR filter [Communications Toolbox]
OversampledData = filtering(Fsdelay2+1Fsdelay2+FsPd) Correct filter delaydata = [real(OversampledData) imag(OversampledData)] IQ datacsvwrite(CSVfiledata)
scatterplot(OversampledData10b-)hold onplot(gr)grid Signal constellation
figure Complex envelopt_g = 0Pdrepetition-1 g(t) symbol numbert_o = delayFdFsdelay+Pd-1Fs Oversampled symbol numbersubplot(211)stem(t_greal(g)r)hold onplot(t_oreal(OversampledData))grid In-phaseaxis([-1 Pdrepetition+1 min(real(OversampledData)) max(real(OversampledData))])title(I signal)xlabel(Symbol)ylabel(Amplitude)subplot(212)stem(t_gimag(g)r)hold onplot(t_oimag(OversampledData))grid
Quadrature-phaseaxis([-1 Pdrepetition+1 min(imag(OversampledData)) max(imag(OversampledData))])title(Q signal)xlabel(Symbol)ylabel(Amplitude)
Slide 46MG3700A-J-F-11
Simulinkbull Simulinkとは
raquo Simulinkregはダイナミックシステムのモデル化シミュレーション解析を行
うためのソフトウェアパッケージです連続時間サンプリングした時間または混在のハイブリッドにおいてモデル化された線形や非線形システムをサポートします
bull シミュレーション用ツールraquo 簡単にゼロからモデルを構築できあるいは既存のモデルを取得し追加で
きますMATLAB内のすべての分析ツールに素早くアクセスし結果を取得
し分析および視覚化できます
bull モデルベースデザイン用ツールraquo モデル化ではSimulinkはドラッグampドロップマウス操作を使用してブロッ
クダイヤグラムのようなモデルを構築するためのGUIを提供します自分の
ブロックをカスタマイズし生成することもできますraquo モデルは階層的でトップダウンとボトムアップの両方のアプローチを用いて
構築できますraquo モデルの定義後シミュレートできますシミュレーション結果は後処理と視
覚化のためにMATLABワークスペースに入れることができますCSV file
Simulinkに関する詳細についてはサイバネットシステム(株)ウェブサイトを参照してくださいhttpdlcybernetcojpmatlabsupportmanualr2006toolboxsimulinkindexshtml
24
Slide 47MG3700A-J-F-11
Simulink デモ
bull Simulinkデモは役に立つモデル化コンセプトを図解しますMATLAB Command Windowからデモにアクセスできます
Slide 48MG3700A-J-F-11
Simulink Blockset デモ
bull Blocksetは特定分野での設計やシミュレーションのために設計された専門Simulinkブロックの集まりです
bull 例えば Communications Blocksetは通信システムやコンポーネントのフィジカルレイヤを設計しシミュレートするために Simulinkのブロックの包括的ライブラリを拡張しますBlocksetは通信システムや半導体コン
ポーネント例えば商業か防衛のワイヤレスか有線システムなどを設計するのに役立ちます
Communications Blockset内のブロックを用い適応変調を含んだIEEE 80211a WLANスタンダードのフィジカルレイヤのモデル
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
24
Slide 47MG3700A-J-F-11
Simulink デモ
bull Simulinkデモは役に立つモデル化コンセプトを図解しますMATLAB Command Windowからデモにアクセスできます
Slide 48MG3700A-J-F-11
Simulink Blockset デモ
bull Blocksetは特定分野での設計やシミュレーションのために設計された専門Simulinkブロックの集まりです
bull 例えば Communications Blocksetは通信システムやコンポーネントのフィジカルレイヤを設計しシミュレートするために Simulinkのブロックの包括的ライブラリを拡張しますBlocksetは通信システムや半導体コン
ポーネント例えば商業か防衛のワイヤレスか有線システムなどを設計するのに役立ちます
Communications Blockset内のブロックを用い適応変調を含んだIEEE 80211a WLANスタンダードのフィジカルレイヤのモデル
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
25
Slide 49MG3700A-J-F-11
シミュレーションデータ セーブテクニック
bull Simulink Library Browserraquo Math Operationsライブラリは一般の数学関数をモデル化するブロックを
含んでいますraquo Sinksライブラリはブロック出力を表示あるいは書き出すブロックを含んで
います
ライブラリ
ブロック
ブロック
Slide 50MG3700A-J-F-11
Complex to Real-Imag
bull 複素数入力信号の実数部と虚数部を出力ndash Complex to Real-Imag ブロックは固定小数点データタイプも含めSimulinkによってサポー
トされる任意のデータタイプの複素数信号を受け入れます出力 パラメータの設定に応じて入力信号の実数部およびまたは虚数部を出力します実数出力は複素数入力と同じデータタイプです入力として複素数信号の配列(ベクトルまたは行列)を使用することができその場合は出力信号も同じ次元の配列になります実数配列は対応する複素数入力要素の実数部を含みます同様に虚数出力は入力要素の虚数部を含みます
I Q
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
26
Slide 51MG3700A-J-F-11
Complex to Real-Imag
bull パラメータraquo 出力
ndash このブロックの出力を決めますReal and imag (入力信号の実数部と虚数部を出力)Real (入力の実数部を出力)Imag (入力の虚数部を出力)のいずれかの値を選択します
raquo サンプル時間 (継承は -1)ndash サンプルの時間間隔を指定しますサンプル時間を継承するにはこのパラメータを -1 に設定
します-1ndash ブロックがtriggeredサブシステムにない場合この設定ではブロックがそのサンプル
時間を入力に接続されたブロックから(inheritance)かまたは場合によっては出力に接続されたブロックから(back inheritance)継承するように指定します ブロックがtriggeredサブシステムにある場合SampleTimeパラメータの設定をこの設定にしてくださいソースブロックに対してサンプル時間の継承を指定するとソースが1つ以上のブロックを駆動する場合にSimulinkが不適当なサンプル時間をブロックに割り当てる原因になるので注意してくださいそのためソースブロックに対してサンプル時間の継承を指定しないようにしてください指定した場合Simulinkはモデルを更新したりシミュレーションするときにワーニングメッセージを表示します
Slide 52MG3700A-J-F-11
To Workspace
bull データをワークスペースに書き出すndash To Workspace ブロックは入力データをワークスペースに書き出しますブロックはその出
力を 変数名 パラメータで設定した名前をもつ行列または構造体にその出力を書き出します保存フォーマット パラメータは出力フォーマットを決定します
配列
I または Q
inf 正の無限大を示すIEEE算術表現
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
27
Slide 53MG3700A-J-F-11
To Workspace
raquo 配列ndash このオプションを選択してTo Workspace ブロックでN-次元配列として入力を保存しますNは
入力信号の次元数よりも1大きい数値ですたとえば入力信号が1-D(ベクトル)配列の場合結果のワークスペース配列は二次元になります入力信号が2-D配列(行列)の場合ワークスペース配列は三次元になります
ndash サンプルが配列に格納される方法は入力信号がスカラベクトルまたは行列であるかに応じて異なります入力がスカラまたはベクトルの場合各入力サンプルは配列の行として出力されますたとえば出力配列の名前が simout であるとしますsimout(1) は最初のサンプルにsimout(2) は2番目のサンプルに対応するというように対応します入力信号が行列の場合ワークスペース配列の3番目の次元は指定されたサンプリング点での入力信号の値に対応しますたとえばsimout が結果のワークスペース配列の名前であることをもう一度思い出してくださいsimout(1) は最初のサンプル点での入力信号の値ですsimout(2) は2番目のサンプル点での入力信号の値です
ndash 書き出されるデータの量とデータが書き出される時間ステップはブロックパラメータによって決まります
1 データ点の制限 パラメータは保存されるサンプル点の数を示しますシミュレーションで指定された最大値以上にデータ点が生成された場合シミュレーションは最近生成されたサンプルだけを保存しますデータをすべて収集するためにはinf にを設定します
2 間引きファクタ パラメータを用いるとn番目のサンプルごとにデータを書き出すことができますn は間引きファクタですデフォルトの間引きは1ですべての時間ステップ毎にデータを書き出します
3 サンプル時間 パラメータではデータ点を収集するサンプリング間隔を指定することができますこのパラメータは時間ステップの間隔が同じでない可変ステップソルバを使用する場合に有効ですデフォルト値は -1 でその場合はどの点を書き出すかを決定する際に接続ブロックからサンプル時間を継承します
Slide 54MG3700A-J-F-11
To Workspace
ndash 可変ステップ ソルバではコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックスの データのインポートエクスポート 枠上で見られる 出力オプションがTo Workspace ブロックに利用できるオリジナルデータ量を決定しますたとえば複数のシミュレーション上の同一時間ポイントでデータが書き出されることを確実にする必要があればコンフィギュレーションパラメータ(Configuration Parameters)ダイアログボックス内の 指定出力のみ生成 を選択し望む時間のベクトルを入力しますTo Workspace ブロックは指定時間のベクトルで始まりそのブロックパラメータに基づいたワークスペースに書き出されるデータ量を制限します
ndash シミュレーション中ブロックは内部バッファにデータを書き出しますシミュレーションが完了するかまたは一時停止した場合そのデータはワークスペースに書き出されますブロックアイコンはデータが書き出される配列名を表示します
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
28
Slide 55MG3700A-J-F-11
To Workspace
bull パラメータraquo 変数名
ndash データを保持する配列名
raquo データ点の制限ndash 保存される入力サンプルの最大数デフォルトは inf
raquo 間引きファクタndash デフォルトは 1
raquo サンプル時間ndash データ点を収集するサンプル時間
raquo 保存フォーマットndash ワークスペースに保存するシミュレーション出力のフォーマットデフォルトは 構造体
raquo 固定小数点データを fi オブジェクトとして記録ndash このオプションを選択してSimulink Fixed-Point fi オブジェクトとして固定小数点データを
MATLABワークスペースにログしますそうでない場合固定小数点データは double タイプと
してワークスペースにログされます
Slide 56MG3700A-J-F-11
シミュレーションデータ セーブ例1
bull 完成モデルをオープンbull Communications Blockset ヘルプgt Examples in Documentationgt Digital Modulationgt DQPSK Signal Constellation Points and Transitions
ndash open(MATLAB701helptoolboxcommblkscommblks_examplesdoc_dqpsk_plotmdl)
bull モデルはDQPSK変調器ベースバンドブロックの出力をプロットしますイメージはDQPSK信号コンスタレーションで各シンボルから次のシンボルま
での遷移を示します
ndash モデルの実行はプロットを作り出しますプロットは8DQPSKコンスタレーションポイント間の遷移を映します
ndash DQPSK変調器ベースバンドブロックのデフォルト 位相オフセット パラメータが pi4 なのでプロットはπ4DQPSK変調を図解します
I
Q
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
29
Slide 57MG3700A-J-F-11
Communications Blockset 例の編集
ドラッグampドロップ
配列
I or Q
シミュレーションをスタート
Slide 58MG3700A-J-F-11
注記
bull MG3700AがこのIQ信号を発生する場合レイズドコサインFIRフィルタブ
ロックがモデルに追加されなければなりませんbull レイズドコサインFIRフィルタブロックに関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksrefraisedcosinetransmitfilterhtml
ndash レイズドコサインFIRフィルタを用いて入力信号をアップサンプルしフィルタリングする
ドラッグampドロップ
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
30
Slide 59MG3700A-J-F-11
シミュレーションデータ セーブ例2
bull 完成モデルをオープンbull Communications Blockset デモgt Channel Models and Impairmentsgt Rayleigh Fading Channelbull チャネル(channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommblksugfp62122htmlbull 一般的にフェージングチャネル(fading channels)に関する詳細について
httpwwwmathworkscomaccesshelpdeskhelptoolboxcommuga1069449399html
bull モデルはQPSK変調信号へのチャネルの作用を図解します
ndash モデルの実行はプロットを作り出しますプロットはQPSKコンスタレーションポイントへのチャネルの作用を映します
Slide 60MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
31
Slide 61MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
8 OSR
軌跡
シミュレーションをスタート
Slide 62MG3700A-J-F-11
シミュレーションデータ セーブ例3
bull 完成モデルをオープンbull Communications Blockset デモgt Application-Specific Examplesgt IEEE 80211a WLAN Physical Layer
bull 適応変調およびコーディングをデモする IEEE 80211ag WLAN OFDM フィジカルレイヤモデル
ndash 必要条件 Communications Toolbox Communications Blockset Signal Processing Blockset Signal Processing Toolbox
ndash エンドツーエンド 80211a フィジカルレイヤndash すべての必須およびオプションのデータレート 6 9 12 18 24 36 48 and 54 Mbsndash BPSK QPSK 16QAM 64QAM 変調ndash フォワードエラー訂正(FEC)コーディング (畳み込み(convolutional) コードレート 12 23 34)ndash OFDM 送信 52 サブキャリア 4 パイロット 64-pt FFTs CP (Cyclic Prefix)ndash データインタリービングndash PLCP プリアンブル (2x2 ロングトレーニングシーケンスとしてモデル化)ndash レシーバ等化 (equalization)ndash ビタビデコーディング (Viterbi decoding)ndash オンザフライでデータレート選択可能ndash 分散マルチパスフェージングチャネル上の適応変調デモ
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
32
Slide 63MG3700A-J-F-11
Communications Blockset デモ
ndash モデルの実行と Signal Visualization (信号の視覚化)ブロックのダブルクリックはプロットを作り出します
信号の視覚化
TX Data
RX power spectrum
Unequalized signal
Equalized power spectrum
SNR Bit rate
BER (per packet)
Slide 64MG3700A-J-F-11
Communications Blockset デモ
NRZ(Non-Return to Zero)
この場合PER = 150 (2 )
この場合16QAM
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
33
Slide 65MG3700A-J-F-11
Communications Blockset デモの編集
ドラッグampドロップ
ドラッグampドロップ
Slide 66MG3700A-J-F-11
Communications Blockset デモの編集
配列
I or Q
シミュレーションをスタート
測定パワースペクトラム
IQプロデューサのConvert
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
34
Slide 67MG3700A-J-F-11
ワークスペースデータセーブ
bull CSVファイルへワークスペース変数を保存するためにMATLABコマンドウィンドウに下記を入力することでコマンドを実行できます
raquo data=[I Q]raquo csvwrite(IQdatacsvdata)
ndash ワークスペースはMATLABセッション中にメモリに格納された変数(配列)セットです
ワークスペース変数
メモリ ファイル
CSVテキスト
data IQdatacsv
Slide 68MG3700A-J-F-11
IQプロデューサを用いずIQデータファイルを変換し転送するプログラミング例
bull MG3700AへIQデータをダウンロードするためにMATLAB(シミュレーションソフトウェア)やC++(高度なプログラミング言語)がCSVファイルへデータを保存できるので通常はIQproducer内のConvertとTransfer amp Settingを使いやすい
bull テキストファイルは大容量なのでこのプロセスには時間がかかり面倒です
bull IQデータファイルを変換する時間を最小限にするためには特定のバイ
ナリデータファイルを生成してくださいbull このセクションはMATLAB環境内から複素データ配列のダウンロードを
手助けする方法を検討します
1 GUIDEでGUIを生成2 [Convert] を実行3 [Transfer] と [Play] を実行
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
35
Slide 69MG3700A-J-F-11
GUIDEでGUIを生成
raquo MATLAB Graphical User Interface 開発環境 GUIDEはグラフィカルユーザインターフェース (GUI) を作成する一連のツールを提供しますこれらのツールによりGUIの設計と作成が非常に簡単になります
bull GUIのレイアウトndash GUIDEレイアウトエディタを使用するとGUIコンポーネント(パネルボタンテキストフィールド
スライダメニューなど)をクリックドラッグすることによりGUIをレイアウトエリアにレイアウトすることができますGUI用メニューやコンテキストメニューも生成できますGUIDEはFIG-ファイルへGUIレイアウトを保存します
bull GUIのプログラミングndash GUIDE はGUIの動作をコントロールするM-ファイルを自動的に作成しますM-ファイルは
GUIを初期化しまたGUIコンポーネントをクリックしたときに実行されるコマンドなどすべてのGUIコールバックに関する構造を含んでいますM-ファイルエディタを使用すると要求機能を実行するコールバックにコードを追加できます
bull GUIDEに関する詳細についてhttpwwwmathworkscomaccesshelpdeskhelptechdoccreating_guiscreating_guishtml
FIG-ファイル
Slide 70MG3700A-J-F-11
[Convert] を実行
プログラミングチャート
変換用パラメータファイルを生成
変換用データファイルを生成
WVI と WVD ファイルを生成
入力文字列
変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi データファイル wvdワークスペース変数
パラメータファイルとデータファイルを削除
ファイル
マーカI Q
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
36
Slide 71MG3700A-J-F-11
[Transfer] と [Play] を実行
プログラミングチャートndash [Transfer] FTPでMG3700A HDDへファイルを転送
ndash [Play] TCPIPリモートコントロールでベースバンドメモリへパターンデータをロー
ド
MG3700Aに接続しFTP オブジェクトを作成
MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
WVI と WVD ファイルをダウンロード
TCPIP オブジェクトを作成
ベースバンドメモリへパターンデータをロード
シグナルパターンを再生
Slide 72MG3700A-J-F-11
GUIDEでGUIを生成する例
bull GUIDEは convandtranstoolfig にGUIレイアウトをセーブしますbull GUIDEは convandtranstoolm を自動的に作成します
M-ファイル
function varargout = convandtranstool(varargin) CONVANDTRANSTOOL M-file for convandtranstoolfig CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing singleton H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to the existing singleton CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the existing singleton Starting from the left property value pairs are applied to the GUI before convandtranstool_OpeningFunction gets called An unrecognized property name or invalid value makes property application stop All inputs are passed to convandtranstool_OpeningFcn via varargin See GUI Options on GUIDEs Tools menu Choose GUI allows only one instance to run (singleton) See also GUIDE GUIDATA GUIHANDLES
Edit the above text to modify the response to help convandtranstool
FIG-ファイル
ファンクションM-ファイル
M i
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
37
Slide 73MG3700A-J-F-11
ファンクションM-ファイルをコール
ndash M-ファイルはスクリプトあるいはファンクションのいずれかですスクリプトは単にMATLABステートメントのシーケンスを含んでいるファイルですファンクションは自身のローカル変数を使用し入力引数を受付けます
ndash M-ファイルの最初の行で定義されたファンクション名はm 拡張子を除くファイル名と同じであるべきです
ndash ファンクション内の変数はすべてローカルの変数ですndash コマンドラインからまたは別のM-ファイル内からファンクションM-ファイル
をコールするときMATLABはファンクションをパーズ(構文解析)しメモリに格納しますクリアコマンドでクリアされるまでかMATLABを中止するまでパーズされたファンクションはメモリ内に残留します
I_Q = [real(OversampledData) imag(OversampledData)] IQ data
RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))I_Q = round(I_Q1634RMSvalue) To integer
marker1 = [ ones(101) zeros(length(I_Q)-101) ]marker2 = zeros(length(I_Q)1)marker3 = zeros(length(I_Q)1)gate = ones(length(I_Q)1) RF gate flagmarker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^0data = [I_Q marker_gate]
convandtranstool ファンクションM-ファイルをコール
前セクションの変数 data に等しい
小数を16ビット整数に変換
ワークスペース変数
Slide 74MG3700A-J-F-11
Convert プログラミング例
--- Executes on button press in pushbutton2function pushbutton2_Callback(hObject eventdata handles) hObject handle to pushbutton2 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull 変換用パラメータファイルを生成valname = get(handlesedit1 String)package = get(handlesedit9 String)patname = get(handlesedit2 String)samprate = get(handlesedit10 String)rmsval = get(handlesedit3 String)oversamp = get(handlesedit4 String)sysunit = get(handlesedit5 String)framelen = get(handlesedit11 String)if isempty(package)
package = Convert_IQproducerEnd
(次ページにつづく)
入力文字列を取得
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
38
Slide 75MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
fid = fopen(wave_infodat w)fprintf(fid [Wave Info]yenn)fprintf(fid Soft Type = MX3700yenn) If using for MG3700 fprintf(fid Soft Type = MX2690yenn) If using for MS2690fprintf(fid [Package = package yenn])fprintf(fid [Pattern Name = patname yenn])fprintf(fid [Sampling Rate = samprate Hzyenn])if ~isempty(oversamp)
fprintf(fid [Over Sampling = oversamp yenn])endif ~isempty(sysunit)
fprintf(fid [System Unit = sysunit yenn])endif ~isempty(framelen)
fprintf(fid [Frame Length = framelen yenn])endif ~isempty(rmsval)
fprintf(fid [WVI RMS Value = rmsval yenn])fprintf(fid [WVD RMS Value = rmsval yenn])
end
(次ページにつづく)
書き出しのためにファイルをオープンしたり新しいファイルを生成
Slide 76MG3700A-J-F-11
Convert プログラミング例
(前ページからつづく)
Define the following parameters in case of burst signalfprintf(fid [Rf Gate]yenn)fprintf(fid Rf On Off Threshold = 1yenn)fprintf(fid Min Rf Gate Length = 100samplesyenn)
fclose(fid) オープンファイルをクローズ
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
39
Slide 77MG3700A-J-F-11
Convert プログラミング例
bull 変換用データファイルを生成evalin(base fid_r = fopen(wave_rawdat w))evalin(base [fwrite(fid_r valname int16)])evalin(base fclose(fid_r))evalin(base clear fid_r)
bull WVI と WVD ファイルを生成MakeWvFile wave_infodat wave_rawdat
bull パラメータファイルとデータファイルを削除delete(wave_infodat)delete(wave_rawdat)
書き出しのためにファイルをオープンしたり新しいファイルを生成
16ビット整数のバイナリデータをファイルに書き出す
オープンファイルをクローズ
EXE ファイルを実行
ワークスペースからアイテムを削除システムメモリを開放
Slide 78MG3700A-J-F-11
WVI と WVD ファイルを生成 MakeWvFile
bull MakeWvFileexe アプリケーションソフトはアンリツが提供しますbull 特定のバイナリデータファイルからデータファイル(wvd)とファイルヘッダ
(wvi)を生成します
bull ファンクションリファレンスraquo 構文
ndash MakeWvFile ParameterFilename DataFilename
raquo 引数ndash ldquoParameterFilenamerdquo ファイルヘッダ(wvi)用テキストファイル名ndash ldquoDataFilenamerdquo データファイル(wvd)用特定のバイナリデータファイル名
MakeWvFile変換用パラメータテキストファイル
変換用データバイナリファイル
ファイルヘッダ wvi
データファイル wvd
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
40
Slide 79MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
bull [Wave Info]raquo Soft Type
bull MX3700MG3700A用
bull MX2690MS2690A-20 (VSGオプション)用ndash パラメータが省略された場合MX3700 が設定されます
raquo Packagendash パターンファイル用フォルダ名
bull le 30 文字ndash パラメータが省略された場合Convert_IQproducer が設定されます
raquo Pattern Namebull le 20 文字
raquo Sampling Ratendash 毎秒あたりのIQ波形サンプル数 (Hzで表されサンプリング間隔の逆数に等しい)
bull 20000 sim 160000000Hz (20 kHz sim 160 MHz)分解能 0001 Hz
raquo Over Samplingndash オーバサンプリング比 (OSR) サンプリングレート変調レート
bull 1 sim 999ndash パラメータが省略された場合1 が設定されます
Slide 80MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo System Unitndash 変調レートのための変調ポイント (チップシンボルサンプル)
bull le 6 文字ndash パラメータが省略された場合None が設定されます
raquo Frame Lengthndash フレームサンプル長
bull 1 sim 8388607ndash パラメータが省略された場合入力フレームトリガと Gap Length を使用できません
raquo WVI RMS Valuendash SG出力レベルに適合するIQ DAC振幅
bull 1 sim 8191注 Soft Type = MX2690の場合1157 を設定しますndash パラメータが省略された場合データファイルから計算されたRMSIQが設定されます
raquo WVD RMS Valuendash データファイルのIQ振幅の調整用RMSIQ
bull 1 sim 8191ndash パラメータが省略された場合データファイルのIQ振幅が変更されません
n RFゲートフラグアクティブ(On)のデータ
N
QIRMS
N
nnn
QI 2
)(1
22
sum=
+=
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
41
Slide 81MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
raquo Marker1raquo Marker2raquo Marker3
ndash MG3700A(あるいはMS2690A)ディスプレイに表示されるエベントマーカ名bull le 31 characters
ndash パラメータが省略された場合MG3700A(あるいはMS2690A)ディスプレイに表示されません
Slide 82MG3700A-J-F-11
MakeWvFile用パラメータテキストファイル
RF Gate 使用はバースト信号内のIQデータをスケールするためにRFゲートフラグを最適化しますバースト信号ではない場合これらのパラメータを省くことができます
bull [RF Gate]raquo Rf On Off Threshold
ndash 無信号の自動検出およびRFゲートフラグのアクティブインアクティブ(OnOff)定義のためのしきい値
bull 0 sim 100100基準レベル ピークndash パラメータが省略された場合RFゲートフラグが変更されません
raquo Min Rf Gate Lengthndash 無信号の自動検出およびRFゲートフラグのインアクティブ(Off)定義のための最
小連続サンプルbull 0 sim 100000 samples
ndash パラメータが省略された場合RFゲートフラグが変更されません
22nn QI +
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
42
Slide 83MG3700A-J-F-11
RF Gate パラメータndash 青線
bull RF Gateしたデータ(wvd)ndash RMSIQ (0 dB) はバースト
IQデータから計算されます
ndash 赤線bull RF Gateしないデータ(wvd)
ndash RMSIQ (0 dB) は全IQデータから計算されます
ピークレベル(+129892 dB)
Rf On Off Threshold1 (-40 dB)
Crest Factor129892 dB
RFゲートフラグ
Min Rf Gate Lengthge 100 samples
Slide 84MG3700A-J-F-11
MakeWvFile用データバイナリファイル
bull 特定のバイナリデータフォーマットraquo 各データポイントは6バイトを必要としますIポイントに2バイトQポイントに2
バイト 3イベントマーカに1バイトRFゲートフラグに1バイト
MakeWvFile変換用データバイナリファイル データファイル wvd
4 バイトポイント6 バイトポイント
RFゲートフラグ1バイト
I2バイト
Q2バイト
3イベントマーカ1バイト
16ビット符合付き整数 16ビット符合付き整数 0000 00010000 0111
0000 00000000 0000
ポイント
1
2
3
1 アクティブ(On)
0 インアクティブ(Off)
第1ビット マーカ1第2ビット マーカ2第3ビット マーカ3
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
43
Slide 85MG3700A-J-F-11
MakeWvFile用データバイナリファイル
raquo IQバイナリデータは符号付き整数を表わす16ビットの2の補数ですIQデータレンジ バイナリデータ 16進データ IQ出力電圧
ndash 32767 01111111 11111111 7FFF Vmaxndash 1 00000000 00000001 0001ndash 0 00000000 00000000 0000 0 Vndash -1 11111111 11111111 FFFFndash -32768 10000000 00000000 8000 Vmin
raquo リトルエンディアン(バイトオーダ)での例bull 5B F6 00 00 01 01 60 F6 2A 00 01 01 hellip [16進]
I Q ゲート マーカ I Q ゲート マーカ
-2469 0 257 -2464 42 257 hellip [10進]
ndash バイトスワッピングと称されるビッグエンディアン(バイトオーダ)ではF6 5B 00 00 01 01 F6 60 00 2A 01 01 hellip [16進]
I Q マーカ ゲート I Q マーカ ゲート
バイナリエディタ
5B F6
F6 5B
バイトスワッピング
Slide 86MG3700A-J-F-11
バイトオーダ
bull リトルエンディアンかビッグエンディアンかのバイトオーダはPCプロセッサタイプに左右されます
raquo インテルとAMDプロセッサはリトルエンディアンを使用します
raquo サンとモトローラのプロセッサはビッグエンディアンを使用しますraquo アップルパワーPCプロセッサはビッグエンディアンを適応させたがリトル
エンディアンオーダもサポートしますndash バイトオーダを決定するためにまた両方をサポートする場合正しいバイトオー
ダを使用していることを確実にする方法を理解するためにプロセッサメーカにいつも注意してください
bull バイトオーダはシステムプロセッサがメモリ内バイナリデータとしてどのように整数を格納するかを表現します
raquo リトルエンディアンシステムからテキストファイル(ASCIIテキスト)にデータを
出力するとき値はビッグエンディアンシステムから見られるのと同じですraquo MG3700Aへデータをダウンロードするときのようにバイナリデータを使用
するときだけオーダが重要になります
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
44
Slide 87MG3700A-J-F-11
バイトオーダ
bull LSBとMSBのポジショニングはバイトオーダとともに変化しますbull リトルエンディアンオーダではLSBとMSBがビットシーケンスで互いの隣
りにあります
-2469 符合付き整数の例
raquo リトルエンディアンndash 5B F6 [16進] 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 [2進]
raquo ビッグエンディアンndash F6 5B [16進] 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 1 [2進]
bull Most Significant Bit (MSB)は2進数で最大値のビット位置ですbull Least Significant Bit (LSB)は2進整数で数が偶数か奇数かを決めるビット位置です
ndash 2バイトデータではMSBが第2バイトに現われます
LSB MSB
LSBMSB
Slide 88MG3700A-J-F-11
2の補数の整数
bull 2の補数はコンピュータ内で逆算することにより符合付き整数を表わすポピュラーな方法ですMSBは正数と負数の符号を表わします
16進 2進 10進bull 09 A5 00001001 10100101 +2569+bull F6 5B 11110110 01011011 -2569
= 1 00000000 00000000 0ndash 第17ビット(左端のビット)を無視して実際の答えを0とします
raquo 2の補数2進数の10進数はMSB(ビットが1であるとき値は負数)の値を取り去り計算されビットが1である2のべき乗値を加えます
bull F6 5B 11110110 01011011= -215 + 214 + 213 + 212 + 210 + 29 + 26 + 24 + 23 + 21 + 20 = -2569
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
45
Slide 89MG3700A-J-F-11
2の補数の整数
bull 2の補数を計算raquo 2進数の2の補数はビットを逆にし1を加えますビットオーバフローは無
視されますndash F6 5B (-2469) で始める
11110110 01011011bull 2の補数表記法で+2469に変換するためにビットを逆にします 0は11は0
00001001 10100100ndash この数字は10進数-2469の1の補数です
bull 2の補数を得るために1を加えます00001001 10100101
ndash 09 A5 (+2469) で始める00001001 10100101
bull 2の補数表記法で-2469に変換するためにビットを逆にします 0は11は011110110 01011010
bull 2の補数を得るために1を加えます11110110 01011011
Slide 90MG3700A-J-F-11
MakeWvFileのエラー
bull エラーが起こるとエラーコードが返されますbull エラーコード
raquo 0正常終了
raquo 16ファイル書き出し失敗
raquo 23パラメータテキストファイルの規定外の Pattern Name のため変換失敗
raquo 24パラメータテキストファイルの規定外の Package 名のため変換失敗
raquo 25パラメータテキストファイルの規定外の Sampling Rate のため変換失敗
raquo 64WVDファイルのオープン失敗
raquo 65WVIファイルのオープン失敗
raquo 66データバイナリファイルのオープン失敗
raquo 67パラメータテキストファイルのオープン失敗
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
46
Slide 91MG3700A-J-F-11
Transfer プログラミング例
--- Executes on button press in pushbutton3function pushbutton3_Callback(hObject eventdata handles) hObject handle to pushbutton3 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull MG3700Aに接続しFTPオブジェクトを作成ipaddress = get(handlesedit6 String)username = get(handlesedit7 String)password = get(handlesedit8 String)
f = ftp(ipaddress username password)
入力文字列を取得
Slide 92MG3700A-J-F-11
Transfer プログラミング例
bull MG3700A HDD内の既存パッケージフォルダをチェック新パッケージフォルダを作成
package = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
cd(f hdd0PACKAGE)buff = dir(f package)if length(buff) lt 4
mkdir(f package)end
bull WVI と WVD ファイルをダウンロードcd(f package)mput(f [ patname wvi])mput(f [ patname wvd])
close(f)
入力文字列を取得
MG3700A HDD内ディレクトリを変更
ディレクトリリストを表示
新しいディレクトリを作成
FTPオブジェクトをクローズ
ファイルをアップロード
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
47
Slide 93MG3700A-J-F-11
Play プログラミング例
--- Executes on button press in pushbutton4function pushbutton4_Callback(hObject eventdata handles) hObject handle to pushbutton4 (see GCBO) eventdata reserved - to be defined in a future version of MATLAB handles structure with handles and user data (see GUIDATA)
bull TCPIPオブジェクトを作成ipaddress = get(handlesedit6 String)t = tcpip(ipaddress 49153)fopen(t)
入力文字列を取得
MG3700AにTCPIPオブジェクトを接続Instrument Control Toolbox
Slide 94MG3700A-J-F-11
Play プログラミング例
bull ベースバンドメモリへパターンデータをロードpackage = get(handlesedit9 String)patname = get(handlesedit2 String)if isempty(package)
package = Convert_IQproducerend
fprintf(t [LDFILE WMA package patname ])
for n = 1150pause(1)fprintf(t ESR2)flag = str2num(fscanf(t))if bitget(flag 5) == 1
breakend
end
bull シグナルパターンを再生fprintf(t PATCOMBMODE DEFINED)fprintf(t [LOADEDFILESEL WMA package patname ])fprintf(t OPC)fscanf(t)
fclose(t)delete(t)
入力文字列を取得
TCPIPオブジェクトをクローズ
ENDイベントステータスレジスタを監視
パターンコンビネーションモード Defined
オペレーション終了を問合せ
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
48
Slide 95MG3700A-J-F-11
利用できるサンプルプログラム
サンプルプログラムは自身でカスタマイズすることを容易にしますraquo Anritsu_SG_demom
ndash MATLABでrunするM-ファイル
raquo convandtranstoolmndash Anritsu_SG_demom内からコールされるファンクションM-ファイル
raquo convandtranstoolfigndash GUIDEにてセーブされたGUIレイアウト
raquo MakeWvFileexendash データファイルをアンリツVSGフォーマットに変換する実行ファイル
raquo MG37WP06dllndash MakeWvFileexe内からコールされるDLLファイル
bull 埋め込みオブジェクトは上記5ファイルを含んでいますraquo MATLAB_ProgrammedSamples2008zzz (100 KB)
ndash 埋め込みファイルを保存後にファイル名をMATLAB_ProgrammedSamples2008zipへ変更してください
clear all close all clc1313select modulation type13modulation_select = 513 1 16QAM13 2 64QAM13 3 8PSK13 4 QPSK13 5 pi4 shift QPSK1313 initial setting13Fd = 1 symbol rate(fixed) brvbarnormalized to 1(Hz)13Fs = 10Fd sampling rate on simulation13R = 05 roll off of nyquist filter13Delay = 5 delay of roll off filter13Pd = 256 the number of symbol on simulation13Iteration = 2 Iterration (fixed)13t_m = 0PdIteration-1 message data length13t_s = Delay1Fs(Pd+Delay)Fd-1Fs simulation data length13filename = No6_QPSKtxt output filename131313switch modulation_select13 case 1 16-QAM13 M = 16 mapping for QAM 13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 2 64-QAM13 M = 64 mapping for QAM13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = qammod(msg_dM)1313 case 3 8-PSK13 M = 8 mapping of PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dM)1313 case 4 QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a = pskmod(msg_dMpi4)1313 case 5 pi4 shift QPSK13 M = 4 mapping for PSK13 13 generate data13 msg_dd = randint(Pd1M) generate Pd of data13 msg_d = repmat(msg_ddIteration1) Iteration13 13 mapping13 msg_a_temp = pskmod(msg_dMpi4)13 n = [0length(msg_a_temp)-1]13 msg_a = msg_a_temp exp(ipi4n)13 clear msg_a_temp1313 otherwise13 error(modulation type error)13end131313 filtering13rcv_aa = rcosflt(msg_aFdFsfirnormalRDelay)1313 correct filter delay13rcv_a = rcv_aa(FsDelay2+1end-Fs((Pd-Delay)+Delay))1313 output to file13I_Q = [real(rcv_a) imag(rcv_a)]1313rcv_a = I_Q(1) + iI_Q(2)1313 compare signal before and after filter13figure13subplot(211) plot in-phase data13stem(t_mreal(msg_a)) hold on13plot(t_sreal(rcv_a)r)13axis([-1 PdIteration+1 round(min(real(msg_a))) round(max(real(msg_a)))]) grid13title(I-Signal)13xlabel(Sample) ylabel(Amplitude)1313subplot(212) plot quad-phase data13stem(t_mimag(msg_a)) hold on13plot(t_simag(rcv_a)r)13axis([-1 PdIteration+1 round(min(imag(msg_a))) round(max(imag(msg_a)))]) grid13title(Q-Signal)13xlabel(Sample) ylabel(Phase)1313 plot eye pattern13eyediagram(rcv_aFs)1313scatterplot(rcv_a10b-)13hold on13plot(rcv_a(1FsFdend)bo)grid13hold off1313RMSvalue = sqrt(sum(I_Q(1)^2 + I_Q(2)^2)(2length(I_Q)))13I_Q = round(I_Q1634RMSvalue) To integer1313marker1 = [ ones(101) zeros(length(I_Q)-101) ]13marker2 = zeros(length(I_Q)1)13marker3 = zeros(length(I_Q)1)13gate = ones(length(I_Q)1) RF gate flag13marker_gate = marker32^10 + marker22^9 + marker12^8 + gate2^013data = [I_Q marker_gate]1313convandtranstool
hgS_070000[1x1 struct array]
function varargout = convandtranstool(varargin)13 CONVANDTRANSTOOL M-file for convandtranstoolfig13 CONVANDTRANSTOOL by itself creates a new CONVANDTRANSTOOL or raises the existing13 singleton1313 H = CONVANDTRANSTOOL returns the handle to a new CONVANDTRANSTOOL or the handle to13 the existing singleton1313 CONVANDTRANSTOOL(CALLBACKhObjecteventDatahandles) calls the local13 function named CALLBACK in CONVANDTRANSTOOLM with the given input arguments1313 CONVANDTRANSTOOL(PropertyValue) creates a new CONVANDTRANSTOOL or raises the13 existing singleton Starting from the left property value pairs are13 applied to the GUI before convandtranstool_OpeningFunction gets called An13 unrecognized property name or invalid value makes property application13 stop All inputs are passed to convandtranstool_OpeningFcn via varargin1313 See GUI Options on GUIDEs Tools menu Choose GUI allows only one13 instance to run (singleton)1313 See also GUIDE GUIDATA GUIHANDLES1313 Edit the above text to modify the response to help convandtranstool1313 Last Modified by GUIDE v25 12-Oct-2005 1105031313 Begin initialization code - DO NOT EDIT13gui_Singleton = 113gui_State = struct(gui_Name mfilename 13 gui_Singleton gui_Singleton 13 gui_OpeningFcn convandtranstool_OpeningFcn 13 gui_OutputFcn convandtranstool_OutputFcn 13 gui_LayoutFcn [] 13 gui_Callback [])13if nargin ampamp ischar(varargin1)13 gui_Stategui_Callback = str2func(varargin1)13end1313if nargout13 [varargout1nargout] = gui_mainfcn(gui_State varargin)13else13 gui_mainfcn(gui_State varargin)13end13 End initialization code - DO NOT EDIT131313 --- Executes just before convandtranstool is made visible13function convandtranstool_OpeningFcn(hObject eventdata handles varargin)13 This function has no output args see OutputFcn13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)13 varargin command line arguments to convandtranstool (see VARARGIN)1313 Choose default command line output for convandtranstool13handlesoutput = hObject1313 Update handles structure13guidata(hObject handles)1313 UIWAIT makes convandtranstool wait for user response (see UIRESUME)13 uiwait(handlesfigure1)131313 --- Outputs from this function are returned to the command line13function varargout = convandtranstool_OutputFcn(hObject eventdata handles) 13 varargout cell array for returning output args (see VARARGOUT)13 hObject handle to figure13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get default command line output from handles structure13varargout1 = handlesoutput13131313function edit1_Callback(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit1 as text13 str2double(get(hObjectString)) returns contents of edit1 as a double131313 --- Executes during object creation after setting all properties13function edit1_CreateFcn(hObject eventdata handles)13 hObject handle to edit1 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit2_Callback(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit2 as text13 str2double(get(hObjectString)) returns contents of edit2 as a double131313 --- Executes during object creation after setting all properties13function edit2_CreateFcn(hObject eventdata handles)13 hObject handle to edit2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit3_Callback(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit3 as text13 str2double(get(hObjectString)) returns contents of edit3 as a double131313 --- Executes during object creation after setting all properties13function edit3_CreateFcn(hObject eventdata handles)13 hObject handle to edit3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit4_Callback(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit4 as text13 str2double(get(hObjectString)) returns contents of edit4 as a double131313 --- Executes during object creation after setting all properties13function edit4_CreateFcn(hObject eventdata handles)13 hObject handle to edit4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit5_Callback(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit5 as text13 str2double(get(hObjectString)) returns contents of edit5 as a double131313 --- Executes during object creation after setting all properties13function edit5_CreateFcn(hObject eventdata handles)13 hObject handle to edit5 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton213function pushbutton2_Callback(hObject eventdata handles)13 hObject handle to pushbutton2 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Get input string13valname = get(handlesedit1 String)13package = get(handlesedit9 String)13patname = get(handlesedit2 String)13samprate = get(handlesedit10 String)13rmsval = get(handlesedit3 String)13oversamp = get(handlesedit4 String)13sysunit = get(handlesedit5 String)13framelen = get(handlesedit11 String)1313if isempty(package)13 package = Convert_IQproducer13end1313if isempty(valname) | isempty(patname) | isempty(samprate)13 errordlg(Variable NameAPattern NameASampling Rate are necessary)13 return13end1313 generate parameter file13fid = fopen(wave_infodat w)13fprintf(fid [Wave Info]n)13fprintf(fid Soft Type = MX3700n) If using for MG370013 fprintf(fid Soft Type = MX2690n) If using for MS269013fprintf(fid [Package = package n])13fprintf(fid [Pattern Name = patname n])13fprintf(fid [Sampling Rate = samprate Hzn])1313if ~isempty(oversamp)13 fprintf(fid [Over Sampling = oversamp n])13end1313if ~isempty(sysunit)13 fprintf(fid [System Unit = sysunit n])13end1313if ~isempty(framelen)13 fprintf(fid [Frame Length = framelen n])13end1313if ~isempty(rmsval)13 fprintf(fid [WVI RMS Value = rmsval n])13 fprintf(fid [WVD RMS Value = rmsval n])13end1313fprintf(fid Marker1 = Headn)13fprintf(fid Marker2 = n)13fprintf(fid Marker3 = n)1313 Define the following parameters in case of burst signal13fprintf(fid [Rf Gate]n)13fprintf(fid Rf On Off Threshold = 1n)13fprintf(fid Min Rf Gate Length = 100samplesn)1313fclose(fid)1313 generate binary file13try13 evalin(base fid_r = fopen(wave_rawdat w))13 evalin(base [fwrite(fid_r valname int16)])13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)1313catch13 errordlg(assigned figures are incorrect)13 evalin(base fclose(fid_r))13 evalin(base clear fid_r)13 return13end1313 generate wviAwvd files13MakeWvFile wave_infodat wave_rawdat13delete(wave_infodat)13delete(wave_rawdat)1313msgbox(files can be generated)1313function edit9_Callback(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit9 as text13 str2double(get(hObjectString)) returns contents of edit9 as a double131313 --- Executes during object creation after setting all properties13function edit9_CreateFcn(hObject eventdata handles)13 hObject handle to edit9 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit10_Callback(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit10 as text13 str2double(get(hObjectString)) returns contents of edit10 as a double131313 --- Executes during object creation after setting all properties13function edit10_CreateFcn(hObject eventdata handles)13 hObject handle to edit10 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit6_Callback(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit6 as text13 str2double(get(hObjectString)) returns contents of edit6 as a double131313 --- Executes during object creation after setting all properties13function edit6_CreateFcn(hObject eventdata handles)13 hObject handle to edit6 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit7_Callback(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit7 as text13 str2double(get(hObjectString)) returns contents of edit7 as a double131313 --- Executes during object creation after setting all properties13function edit7_CreateFcn(hObject eventdata handles)13 hObject handle to edit7 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end13131313function edit8_Callback(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit8 as text13 str2double(get(hObjectString)) returns contents of edit8 as a double131313 --- Executes during object creation after setting all properties13function edit8_CreateFcn(hObject eventdata handles)13 hObject handle to edit8 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313 --- Executes on button press in pushbutton313function pushbutton3_Callback(hObject eventdata handles)13 hObject handle to pushbutton3 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13username = get(handlesedit7 String)13password = get(handlesedit8 String)1313try13 f = ftp(ipaddress username password)13catch13 errordlg(impossible to connect to MG3700A)13 return13end1313 check existence folder andor generate folder13cd(f hdd0PACKAGE)13buff = dir(f package)13if length(buff) lt 413 mkdir(f package)13end1313 transfer wviAwvd files13try13 cd(f package)13 mput(f [ patname wvi])13 mput(f [ patname wvd])13catch13 errordlg(abnormal termination)13 close(f)13 return13end1313close(f)13msgbox(files can be tranfered normally)1313 --- Executes on button press in pushbutton413function pushbutton4_Callback(hObject eventdata handles)13 hObject handle to pushbutton4 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313package = get(handlesedit9 String)13patname = get(handlesedit2 String)1313if isempty(package)13 package = Convert_IQproducer13end1313ipaddress = get(handlesedit6 String)13t = tcpip(ipaddress 49153)1313try13 fopen(t)13catch13 errordlg(unable to find MG3700A)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])13msg = fscanf(t)13msg = msg(1end-1)1313 transfer to memory from HDD13switch msg13 case ENABLE13 case EXIST13 button = questdlg(Overwrite OK Yes No No)13 if strcmp(button No)13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13 end13 otherwise13 errordlg(transfer to the memory is abnormally terminated)13 delete(t)13 return13end1313fprintf(t [LDFILE WMA package patname ])1313 wait loop for transfer termination(5bitj13for n = 115013 pause(1)13 fprintf(t ESR2)13 flag = str2num(fscanf(t))13 if bitget(flag 5) == 113 break13 end13end1313if n == 15013 errordlg(transfer was abnormally terminated)13 delete(t)13 return13end1313fprintf(t PATCOMBMODE DEFINED)13fprintf(t [LOADEDFILESEL WMA package patname ])13fprintf(t OPC)13fscanf(t)1313fclose(t)13delete(t)1313msgbox(transfer was abnormally terminated)1313function edit11_Callback(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles structure with handles and user data (see GUIDATA)1313 Hints get(hObjectString) returns contents of edit11 as text13 str2double(get(hObjectString)) returns contents of edit11 as a double131313 --- Executes during object creation after setting all properties13function edit11_CreateFcn(hObject eventdata handles)13 hObject handle to edit11 (see GCBO)13 eventdata reserved - to be defined in a future version of MATLAB13 handles empty - handles not created until after all CreateFcns called1313 Hint edit controls usually have a white background on Windows13 See ISPC and COMPUTER13if ispc ampamp isequal(get(hObjectBackgroundColor) get(0defaultUicontrolBackgroundColor))13 set(hObjectBackgroundColorwhite)13end131313
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD
本 社 TEL046-223-1111243-8555 神奈川県厚木市恩名5-1-1
第1営業本部第1営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業部 046-296-1202 243-0016 神奈川県厚木市田村町8-5
第2営業本部第1営業部 046-296-1203 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3560 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル第3営業部 03-5320-3567 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
第3営業本部第1営業部 046-296-1205 243-0016 神奈川県厚木市田村町8-5
第2営業部 03-5320-3551 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
北海道支店 011-231-6228 060-0042 札幌市中央区大通西5-8 昭和ビル
東北支店 022-266-6131 980-0811 仙台市青葉区一番町2-3-20 第3日本オフィスビル
関東支社 048-600-5651 330-0081 さいたま市中央区新都心4-1 FSKビル東関東支店 029-825-2800 300-0034 土浦市港町1-7-23 ホープビル1号館千葉営業所 043-351-8151 261-0023 千葉市美浜区中瀬1-7-1
住友ケミカルエンジニアリングセンタービル新潟支店 025-243-4777 950-0916 新潟市中央区米山3-1-63 マルヤマビル
東京支店(官公庁担当) 03-5320-3559 160-0023 東京都新宿区西新宿6-14-1 新宿グリーンタワービル
中部支社 052-582-7281 450-0002 名古屋市中村区名駅3-22-4 みどり名古屋ビル
関西支社 06-6391-0111 532-0003 大阪市淀川区宮原4-1-14 住友生命新大阪北ビル東大阪支店 06-6787-6677 577-0066 東大阪市高井田本通7-7-19 昌利ビル
中国支店 082-263-8501 732-0052 広島市東区光町1-10-19 日本生命光町ビル
四国支店 087-861-3162 760-0055 高松市観光通2-2-15 第2ダイヤビル
九州支店 092-471-7655 812-0016 福岡市博多区博多駅南1-3-11 博多南ビル
お見積りご注文修理などのお問い合わせは下記まで記載事項はおことわりなしに変更することがあります
アンリツ株式会社 httpwwwanritsucojp
計測器の使用方法その他についてのお問い合わせは下記まで
計測サポートセンターTEL 0120-827-221FAX 0120-542-425受付時間900~1700月~金曜日(当社休業日を除く)
E-mail MDVPOSTccanritsucojp
ご使用の前に取扱説明書をよくお読みの上正しくお使いください 0704
本製品を国外に持ち出すときは外国為替および外国貿易法の規定により日本国政府の輸出許可または役務取引許可が必要となる場合がありますまた米国の輸出管理規則により日本からの再輸出には米国商務省の許可が必要となる場合がありますので必ず弊社の営業担当までご連絡ください
古紙配合率70再生紙を 使用しています No MG3700A-J-F-11-(300) 2008-1 AKD