毕业论文基于matlab的码型转换说明书Word下载.docx

上传人:b****4 文档编号:8234438 上传时间:2023-05-10 格式:DOCX 页数:36 大小:35.86KB
下载 相关 举报
毕业论文基于matlab的码型转换说明书Word下载.docx_第1页
第1页 / 共36页
毕业论文基于matlab的码型转换说明书Word下载.docx_第2页
第2页 / 共36页
毕业论文基于matlab的码型转换说明书Word下载.docx_第3页
第3页 / 共36页
毕业论文基于matlab的码型转换说明书Word下载.docx_第4页
第4页 / 共36页
毕业论文基于matlab的码型转换说明书Word下载.docx_第5页
第5页 / 共36页
毕业论文基于matlab的码型转换说明书Word下载.docx_第6页
第6页 / 共36页
毕业论文基于matlab的码型转换说明书Word下载.docx_第7页
第7页 / 共36页
毕业论文基于matlab的码型转换说明书Word下载.docx_第8页
第8页 / 共36页
毕业论文基于matlab的码型转换说明书Word下载.docx_第9页
第9页 / 共36页
毕业论文基于matlab的码型转换说明书Word下载.docx_第10页
第10页 / 共36页
毕业论文基于matlab的码型转换说明书Word下载.docx_第11页
第11页 / 共36页
毕业论文基于matlab的码型转换说明书Word下载.docx_第12页
第12页 / 共36页
毕业论文基于matlab的码型转换说明书Word下载.docx_第13页
第13页 / 共36页
毕业论文基于matlab的码型转换说明书Word下载.docx_第14页
第14页 / 共36页
毕业论文基于matlab的码型转换说明书Word下载.docx_第15页
第15页 / 共36页
毕业论文基于matlab的码型转换说明书Word下载.docx_第16页
第16页 / 共36页
毕业论文基于matlab的码型转换说明书Word下载.docx_第17页
第17页 / 共36页
毕业论文基于matlab的码型转换说明书Word下载.docx_第18页
第18页 / 共36页
毕业论文基于matlab的码型转换说明书Word下载.docx_第19页
第19页 / 共36页
毕业论文基于matlab的码型转换说明书Word下载.docx_第20页
第20页 / 共36页
亲,该文档总共36页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

毕业论文基于matlab的码型转换说明书Word下载.docx

《毕业论文基于matlab的码型转换说明书Word下载.docx》由会员分享,可在线阅读,更多相关《毕业论文基于matlab的码型转换说明书Word下载.docx(36页珍藏版)》请在冰点文库上搜索。

毕业论文基于matlab的码型转换说明书Word下载.docx

if(f(i)==1&

m==1)

s(i)=3;

m=m*p;

elseif(f(i)==1&

m==-1)

s(i)=0;

s(i)=1;

k=dec2bin(s,2);

l=k'

;

x=l(:

);

y=x'

n=str2num(y

(1));

fori=2:

length(y)

n=[nstr2num(y(i))];

%%%%%%%%%%%%译码%%%%%%%%%%%%%

ifn

(1)==0

ifn

(2)==1

cm=[0];

cm=[1];

r=3;

whiler<

length(n)

ifn(r)==0

ifn(r+1)==1

cm=[cm0];

cm=[cm1];

r=r+2;

3.HDB3码型转换

yn=xn;

%输出yn初始化

num=0;

%计数器初始化

fork=1:

length(xn)

ifxn(k)==1

num=num+1;

%"

1"

计数器

ifnum/2==fix(num/2)%奇数个1时输出-1,进行极性交替

yn(k)=1;

yn(k)=-1;

%HDB3编码

%连零计数器初始化

yh=yn;

%输出初始化

sign=0;

%极性标志初始化为0

V=zeros(1,length(yn));

%V脉冲位置记录变量

B=zeros(1,length(yn));

%B脉冲位置记录变量

length(yn)

ifyn(k)==0

%连“0”个数计数

ifnum==4%如果4连“0”

num=0;

%计数器清零

yh(k)=1*yh(k-4);

%让0000的最后一个0改变为与前一个非零符号相同极性的符号

V(k)=yh(k);

%V脉冲位置记录

ifyh(k)==sign%如果当前V符号与前一个V符号的极性相同

yh(k)=-1*yh(k);

%则让当前V符号极性反转,以满足V符号间相互极性反转要求

yh(k-3)=yh(k);

%添加B符号,与V符号同极性

B(k-3)=yh(k);

%B脉冲位置记录

yh(k+1:

length(yn))=-1*yh(k+1:

length(yn));

%并让后面的非零符号从V符号开始再交替变化

sign=yh(k);

%记录前一个V符号的极性

%当前输入为“1”则连“0”计数器清零

end

input=yh;

%HDB3码输入

decode=input;

%极性标志初始化

length(yh)

ifinput(k)~=0

ifsign==yh(k)%如果当前码与前一个非零码的极性相同

decode(k-3:

k)=[0000];

%则该码判为V码并将*00V清零

sign=input(k);

%极性标志

decode=abs(decode);

%整流

实验现象:

总体界面:

AMI:

CMI:

HDB3:

总结:

1.本次实验中因为对画方波不太熟悉,在使用stairs函数时,方波图总是在最后少了一位,后来经查询后才知道stairs的正确用法。

2.由于对GUI界面设置的不熟悉,很多细节都没做到位,界面的美观有待提高。

3.在编代码是经常没有写注释,导致后来有些变量混淆了。

附录:

全部代码

functionvarargout=untitled1(varargin)

%UNTITLED1M-fileforuntitled1.fig

%UNTITLED1,byitself,createsanewUNTITLED1orraisestheexisting

%singleton*.

%

%H=UNTITLED1returnsthehandletoanewUNTITLED1orthehandleto

%theexistingsingleton*.

%UNTITLED1('

CALLBACK'

hObject,eventData,handles,...)callsthelocal

%functionnamedCALLBACKinUNTITLED1.Mwiththegiveninputarguments.

Property'

'

Value'

...)createsanewUNTITLED1orraisesthe

%existingsingleton*.Startingfromtheleft,propertyvaluepairsare

%appliedtotheGUIbeforeuntitled1_OpeningFunctiongetscalled.An

%unrecognizedpropertynameorinvalidvaluemakespropertyapplication

%stop.Allinputsarepassedtountitled1_OpeningFcnviavarargin.

%*SeeGUIOptionsonGUIDE'

sToolsmenu.Choose"

GUIallowsonlyone

%instancetorun(singleton)"

.

%Seealso:

GUIDE,GUIDATA,GUIHANDLES

%Edittheabovetexttomodifytheresponsetohelpuntitled1

%LastModifiedbyGUIDEv2.521-Dec-201419:

55:

20

%Begininitializationcode-DONOTEDIT

gui_Singleton=1;

gui_State=struct('

gui_Name'

mfilename,...

'

gui_Singleton'

gui_Singleton,...

gui_OpeningFcn'

@untitled1_OpeningFcn,...

gui_OutputFcn'

@untitled1_OutputFcn,...

gui_LayoutFcn'

[],...

gui_Callback'

[]);

ifnargin&

&

ischar(varargin{1})

gui_State.gui_Callback=str2func(varargin{1});

ifnargout

[varargout{1:

nargout}]=gui_mainfcn(gui_State,varargin{:

});

else

gui_mainfcn(gui_State,varargin{:

%Endinitializationcode-DONOTEDIT

%---Executesjustbeforeuntitled1ismadevisible.

functionuntitled1_OpeningFcn(hObject,eventdata,handles,varargin)

%Thisfunctionhasnooutputargs,seeOutputFcn.

%hObjecthandletofigure

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

%varargincommandlineargumentstountitled1(seeVARARGIN)

%Choosedefaultcommandlineoutputforuntitled1

handles.output=hObject;

%Updatehandlesstructure

guidata(hObject,handles);

%UIWAITmakesuntitled1waitforuserresponse(seeUIRESUME)

%uiwait(handles.maxing);

%---Outputsfromthisfunctionarereturnedtothecommandline.

functionvarargout=untitled1_OutputFcn(hObject,eventdata,handles)

%varargoutcellarrayforreturningoutputargs(seeVARARGOUT);

%Getdefaultcommandlineoutputfromhandlesstructure

varargout{1}=handles.output;

functionedit_Callback(hObject,eventdata,handles)

%hObjecthandletoedit(seeGCBO)

%Hints:

get(hObject,'

String'

)returnscontentsofeditastext

%str2double(get(hObject,'

))returnscontentsofeditasadouble

%---Executesduringobjectcreation,aftersettingallproperties.

functionedit_CreateFcn(hObject,eventdata,handles)

%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled

%Hint:

editcontrolsusuallyhaveawhitebackgroundonWindows.

%SeeISPCandCOMPUTER.

ifispc&

isequal(get(hObject,'

BackgroundColor'

),get(0,'

defaultUicontrolBackgroundColor'

))

set(hObject,'

white'

%---Executesonbuttonpressinami.

functionami_Callback(hObject,eventdata,handles)

user_string=get(handles.edit,'

string'

a=dec2bin(user_string,8);

b=a'

c=b(:

d=c'

f=str2num(d

(1));

length(d)

f=[fstr2num(d(i))];

f=[f0];

%%%%%%%%%%%%±

à

Â

ë

%%%%%%%%%%%%%

%%%%%%%%%%%%Ò

%%%%%%%%%%%%

axes(handles.axes1)

t=1:

stairs(t-1,f)

axis([0length(f)-22])

xlabel('

ASCIIÂ

'

gridminor;

axes(handles.axes2)

length(e);

stairs(t-1,e)

axis([0length(e)-22])

AMI±

axes(handles.axes3)

length(l);

stairs(t-1,l)

axis([0length(l)-22])

AMIÒ

%hObjecthandletoami(seeGCBO)

%---Executesonbuttonpressincmi.

functioncmi_Callback(hObject,eventdata,handles)

length(n);

stairs(t-1,n)

axis([0length(n)-22])

CMI±

length(cm);

stairs(t-1,cm)

axis([0length(cm)-22])

CMIÒ

%hObjecthandletocmi(seeGCBO)

%---Executesonbuttonpressinhdb3.

functionhdb3_Callback(hObject,eventdata,handles)

xn=str2num(d

(1));

xn=[xnstr2num(d(i))];

xn=[xn0];

ä

³

ö

yn³

õ

Ê

¼

»

¯

Æ

ý

÷

ifnum/2==fix(num/2)%Æ

æ

¸

±

-1,½

ø

Ð

«

Ô

½

Ì

%HDB3±

¬

Á

ã

ê

Ö

¾

Î

ª

%VÂ

å

Ã

Ç

¿

%BÂ

¡

°

ifnum==4%È

ç

¹

û

0000µ

Ä

×

î

º

ó

Ò

Ó

·

Å

Ï

Í

µ

%VÂ

ifyh(k)==sign%È

ò

È

´

Ò

ú

¥

í

Ó

%BÂ

¢

Ù

%HDB3Â

ifsign==yh(k)%È

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > PPT模板 > 其它模板

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2