Skip to main content

No project description provided

Project description

OTFS modulation

This repositiory is a foundamental toolbox of OTFS modulation crossing matlab and python.

How to use

All OTFS codes are uniform in matlab and python as a class of OTFS. This class is the whole process of OTFS. This section will illustrate the methods of this class following the process from Tx to Rx.

  • OTFS
    @nSubcarNum: the subcarrier number
    @nTimeslotNum: the timeslot number
    @batch_size(optional) : the batch size (only used in python).
    % matlab
    nSubcarNum = 16;
    nTimeslotNum = 7;
    otfs = OTFS(nSubcarNum, nTimeslotNum);
    
    # python
    nSubcarNum = 16;
    nTimeslotNum = 7;
    otfs = OTFS(nSubcarNum, nTimeslotNum);
    otfs = OTFS(nSubcarNum, nTimeslotNum, batch_size=4); # using batch
    
  • modulate
    @symbols: a vector of [(batch_size), nSubcarNum*nTimeslotNum], or a matrix in delay Doppler domain [(batch_size), Doppler, delay] or [(batch_size), nTimeslotNum ,nSubcarNum]
    % matlab
    otfs.modulate(x_origin);
    
    # python
    otfs.modulate(x_origin);
    
  • setChannel
    This methods has 2 kinds of inputs.
    • generate random channel
      If we use batch, the channel will be different for each sample in the batch. @p: the path number (scalar)
      @lmax: the maximal integer delay index (scalar)
      @kmax: the maximal integer Doppler index (scalar). If set to a float number, we use fractional Doppler
      % matlab
      otfs.setChannel("p", 6, "lmax", 11, "kmax", 3);
      
      # python
      otfs.setChannel(p=6, lmax=11, kmax=3);
      
    • generate fixed channel
      @gains: the channel gains of [(batch_size), p]
      @delays: the channel delays of [(batch_size), p]
      @dopplers: the channel Doppler shift of [(batch_size), p]
      % matlab
      otfs.setChannel("delays", [0, 1], "Dopplers", [2, 3], "gains", [0.5, 0.5]);
      
      # python
      # no batch
      otfs.setChannel(delays=[0, 1], dopplers=[2, 3], gains=[0.5, 0.5]);
      # using batch
      otfs.setChannel(delays=np.tile([0, 1], (batch_size, 1)), dopplers=np.tile([2, 3], (batch_size, 1)), gains=np.tile([0.5, 0.5], (batch_size, 1)));
      
  • getChannel
    return the Delay-Doppler domain channel matrix of [(batch_size), nSubcarNumnTimeslotNum, nSubcarNumnTimeslotNum]
    H_DD = otfs.getChannel();
    
  • passChannel
    @No: a scalar of the linear noise power
    # matlab & python
    otfs.passChannel(No);
    
  • demodulate
    • return value: the vectorized received signal in the delay Doppler domain, a vector of [(batch_size), nSubcarNum*nTimeslotNum]
    # matlab & python
    yDD = otfs.demodulate();
    

Samples

Before running any sample code, please make sure you are at the root path of this repository. Also, Matlab codes require running init in the command window first to load directories.

  • TestDetect: test all kinds of OTFS detectors
  • TestFractionalDoppler
  • TestOTFSAllFunctions: test all functions using random channels and fixed channels
  • TestWaveForms
  • Viterbo_MP_2018: this code is from Emanuele Viterbo. You can download his original code in this page.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

whatshow_phy_mod_otfs-1.0.1.tar.gz (8.9 kB view hashes)

Uploaded Source

Built Distribution

whatshow_phy_mod_otfs-1.0.1-py3-none-any.whl (8.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page