zoukankan      html  css  js  c++  java
  • CCS

    Generation of an OFDM signal

    The modulator and demodulator in an OFDM system are usually implemented by use
    of a parallel bank of tuned filters based on the discrete Fourier Transform (DFT). To
    demonstrate this implementation, let us consider an OFDM modulator that generates
    K independent subcarriers, where each subcarrier is modulated by symbols selected
    from a QAM signal constellation.

     

    Matlab Coding

     

     1 % MATLAB script for Illustrative Problem 8.2.
     2 echo on
     3 clear;
     4 K=10;N=2*K;T=100;
     5 a=rand(1,36); 
     6 a=sign(a-0.5);
     7 b=reshape(a,9,4);
    8 % Generate the 16QAM points 9 XXX=2*b(:,1)+b(:,2)+j*(2*b(:,3)+b(:,4)); 10 XX=XXX'; 11 X=[0 XX 0 conj(XX(9:-1:1))]; 12 xt=zeros(1,101); 13 for t=0:100 14 for k=0:N-1 15 xt(1,t+1)=xt(1,t+1)+1/sqrt(N)*X(k+1)*exp(j*2*pi*k*t/T); 16 echo off 17 end 18 end 19 echo on 20 xn=zeros(1,N); 21 for n=0:N-1 22 for k=0:N-1 23 xn(n+1)=xn(n+1)+1/sqrt(N)*X(k+1)*exp(j*2*pi*n*k/N); 24 echo off 25 end 26 end 27 echo on 28 pause % press any key to see a plot of x(t) 29 plot([0:100],abs(xt))

    30 % Check the difference between xn and samples of x(t)
    31 for n=0:N-1
    32     d(n+1)=xt(T/N*n+1)-xn(1+n);
    33     echo off
    34 end
    35 echo on
    36 e=norm(d);
    37 Y=zeros(1,10);
    38 for k=1:9
    39     for n=0:N-1
    40         Y(1,k+1)=Y(1,k+1)+1/sqrt(N)*xn(n+1)*exp(-j*2*pi*k*n/N);
    41         echo off
    42     end
    43 end
    44 echo on
    45 dd=Y(1:10)-X(1:10);
    46 ee=norm(dd);

    >> ee

    ee =

    1.7359e-14

    >> e

    e =

    4.1301e-14

    Reference,

      1. <<Contemporary Communication System using MATLAB>> - John G. Proakis

  • 相关阅读:
    HDU 5115 Dire Wolf (区间DP)
    HDU 4283 You Are the One(区间DP(最优出栈顺序))
    ZOJ 3469 Food Delivery(区间DP好题)
    LightOJ 1422 Halloween Costumes(区间DP)
    POJ 1651 Multiplication Puzzle(区间DP)
    NYOJ 石子合并(一)(区间DP)
    POJ 2955 Brackets(括号匹配一)
    POJ 1141 Brackets Sequence(括号匹配二)
    ZOJ 3537 Cake(凸包+区间DP)
    Graham求凸包模板
  • 原文地址:https://www.cnblogs.com/zzyzz/p/13702307.html
Copyright © 2011-2022 走看看