RENEWLab  1.1.0
RENEW project
hdf5_lib.hdf5_lib Class Reference

Public Member Functions

def __init__ (self, filename, n_frames_to_inspect=0, n_fr_insp_st=0, sub_sample=0)
 
def open_hdf5 (self)
 
def get_data (self)
 
def get_metadata (self)
 
def filter_pilots (cmpx_pilots, z_padding=150, fft_size=64, cp=16, pilot_type='lts', seq_length=[])
 
def log2csi_hdf5 (self, filename, offset=0)
 

Static Public Member Functions

def samps2csi (samps, num_users, samps_per_user=224, fft_size=64, offset=0, bound=94, cp=0, sub=1, legacy=False, pilot_f=[])
 
def samps2csi_large (samps, num_users, samps_per_user=224, offset=47, chunk_size=1000, legacy=False)
 
def frame_sanity (match_filt, k_lts, n_lts, st_frame=0, frame_to_plot=0, plt_ant=0, cp=16)
 

Public Attributes

 h5file
 
 filename
 
 dirpath
 
 h5struct
 
 data
 
 metadata
 
 pilot_samples
 
 uplink_samples
 
 downlink_samples
 
 noise_samples
 
 n_frm_st
 
 n_frm_end
 
 sub_sample
 

Constructor & Destructor Documentation

◆ __init__()

def hdf5_lib.hdf5_lib.__init__ (   self,
  filename,
  n_frames_to_inspect = 0,
  n_fr_insp_st = 0,
  sub_sample = 0 
)

Member Function Documentation

◆ filter_pilots()

def hdf5_lib.hdf5_lib.filter_pilots (   cmpx_pilots,
  z_padding = 150,
  fft_size = 64,
  cp = 16,
  pilot_type = 'lts',
  seq_length = [] 
)
 
Here is the call graph for this function:

◆ frame_sanity()

def hdf5_lib.hdf5_lib.frame_sanity (   match_filt,
  k_lts,
  n_lts,
  st_frame = 0,
  frame_to_plot = 0,
  plt_ant = 0,
  cp = 16 
)
static
Creates a map of the frames per antenna. 3 categories: Good frames, bad frames, probably partial frames.
Good frames are those where all k_lts peaks are present and spaced n_lts samples apart.
Bad frames are those with random peaks.
Potentially partial frames are those with some peaks at the right positions.
This is a random event. Some frames may have accidentally some peaks at the right places.
First the largest peak is detected, peaks at +1/-1 (probably due to multipath) and +CP/-CP samples are cleared out.
Then, the positions of the largest k_lts peaks are determined.
Finally, the function checks if these k_lts peaks are at the correct n_lts offstes.
Disclaimer: This function is good only for a high SNR scenario!

◆ get_data()

def hdf5_lib.hdf5_lib.get_data (   self)
Parse file to retrieve metadata and data.
HDF5 file has been written in DataRecorder.cpp (in Sounder folder)

Output:
    Data (hierarchy):
-Path
-Pilot_Samples
    --Samples
-UplinkData
    --Samples
Dimensions of input sample data (as shown in DataRecorder.cpp in Sounder):
    - Pilots
dims_pilot[0] = maxFrame
dims_pilot[1] = number of cells
dims_pilot[2] = number of UEs
dims_pilot[3] = number of antennas (at BS)
dims_pilot[4] = samples per symbol * 2 (IQ)

    - Uplink Data
dims_data[0] = maxFrame
dims_data[1] = number of cells
dims_data[2] = uplink symbols per frame
dims_data[3] = number of antennas (at BS)
dims_data[4] = samples per symbol * 2 (IQ)

◆ get_metadata()

def hdf5_lib.hdf5_lib.get_metadata (   self)
-Attributes
        {FREQ, RATE, PREFIX_LEN, POSTFIX_LEN, SLOT_SAMP_LEN, FFT_SIZE, CP_LEN,
        BEACON_SEQ_TYPE, PILOT_SEQ_TYPE, BS_HUB_ID, BS_SDR_NUM_PER_CELL, BS_SDR_ID, BS_NUM_CELLS,
        BS_CH_PER_RADIO, BS_FRAME_SCHED, BS_RX_GAIN_A, BS_TX_GAIN_A, BS_RX_GAIN_B, BS_TX_GAIN_B,
        BS_BEAMSWEEP, BS_BEACON_ANT, BS_NUM_ANT, BS_FRAME_LEN, CL_NUM, CL_CH_PER_RADIO, CL_AGC_EN,
        CL_RX_GAIN_A, CL_TX_GAIN_A, CL_RX_GAIN_B, CL_TX_GAIN_B, CL_FRAME_SCHED, CL_SDR_ID,
        CL_MODULATION, UL_SLOTS}

◆ log2csi_hdf5()

def hdf5_lib.hdf5_lib.log2csi_hdf5 (   self,
  filename,
  offset = 0 
)
Convert raw IQ log to CSI.

Converts input Argos HDF5 trace to frequency domain CSI and writes it to the same filename with -csi appended.

Args: filename of log

Returns: None
Here is the call graph for this function:

◆ open_hdf5()

def hdf5_lib.hdf5_lib.open_hdf5 (   self)
Get the most recent log file, open it if necessary.

◆ samps2csi()

def hdf5_lib.hdf5_lib.samps2csi (   samps,
  num_users,
  samps_per_user = 224,
  fft_size = 64,
  offset = 0,
  bound = 94,
  cp = 0,
  sub = 1,
  legacy = False,
  pilot_f = [] 
)
static
Convert an Argos HDF5 log file with raw IQ in to CSI.
Asumes 802.11 style LTS used for trace collection.
    
Args:
    samps: The h5py or numpy array containing the raw IQ samples,
dims = [Frame, Cell, User, Antenna, Sample].
    num_users: Number of users used in trace collection. (Last 'user' is noise.)
    samps_per_user: Number of samples allocated to each user in each frame.
     
Returns:
    csi: Complex numpy array with [Frame, Cell, User, Pilot Rep, Antenna, Subcarrier]
    iq: Complex numpy array of raw IQ samples [Frame, Cell, User, Pilot Rep, Antenna, samples]
     
Example:
    h5log = h5py.File(filename,'r')
    csi,iq = samps2csi(h5log['Pilot_Samples'], h5log.attrs['num_mob_ant']+1, h5log.attrs['samples_per_user'])
Here is the caller graph for this function:

◆ samps2csi_large()

def hdf5_lib.hdf5_lib.samps2csi_large (   samps,
  num_users,
  samps_per_user = 224,
  offset = 47,
  chunk_size = 1000,
  legacy = False 
)
static
Wrapper function for samps2csi_main for to speed up large logs by leveraging data-locality. Chunk_size may need to be adjusted based on your computer.
Here is the call graph for this function:

Member Data Documentation

◆ data

hdf5_lib.hdf5_lib.data

◆ dirpath

hdf5_lib.hdf5_lib.dirpath

◆ downlink_samples

hdf5_lib.hdf5_lib.downlink_samples

◆ filename

hdf5_lib.hdf5_lib.filename

◆ h5file

hdf5_lib.hdf5_lib.h5file

◆ h5struct

hdf5_lib.hdf5_lib.h5struct

◆ metadata

hdf5_lib.hdf5_lib.metadata

◆ n_frm_end

hdf5_lib.hdf5_lib.n_frm_end

◆ n_frm_st

hdf5_lib.hdf5_lib.n_frm_st

◆ noise_samples

hdf5_lib.hdf5_lib.noise_samples

◆ pilot_samples

hdf5_lib.hdf5_lib.pilot_samples

◆ sub_sample

hdf5_lib.hdf5_lib.sub_sample

◆ uplink_samples

hdf5_lib.hdf5_lib.uplink_samples

The documentation for this class was generated from the following file: