matlab dpsk,2DPSK调制与解调matlab(最新整理)
《2DPSK調制與解調matlab(最新整理)》由會員分享,可在線閱讀,更多相關《2DPSK調制與解調matlab(最新整理)(5頁珍藏版)》請在人人文庫網上搜索。
1、- 2DPSK 調制與解調%-%參數初始化%-fs = 3600000;%采樣頻率為 36000 赫茲Time_Hold_On = 1/1200;%一個時鐘周期為 1200 分之 1,對應比特率為 1200bps Num_Unit = fs * Time_Hold_On;%一個時鐘周期內的采樣點個數High_Level = ones ( 1, Num_Unit );%高電平(全 1 序列) Low_Level = zeros ( 1, Num_Unit );%低電平(全 0 序列) w = 1800;%載波角頻率 1800HzA = 1;%載波幅值%-%信號初始化%-Sign_Set = 0,。
2、1,1,0,1,0,0,1;%原始序列Lenth_Of_Sign = length ( Sign_Set );%原始序列長度Sign_Sett = ones(1,Lenth_Of_Sign+1);%差分變換后的序列,初始化為長度為原始序列長度+1 的全 1 序列(第一個碼元為 1)sign_orign = zeros ( 1, Num_Unit * (Lenth_Of_Sign+1) );%初始化基帶信號為全 0 序列sign_result = zeros ( 1, Num_Unit * (Lenth_Of_Sign+1) );%初始化接收到的基帶信號為全 0 序列st = zeros ( 1。
3、, Num_Unit *( Lenth_Of_Sign+1) );%初始化調制后的信號為全 0 序列t = 0 : 1/fs : Time_Hold_On * (Lenth_Of_Sign +1)- 1/fs;%信號采樣時間點result=zeros(1,Lenth_Of_Sign+1);%初始化接收到的序列resultt=zeros(1,Lenth_Of_Sign);%初始化差分解調后的序列%-%求差分編碼%-for I = 2 : Lenth_Of_Sign+1%差分變換后的序列第一個值為 1,從第 2 個開始計算Sign_Sett(I)= xor(Sign_Sett(I-1),Sign_。
4、Set(I-1);%用異或運算求差分碼end%-%產生基帶信號%-for I = 1 : Lenth_Of_Sign+1%考慮差分變換后序列中每一個值if Sign_Sett(I) = 1sign_orign( (I-1)*Num_Unit + 1 : I*Num_Unit) = High_Level;%序列值為 1,基帶信號為高電平elsesign_orign( (I-1)*Num_Unit + 1 : I*Num_Unit) = Low_Level;%序列值為 0,基帶信號為低電平endend%-%調制部分%-for I = 1 : Lenth_Of_Sign+1%考慮差分變換后序列中每一。
5、個值if Sign_Sett(I) = 1st( (I-1)*Num_Unit + 1 : I*Num_Unit) = A * cos ( 2 * pi * w * t( (I-1)*Num_Unit + 1 :I*Num_Unit ) + ( pi / 2 ) );%序列值為 1,相位調制為 /2 elsest( (I-1)*Num_Unit + 1 : I*Num_Unit) = A * cos ( 2 * pi * w * t( (I-1)*Num_Unit + 1 :I*Num_Unit ) );%序列值為 0,相位調制為 0 endendfiguresubplot ( 2,1,1 )。
6、 plot(t, sign_orign);axis( 0 , Time_Hold_On *( Lenth_Of_Sign + 2), - (A / 2), A + (A / 2) ); title ( 原始信號 );grid%畫出基帶信號subplot ( 2, 1, 2 );plot ( t, st );axis( 0 , Time_Hold_On *( Lenth_Of_Sign + 2), - 3*(A / 2), 3*(A / 2) ); title ( 調制后的信號 );grid%畫出相位調制后的信號%-%相干解調%-dt= st .* cos ( 2 * pi * w * t );。
7、 %相干相乘figureplot ( t, dt );axis( 0 , Time_Hold_On *( Lenth_Of_Sign + 2), - 3*(A / 2), 3*(A / 2) ); title ( 相干相乘后的波形 );grid%-%低通濾波部分%-N,Wn = buttord( 2*pi*1500, 2*pi*3400,3,25,s); %臨界頻率采用角頻率表示,計算低通濾波器參數b,a=butter(N,Wn,s); %產生 N 階低通巴特沃斯濾波器bz,az=impinvar(b,a,fs); %映射為數字的dt = filter(bz,az,dt); %將相干相乘后的信。
8、號進行濾波figureplot ( t, dt );axis( 0 , Time_Hold_On *( Lenth_Of_Sign + 2), - 3*(A / 2), 3*(A / 2) ); title ( 低通濾波后的波形 );grid%-%抽樣判決 & 逆碼變換部分%-for I = 1 : Lenth_Of_Sign+1if dt(2*I-1)*Num_Unit/2) 序列生成與差分還原%-for I=1: Lenth_Of_Sign+1result(I)=sign_result(I* Num_Unit)%將接收到的信號生成(差分)序列endfor I = 1 : Lenth_Of_。
9、Signresultt(I)= xor(result(I),result(I+1) %將接收到的差分序列還原為原序列endwindow=boxcar(length(st); %矩形窗nfft=1024;Pxx,f=periodogram(st,window,nfft,fs); %求功率譜密度plot(f,10*log10(Pxx);“”“”At the end, Xiao Bian gives you a passage. Minand once said, people who learn to learn are very happy people. In every wonderful 。
10、life, learning is an eternal theme. As a professional clerical and teaching position, I understand the importance of continuous learning, life is diligent, nothing can be gained, only continuous learning can achieve better self. Only by constantly learning and mastering the latest relevant knowledge, can employees from all walks of life keep up with the pace of enterprise development and innovate to meet the needs of the market. This document is also edited by my studio professionals, there may be errors in the document, if there are errors, please correct, thank you。
總結
以上是生活随笔為你收集整理的matlab dpsk,2DPSK调制与解调matlab(最新整理)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 蓝桥杯 标题:纵横火柴旗子
- 下一篇: 有三个数a,b,c,要求按大小顺序输出。