資源簡介
基于DVB標準來說明OFDM技術的信號的調制、發射、接收和解調過程,并基于MATLAB對整個通信鏈路進行了仿真。

代碼片段和文件信息
%DVB-T?2K?Reception
clear?all;
close?all;
clc;
Tu=224e-6;?%useful?OFDM?symbol?period
T=Tu/2048;?%baseband?elementary?period
G=0;?%choice?of?1/4?1/8?1/16?and?1/32
delta=G*Tu;?%guard?band?duration
Ts=delta+Tu;?%total?OFDM?symbol?period
Kmax=1705;?%number?of?subcarriers
Kmin=0;
FS=4096;?%IFFT/FFT?length
q=10;?%carrier?period?to?elementary?period?ratio
fc=q*1/T;?%carrier?frequency
Rs=4*fc;?%simulation?period
t=0:1/Rs:Tu;
tt=0:T/2:Tu;
%Data?generator
sM?=?2;
[xy]?=?meshgrid((-sM+1):2:(sM-1)(-sM+1):2:(sM-1));
alphabet?=?x(:)?+?1i*y(:);
N=Kmax+1;
rand(‘state‘0);
a=-1+2*round(rand(N1)).‘+?1i*(-1+2*round(rand(N1))).‘;
A=length(a);
info=zeros(FS1);
info(1:(A/2))?=?[?a(1:(A/2)).‘];
info((FS-((A/2)-1)):FS)?=?[?a(((A/2)+1):A).‘];
carriers=FS.*ifft(infoFS);
%Upconverter
L?=?length(carriers);
chips?=?[?carriers.‘;zeros((2*q)-1L)];
p=1/Rs:1/Rs:T/2;
g=ones(length(p)1);
dummy=conv(gchips(:));
u=[dummy;?zeros(461)];
[baa]?=?butter(131/20);
uoft?=?filter(baau);
delay=64;??????%Reconstruction?filter?delay
s_tilde=(uoft(delay+(1:length(t))).‘).*exp(1i*2*pi*fc*t);
s=real(s_tilde);
%OFDM?RECEPTION
%Downconversion
r_tilde=exp(-1i*2*pi*fc*t).*?s;?%(F)
figure(1);
subplot(211);
plot(treal(r_tilde));
axis([0e-7?12e-7?-60?60]);
grid?on;
subplot(212);
plot(timag(r_tilde));
axis([0e-7?12e-7?-100?150]);
grid?on;
figure(2);
ff=(Rs)*(1:(q*FS))/(q*FS);
subplot(211);
plot(ffabs(fft(r_tildeq*FS))/FS);
grid?on;
subplot(212);
%?pwelch(r_tilde[][][]Rs);
[Pxx1ff1]=pwelch(r_tilde[][][]Rs);
plot_Pxx1=10*log10(Pxx1);
subplot(212);
plot(ff1plot_Pxx1);
grid?on;
%Carrier?suppression
[BAA]?=?butter(31/2);
%?[HF]?=?freqz(BAAFSRs);
%?figure(6);
%?plot(F20*log10(abs(H)));
r_info?=?2*filter(BAAr_tilde);?%baseband?signal?continuous-time?(G)
figure(3);
subplot(211);
plot(treal(r_info));
axis([0?12e-7?-60?60]);
grid?on;
figure(3);
subplot(212);
plot(timag(r_info));
axis([0?12e-7?-100?150]);
grid?on;
figure(4);
f=(2/T)*(1:(FS))/(FS);
subplot(211);
plot(ffabs(fft(r_infoq*FS))/FS);
grid?on;
subplot(212);
%?pwelch(r_info[][][]Rs);
[Pxx2ff2]=pwelch(r_info[][][]Rs);
plot_Pxx2=10*log10(Pxx2);
subplot(212);
plot(ff2plot_Pxx2);
grid?on;
%Sampling
r_data?=?real(r_info(1:(2*q):length(t)))?+?1i*imag(r_info(1:(2*q):length(t)));?%?(H)
figure(5);
subplot(211);
stem(tt(1:20)(real(r_data(1:20))));
axis([0?12e-7?-60?60]);
grid?on;
subplot(212);
stem(tt(1:20)(imag(r_data(1:20))));
axis([0?12e-7?-100?150]);
grid?on;
figure(6);
f=(2/T)*(1:(FS))/(FS);
subplot(211);
plot(fabs(fft(r_dataFS))/FS);
grid?on;
subplot(212);
%?pwelch(r_data[][][]2/T);
[Pxx3ff3]=pwelch(r_data[][][]Rs);
plot_Pxx3=10*log10(Pxx3);
subplot(212);
plot(ff3plot_Pxx3);
grid?on;
%FFT
info_2N=(1/FS).*fft(r_data?FS);?%?(I)
info_h=[info_2N(1:A/2)?info_2N((FS-((A/2)-1)):FS)];
%Slicing
for?k=1:N
a_hat(k)?=?alphabet((info_h(k)-alphabet)?==?min(info
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3305??2017-03-14?17:06??OFDM_Reception.m
?????文件???????2875??2017-03-14?17:08??OFDM_Transmission.m
-----------?---------??----------?-----??----
?????????????????6180????????????????????2
評論
共有 條評論