jingxegwen852 于 2014.07.25 16:54 提问

Matlab下的QPSK+成形滤波的仿真问题

1，已知fs，fc，数据码率下如何确定接收端带通滤波器的带宽。

2，已知fs，fc，数据码率下如何确定相干解调后低通滤波器的带宽。

3，我根据自己的理解对滤波器参数进行了设定，但是发现误码率反而比没有滤波器的时候增大了，简而言之就是无论怎么设置，接收端增加滤波器后，误码率就会变大。

clc;clear;
fc = 5000000;
fs = 25000000;
N = 2000;
Tb = 1/5000000;
data = round(rand(1,N));
%转为极性码
data_NRZ = 2*data-1;
%分为IQ两路
I = zeros(1,N);
Q = zeros(1,N);
I(1:2:N-1) = data_NRZ(1:2:N-1);
I(2:2:N) = data_NRZ(1:2:N-1);
Q(1:2:N-1) = data_NRZ(2:2:N);
Q(2:2:N) = data_NRZ(2:2:N);
%插0
zero = fs*Tb;
for i = 1:zero*N
if rem(i,zero)==1
I0(i) = I((i-1)/zero+1);
Q0(i) = Q((i-1)/zero+1);
else
I0(i) = 0;
Q0(i) = 0;
end
end
%平方根升余弦滤波器
NT = 10; %滤波器阶数
rf = 0.1; %滚降系数
psf = rcosfir(rf,NT,zero,1/fs,'sqrt');
Ipulse = conv(I0,psf);
Qpulse = conv(Q0,psf);
%调制
num = NT*zero*2;
t = 0:1/fs:(N*zero+num)/fs-1/fs;
for i = 1:zero*N+num
Imod(i) = Ipulse(i)*sqrt(2)*cos(2*pi*fc*t(i));
Qmod(i) = Qpulse(i)*sqrt(2)*sin(2*pi*fc*t(i));
end
QPSK = Imod - Qmod;
%添加噪声
QPSK_in = awgn(QPSK,-5,'measured');
%接收滤波器
[B,A] = butter(4,[0.08,0.8],'bandpass');
QPSK_in2=filter(B,A,QPSK_in);
%接收端,解调
for i = 1:zero*N+num
Idem(i) = QPSK_in2(i)*sqrt(2)*cos(2*pi*fc*t(i));
Qdem(i) = -QPSK_in2(i)*sqrt(2)*sin(2*pi*fc*t(i));
end
%低通滤波器
[B,A] = butter(4,0.95,'low');
Idem=filter(B,A,Idem);
Qdem=filter(B,A,Qdem);
%匹配滤波
mtf = rcosfir(rf,NT,zero,fs,'sqrt');
Idem2 = conv(Idem,mtf);
Qdem2 = conv(Qdem,mtf);
%数据选择
for i = 1:zero*N
Isel(i) = Idem2(i+num);
Qsel(i) = Qdem2(i+num);
end
%提取码元
for i = 1:N
I_sam(i) = Isel((i-1)*zero+1);
Q_sam(i) = Qsel((i-1)*zero+1);
end
%判决
threshold = 0.0;
for i = 1:N
if I_sam(i)>=threshold
I_final(i) = 1;
else
I_final(i) = -1;
end
if Q_sam(i)>=threshold
Q_final(i) = 1;
else
Q_final(i) = -1;
end
end
%并串变换
data_final(1:2:N-1) = I_final(1:2:N-1);
data_final(2:2:N) = Q_final(1:2:N-1);
data_final = (data_final+1)/2;
[err,p_err]=biterr(data,data_final);
figure;
[h,w] = freqz(B,A);
%画出滤波器频谱
plot(w/pi*fs/2,h);grid on;
title('mplitude Response');
xlabel('Frequency (Hz)');ylabel('Amplitude');
figure;
f = -1000/2:1:1000/2-1;
S = fft(Idem(50:1:1049));
S = fftshift(S);
plot(f,abs(S)/N);