软件无线电习题资料Word格式.docx
《软件无线电习题资料Word格式.docx》由会员分享,可在线阅读,更多相关《软件无线电习题资料Word格式.docx(10页珍藏版)》请在冰豆网上搜索。
chirp2
268.5
300
三、对一圆形阵列的波束形成进行仿真,假设发射信号载频为0.8GHz圆形阵列半径为0.8米,
在圆周上均匀布置28个阵元。
1.画出指向10度的方向图;
2.如果目标在0度,有一不相干的干扰信号在-20度,干扰噪声功率比为35dB。
请用自适应波束形成方法画出方向图;
3.采用旁瓣对消的方法(选取两个阵元作为辅助天线),计算对消比
第一题源程序:
%=====================================================================%
%软件无线电作业题1
%对调制信号进行正交分解、滤波、抽取、解调
%====================================================================%
clc;
closeall;
clearall;
fs=40e6;
%信号时钟
Ts=1fs;
f0=10.7e6;
%载频
f1=1000;
f2=2000;
D1=10;
%CIC滤波抽取因子
D2=8;
%3级半带滤波抽取因子
D3=5;
%低通滤波抽取因子
%===================================================================%
%CIC滤波器设计
S1_cic=ones(1,D1);
%-级CIC
[H1,F1]=freqz(S1_cic,1,1024,fs);
S2_cic=conv(S1_cic,S1_cic);
%两级CIC
[H2,F2]=freqz(S2_cic,1,1024,fs);
S3_cic=conv(S2_cic,S1_cic);
%£
级CIC[H3,F3]=freqz(S3_cic,1,1024,fs);
figure;
plot(F1/(fs/2),20*log10(abs(H1))-max(20*log10(abs(H1))),'
b'
),grid;
holdon;
plot(F2/(fs/2),20*log10(abs(H2))-max(20*log10(abs(H2))),'
g'
);
plot(F3/(fs/2),20*log10(abs(H3))-max(20*log10(abs(H3))),'
m'
xlabel('
\fontsize{12}\bf归一化频率(\times\pirad/sample)'
ylabel('
\fontsize{12}\bf幅值(dB)'
),title('
\fontsize{12}\bfCICF幅频响应'
boxon;
legend('
\bf单级CIC'
'
\bf两级CIC'
\bf三级CIC'
Location'
SouthWest'
set(gca,'
FontWeight'
bold'
FontSize'
12);
holdoff;
%=======================================================================%
%HB滤波器设计
B2=firhalfband(8,blackman(9));
%9阶HBF
B2=conv(conv(B2,B2),B2);
%三级级联
[H4,F4]=freqz(B2,1,1024,fs);
figure
(2),plot(F4/(fs/2),20*log10(abs(H4))),grid;
title('
\fontsize{12}\bfHBF幅频响应'
%=======================================================================%%FIRF设计
fs1=fs/(8*10);
[N,Fo,Ao,W]=firpmord([20e335e3],[10],[10^(-100/20)10A(-100/20)],fs1);
%%低通滤波器b1=firpm(127,Fo,Ao,W);
[H5,F5]=freqz(b1,1,1024,fs1);
figure(3),plot(F5/(fs1/2),20*log10(abs(H5))),grid;
\fontsize{12}\bfFIFR幅频响应'
set(gca,'
%鉴频FIR设计fs2=fs1/5;
[N,Fo,Ao,W]=firpmord([20e330e3],[10],[10A(-80/20)10(80/20)],fs2);
%%低通滤波器
b2=firpm(63,Fo,Ao,W);
[H6,F6]=freqz(b2,1,1024,fs2);
figure(4),plot(F6/(fs2/2),20*log10(abs(H6))),grid;
\fontsize{12}\bf鉴频FIFR幅频响应'
%========================================================================%%滤波器总的幅频响应
HH=2.*H3.*H4.*H5;
figure(5),plot((1:
1024)*fs/1024,20*log10(abs(HH))),grid;
\fontsize{12}\bf频率/Hz'
\fontsize{12}\bf总的滤波器幅频响应'
%=========================================================================%%数据处理,给出每级数据经滤波抽取后的结果
N=400000;
n=0:
400000-1;
phi=0.7*pi*sin(2*pi*f1*n*Ts+pi/6)+0.7*pi*sin(2*pi*f2*n*Ts+pi/3);
Sn=cos(2*pi*f0*n*Ts+phi);
%+1/sqrt(20)*randn(1,N);
%%%SNR=20dB%%%
I1=Sn.*cos(2*pi*f0*n*Ts);
Q1=Sn.*sin(2*pi*f0*n*Ts);
%正交变换
II2=2*filter(S3_cic,1,I1);
QQ2=2*filter(S3_cic,1,Q1);
%CIC滤波
I2=II2(1:
D1:
N);
Q2=QQ2(1:
%10倍抽取
ll3=filter(B2,1,l2);
QQ3=filter(B2,1,Q2);
%HB滤波
I31=II3(1:
2:
N/D1);
Q31=QQ3(1:
%2倍抽取
l32=filter(B2,1,l31);
Q32=filter(B2,1,Q31);
l33=l32(1:
N/(2*D1));
Q33=Q32(1:
l34=filter(B2,1,l33);
Q34=filter(B2,1,Q33);
l3=l34(1:
N/(2*2*(D1)));
Q3=Q34(1:
l41=filter(b1,1,l3);
Q41=filter(b1,1,Q3);
%低通滤波
l4=l41(1:
D3:
N/(D1*D2));
Q4=Q41(1:
%5倍抽取
%%%%%%%画图显示%%%%%%%%%
figured)八
p_2.((0hs-ooo*TS)-snu=0°
))-gridon-
x-abe-(-一fon<
nizeu2Hbf卑「凹(sy)-y-abe-(-一fon<
nizeu2Hbf昴血(V)-)八s--e(-一fonisN-eu2=bf茹毬a4n-)«
2.(gca--noniweigh<
bo-d---nonCDN-e-=2)八figures
p_2.((「40000)=(「40000)v「040000)-Q」040000)--b」)-_egend(-a:
m>
bfQ」)s--e(-一fonisN-eu2=bf二>
Q」^^Ma4n-)«
2.(gca--noniweighr--bo-d---nonCDN-e-=2)-figure&
xpoHMengihu^Mv-lCDnguxQ^QZ-b^egendubfM-AbfQZ)-s--e(-一fon<
nN-eu2Hbf-2>
Q2^^Ma4n-)«
2.(gca--noniweighr--bo-d---nonCDN-e-=2)-figure©
)八
pourCDngihug-wv-lCDnguxQg-Qa-b-xegendcybfw-HbfQa)
s--e(-一fon<
nN-eu2Hbf-3>
Q3^^Ma4n-)«
2.(gca--noniweighr--bo-d---nonCDN-e-=2)-figureuoxpoHMengihKhKv-lCDnguxQ^QF-b-xegendcybfK-AbfQd-s--e(-一fonisN-eu2Hbf-4>
Q4^^Ma4n-)«
2.(gca--noniweighr--bo-d---nonCDN-e-=2)-figure三)-%画冃泓茹®
〉*0©
嵐徊^冃泓
subp-2.(2-23-p-2.(二-QDaxisequa--gridx-abe-(-一fon<
nizeu2Hbf一卫金◎忸二-)八y-abe-(-一fonisN-eu2=bfN^®
*Q」-)八s--e(-一fon<
nN-eu2Hbf二>
QlN^H®
-=s2.(gca--noniweighr--bo-d---FonCDN-e-=2)八
subp-2.(2-2-2)-p-2.(-2-Q2)-a>
.sequa--gridx-abe-(-一fon<
nizeu2Hbf回盘®
*-2-)八y_abe_30n<
nN-eu2Hbf冃泓®
*Q2)s_e30n<
nN-eu2Hbf_2>
02冃泓国®
)s2.(gca--noniweighr--bo-d---FonCDN-e-=2)八
subp-2.(2-2-3)-p-2.(-3-Q3)-a>
*-3-)八y_abe_30n<
*Q3)s_e30n<
nN-eu2Hbf_3>
03冃泓国®
subp-2.(2-2-4)-p-2.(-4-Q4)-a>
*-4-)八y-abe-(-一fonisN-eu2=bfN^®
*Q4-)八s--e(-一fon<
nN-eu2Hbf-4>
Q4N^H®
%%%%瞬酋%%%%sig"
2*_4+j*2*Q*anMabs(sig)八pnoMas-n2(Q4--4)TJnMunwrap(pno=
Fp=filter(B5,1,Pn);
Fn=filter(b2,1,Fp);
%鉴频低通滤波
ff=-diff(phi);
%理论值求解
ff=ff(1:
100:
length(ff));
figure(12);
subplot(2,1,1),plot(Fn,'
r'
\fontsize{12}\bf解调结果'
subplot(2,1,2),plot(ff,'
\fontsize{12}\bf理论解调结果'
第二题源程序:
%=================================================================%%软件无线电第二题
%信道化接收
%================================================================%clc;
clearall;
N=1120;
%低通滤波器长度
M=70;
%划分通道数
K=16;
%多相滤波器长度
fs=210e6;
%采样频率
Bw=85e6;
%信号带宽Bw=fh-fl
f0=262.5e6;
%信号中心频率
fl=f0-Bw/2;
%最低工作频率
fh=f0+Bw/2;
%最高工作频率
T=100e-6;
%LFM信号脉宽
Bs=3e6;
%每个信道带宽
N-1;
%输入信号
f1=242.5e6;
%chirp1中心频率
f2=267.5e6;
%chirp2中心频率
SNR=10;
%信噪比t=-T/2:
1/fs:
T/2-1/fs;
w1=2*pi*f1;
BW1=600e3;
%chirp1带宽w2=2*pi*f2;
BW2=300e3;
%chirp1带宽
z1t=cos(w1*t+BW1/T*pi*t.*t);
%chirp1
z2t=cos(w2*t+BW2/T*pi*t.*t);
%chirp2
zt=z1t+z2t+(10.A(-10/20))*randn(1,length(t));
%信号+噪声
DFzt=fft(zt);
DFz1t=fft(z1t);
DFz2t=fft(z2t);
%信号的频谱
figure
(1)
subplot(3,2,1);
plot(0:
(fs*T-1),zt);
时域'
zt=chirp1+chirp2+noise'
subplot(3,2,2);
plot((-0.5:
1/(fs*T):
0.5-1/(fs*T))*fs,abs(DFzt));
频域'
subplot(3,2,3);
(fs*T-1),z1t);
chirp1'
subplot(3,2,4);
0.5-1/(fs*T))*fs,abs(DFz1t));
subplot(3,2,5);
(fs*T-1),z2t);
chirp2'
subplot(3,2,6);
0.5-1/(fs*T))*fs,abs(DFz2t));
%设计低通滤波器
f=[Bs,1.5*Bs]/fs;
m1=[1,0];
Rp=1;
Rs=40;
datl=(10A(Rp/20)-1)/(10A(Rp/20)+1);
dat2=10A(-Rs/20);
rip=[dat1,dat2];
[MM,ff,mm,ww]=remezord(f,m1,rip);
hh=remez(N-1,ff,mm,ww);
figure
(2)
freqz(hh);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%直接低通滤波
fork=0:
M-1
z1h=conv(z1t,hh.*exp(-j*2*pi*k*n/M));
z2h=conv(z2t,hh.*exp(-j*2*pi*k*n/M));
zh=conv(zt,hh.*exp(-j*2*pi*k*n/M));
m=0:
size(t)-1;
W=exp(-j*2*pi/M*m*k);
z1w=z1h.*W;
z2w=z2h.*W;
zw=zh.*W;
z1k_temp=reshape([z1w,zeros(1,M-rem(length(z1w),M))],M,[]);
z2k_temp=reshape([z2w,zeros(1,M-rem(length(z2w),M))],M,[]);
zk_temp=reshape([zw,zeros(1,M-rem(length(z1w),M))],M,[]);
z1k(k+1,:
)=z1k_temp(k+1,:
z2k(k+1,:
)=z2k_temp(k+1,:
zk(k+1,:
)=zk_temp(k+1,:
ifk<
M/2
figure(3)
subplot(7,5,k+1);
plot([0:
length(zk_temp)-1]*pi/length(zk_temp),real(zk(k+1,:
)));
temp1=['
\fontsize{12}\bf通道'
num2str(k)];
axis([0pi-.6.6]);
title(temp1);
figure(4)
length(zk_temp)-1]*pi/length(zk_temp),abs(fft(zk(k+1,:
))));
axis([0pi035]);
end
figure(5)
plot(real(zk(12,:
)))
通道11波形'
zk_fft=abs(fft(zk(12,:
)))/max(abs(fft(zk(12,:
figure(6)
plot(((0:
length(zk_fft)-1)*Bs/length(zk_fft)),fftshift(zk_fft))
频率'
归一化幅度'
通道11信号频谱'
figure(7)
plot(abs(xcorr(zk(12,:
),zk(12,:
))))
通道11脉压结果'
figure(8)
plot(real(zk(20,:
通道19波形'
zk_fft=abs(fft(zk(20,:
)))/max(abs(fft(zk(20,:
figure(9)
通道19信号频谱'
figure(10)
plot(abs(xcorr(zk(20,:
),zk(20,:
通道19脉压结果'
第三题源程序:
%============================================================%%软件无线电第三大题
%求圆阵的DBF方向图
%============================================================%
c=3e8;
%光速
f0=1e9;
%发射信号载频
fs=1000;
%采样频率
lambda=c/f0;
%发射信号波长
r=0.8;
%圆阵半径
N=30;
%圆阵个数
%30个圆阵编号
M=100;
%快拍数
m=1:
M;
theta0=0;
%目标角度,单位为度
theta1=30;