TA的每日心情 | 擦汗 2020-1-14 15:59 |
---|
签到天数: 1 天 [LV.1]初来乍到
|
不太情况是哪里的设置问题,首先我用MATLAB自带的函数产生了一个码元数据,然后丢给眼图分析函数
7 u: I0 ~; B" J2 t, s" Q4 b! @ q9 r/ I4 X
代码如下:7 T' B* ?3 ]4 g0 M8 U6 P& I& @0 y
///////////////////////////////////////////////////////////////////////////////////////////////9 C% h/ @7 z# p8 P& |: z
clear& u% ?& |7 l' L, }% ^) e) s
close all
7 \7 a, m2 @3 o! _8 B . Z* z. U0 |6 H' ~2 F4 O) u
% Initialize system parameters
- W& N% q( w5 @8 `$ n) C2 `" P$ hFs = 10000000000; Rs = 200000000; nSamps = Fs/Rs; rollOff = 0.8; M=4;
7 b6 e8 a7 b& UhMod = comm.QPSKModulator; % comm.QPSKModulator System object
6 A& U7 k% d1 \3 }
9 ? V& _, p- ]% Square root raised cosine filters
6 O% a0 L7 [/ f8 C3 `filtSpec = fdesign.pulseshaping(nSamps,'Square root raised cosine',...
; f% j4 r. b: v% j* {6 f 'Nsym,Beta',6,rollOff);+ v$ z+ o. [; K) U0 w K
hTxFlt = design(filtSpec); hTxFlt.PersistentMemory = true;
/ e* C4 \; R; ]! A/ N8 Z1 ^5 g( ChRxFlt = copy(hTxFlt); hTxFlt.Numerator = hTxFlt.Numerator*nSamps;! r2 B. Z/ h, y* k" Y
; \# j7 L/ |6 w0 N
% Generate modulated and pulse shaped signal
5 |4 {; m" G; m' p- Q: H( _. _ ?frameLen = 1258;1 {6 E2 a, `! R( p
msgData = randi([0 M-1],frameLen,1);
9 O6 I: t% i* {& d, ?9 f$ G* ^* J- s C2 bmsgSymbols = step(hMod, msgData);- y4 F! O+ J E, I3 }, v4 X7 |) b5 B
msgTx = hTxFlt.filter(upsample(msgSymbols, nSamps));" ]& _6 u/ l, e' n9 [
! \2 u% T d: Q: I# @) Zt = 0:1/Fs:100/Rs-1/Fs; idx = round(t*Fs+1);1 A/ I/ n$ S* p: q5 v
hFig = figure; plot(t, real(msgTx(idx)));* ^! M" L" u3 B
title('Modulated, filtered in-phase signal');
N/ q) a x" @1 }, oxlabel('Time (sec)'); ylabel('Amplitude'); grid on;
/ O6 V. B. |9 H' E0 L
) D9 l7 _0 @& A' j' qsave('pqfile1.txt', 'msgTx','-ASCII')( C( m1 w" ~: Z2 p0 O. E
. i/ A0 F+ G( w8 W9 ~% Manage the figures; K# H7 I& E; K. }
managescattereyefig(hFig);4 r- V! L$ A( K+ E
& _$ L8 o$ d, w [0 C
0 A2 t3 ?6 W( I) S2 r( E" M% Create an eye diagram object
( o$ L5 l! K' g2 A' oeyeObj = commscope.eyediagram(...* j3 q- {$ v4 [ u4 _7 E
'SamplingFrequency', Fs, ...5 ?6 j! K8 B7 Q( {1 a* v
'SamplesPerSymbol', nSamps, ...
9 ^0 D P" }& }; K9 P4 z0 F# N 'MinimumAmplitude', -1.4, ...
9 F$ s9 O; G( O 'MaximumAmplitude', 1.4, ...
" [2 V" F7 p8 I: A% S8 W5 r 'SamplingFrequency', Fs, ...
( @1 i6 N- B# ?/ ~& L 'SamplesPerSymbol', nSamps, ...
8 ]4 a) ^) f) v" m! y! _* ~ ] 'OperationMode', 'Complex Signal')/ ]; I6 W7 W. M5 H( c" n
) c1 b1 J! |6 I% Update the eye diagram object with the transmitted signal
0 G/ K% w4 {, ^! BeyeObj.update(msgTx);. w* H( K& n3 P/ G' g2 l6 y
) ^* f" d8 q. w! t7 [
% Manage the figures
0 n, j9 y* F) k% ^: N7 k. T/ r+ n- G
analyze(eyeObj);3 @0 Y7 X; a$ G' v3 X9 F
eyeObj.Measurements7 E; K) m$ W* H2 [& b7 R
///////////////////////////////////////////////////////////////////////////////////////////////
3 u! K/ y- I' S& A. @( C! H1 I* v. ]) b/ ^; S
然后读入pqfile1.txt文件,代码如下:( Q% g) b3 ]6 _" M; y9 `. ?# e! q9 H
//////////////////////////////////////////////////////////////////////////////////////////////8 L" A# t+ r' G; X
clear* Z; z& a+ B7 {, O$ \9 _$ G
close all
1 y! o5 \2 d' e7 @
* s0 u1 t8 i& `7 d7 [6 WFs = 10000000000; Rs = 200000000; nSamps = Fs/Rs;. m# g0 L9 ]6 l
% S6 ]; A% C: ~' `& ?6 v
filename ='pqfile1.txt';
R# f/ K9 h! N# k4 N/ [6 jfid=fopen(filename,'r');
9 C6 h9 P, f8 L8 }( D[code,count]=fscanf(fid,'%f',62900);1 Z7 |' `8 K! ~( J2 I
/ M2 \& R$ g5 W
% Create an eye diagram and display properties4 @& I! \# z/ k0 w
eyeObj = commscope.eyediagram(...
% O2 f' z7 s8 E* ~ 'SamplingFrequency', Fs, ... R5 J6 _9 D1 c) T( Q/ V: D
'SamplesPerSymbol', nSamps, ...
; x# h1 I% p) O% E 'SymbolsPerTrace',2,...: I9 n. N% o+ z% H, G
'MinimumAmplitude', -1.4, ... Q8 V% |* q% @0 E
'MaximumAmplitude', 1.4, ...% G; L7 v6 R9 H* e! j3 E
'PlotTimeOffse',0,...
8 Q; b7 C: h% ^# i8 d3 A 'PlotType','2D Colo',...9 |7 w+ e$ d# F# `. ^: Z
'ColorScale', 'log') %#ok: u; n9 W) V1 l6 o3 ~% l
+ H# ^8 {' Z1 S; w' n' \& E, L9 Q8 W* M! d9 x
update(eyeObj, code);
$ \- s" P' h9 T& c: b( Jtitle('Noisy NRZ signal');xlabel('Time (sec)');ylabel('Amplitude');grid on;
_- c, s" _; P. w M) oanalyze(eyeObj);
" T# P- l, M% r# y" N0 j/ meyeObj.Measurements& | k/ b, }* J7 P( f6 v
//////////////////////////////////////////////////////////////////////////////////////////////) R" O' @2 K/ } u D8 Z! C, }
测量结果是:
6 |& l8 A& o6 U4 O q# S$ g Type: 'Eye Diagram Measurements'
4 z j& X. B, P) {, G: k' h DisplayMode: 'Optimized for Real Signal'
+ N" P8 }! R9 n* C+ }6 _& c# q EyeCrossingTime: [2.4972e-09 7.5006e-09]
& ^8 H5 L$ {- T% j9 q# H9 |' t EyeCrossingAmplitude: [-0.0109 -0.0117]+ w( l! ^" a: y( `$ R; l- q9 W+ h
EyeDelay: 4.9989e-099 o: r. ^( V0 ]. E: x4 K
EyeLevel: [-0.8496 0.8484]
1 b i% o. `5 F9 C* I+ N: y8 U! l) x EyeAmplitude: 1.6980
; @; ?$ |& v& H6 \2 w EyeHeight: 1.0287
% s, S; l: P- T EyeCrossingPercentage: 49.3703
* G3 s3 j7 ]& y$ U% |( e1 D# F+ h EyeOpeningVertical: 0.6723
: [1 d5 e I, c* ~5 `! `; ?# s EyeSNR: 7.6107
" E+ o# s7 V4 }+ Q, t e QualityFactor: 13.1948
+ Y E0 ^& Q3 ~2 b1 C7 r5 k$ O# }9 R) k EyeWidth: 4.3069e-09& H4 p: ?/ x! D
EyeOpeningHorizontal: 4.8000e-09
$ H% y$ A) Q% G/ ~1 s: @6 B JitterRandom: 00 c' j$ X0 M- x8 F
JitterDeterministic: 2.0000e-10
( t/ O4 Q* P8 O8 I t( q JitterTotal: 2.0000e-10
: r0 f' V9 H7 h. Y1 w7 X W- x JitterRMS: 1.0180e-10
8 W) D5 }- v+ C+ U% G0 w JitterPeakToPeak: 2.4000e-09
" b: w% r1 R( A) u EyeRiseTime: 2.1848e-097 I6 b: a% m; \5 q
EyeFallTime: 2.1804e-09 |
|