Esempio n. 1
0
def generate_integrated_frame(timeslots, subcarriers, active_subcarriers, cp_len, cs_len, alpha=.2):
    p_seed = utils.generate_seed('awesome preamble')
    f_seed = utils.generate_seed('awesome frame')
    subcarrier_map = mapping.get_subcarrier_map(subcarriers, active_subcarriers, dc_free=True)
    overlap = 2
    p, p_vals = preamble.symmetric_mapped_preamble(p_seed, 'rrc', alpha, active_subcarriers, subcarriers, subcarrier_map, overlap, cp_len, cs_len)
    frame_preamble, x_preamble = p
    p = gfdm_modulation.modulate_mapped_gfdm_block(np.concatenate((p_vals, p_vals, np.zeros((timeslots - 2) * active_subcarriers))), timeslots, subcarriers, active_subcarriers, overlap, alpha, dc_free=True)
    x_preamble = p[0:len(x_preamble)]

    d = utils.get_random_qpsk((timeslots - 4) * active_subcarriers, f_seed)
    d = np.tile(p_vals, timeslots)
    # d = np.concatenate((p_vals, p_vals, d, p_vals, p_vals))
    # d = utils.get_random_qpsk((timeslots - 2) * active_subcarriers, f_seed)
    # d = np.concatenate((p_vals, p_vals, d))


    d_frame = mod_frame = gfdm_modulation.modulate_mapped_gfdm_block(d, timeslots, subcarriers, active_subcarriers, overlap, alpha, dc_free=True)

    symbol = cyclic_prefix.add_cyclic_starfix(d_frame, cp_len, cs_len)

    window_ramp = cyclic_prefix.get_raised_cosine_ramp(cs_len, cyclic_prefix.get_window_len(cp_len, timeslots, subcarriers, cs_len))
    # d_frame = cyclic_prefix.pinch_block(symbol, window_ramp)

    H = filters.get_frequency_domain_filter('rrc', alpha, timeslots, subcarriers, overlap)
    return p, mod_frame, x_preamble, d, H
Esempio n. 2
0
def generate_reference_frame(timeslots,
                             subcarriers,
                             active_subcarriers,
                             cp_len,
                             cs_len,
                             alpha=.2):
    p_seed = utils.generate_seed('awesome preamble')
    f_seed = utils.generate_seed('awesome frame')
    subcarrier_map = mapping.get_subcarrier_map(subcarriers,
                                                active_subcarriers,
                                                dc_free=True)
    overlap = 2
    frame_preamble, x_preamble = preamble.mapped_preamble(
        p_seed, 'rrc', alpha, active_subcarriers, subcarriers, subcarrier_map,
        overlap, cp_len, cs_len)
    d = utils.get_random_qpsk(timeslots * active_subcarriers, f_seed)
    d_frame = mod_frame = gfdm_modulation.modulate_mapped_gfdm_block(
        d,
        timeslots,
        subcarriers,
        active_subcarriers,
        overlap,
        alpha,
        dc_free=True)
    symbol = cyclic_prefix.add_cyclic_starfix(d_frame, cp_len, cs_len)
    window_ramp = cyclic_prefix.get_raised_cosine_ramp(
        cs_len,
        cyclic_prefix.get_window_len(cp_len, timeslots, subcarriers, cs_len))
    d_frame = cyclic_prefix.pinch_block(symbol, window_ramp)

    H = filters.get_frequency_domain_filter('rrc', alpha, timeslots,
                                            subcarriers, overlap)
    return np.concatenate(
        (frame_preamble, d_frame)), mod_frame, x_preamble, d, H
Esempio n. 3
0
def get_sync_symbol(pn_symbols, H, K, L, cp_len, ramp_len):
    M = 2  # fixed for preamble
    pn_symbols = np.concatenate((pn_symbols, pn_symbols))
    D = get_data_matrix(pn_symbols, K, group_by_subcarrier=True)  # careful here! group by subcarrier is correct!
    symbol = x_symbol = gfdm_modulate_block(D, H, M, K, L, compat_mode=False)
    symbol = add_cyclic_starfix(symbol, cp_len, ramp_len)
    window_ramp = get_raised_cosine_ramp(ramp_len, get_window_len(cp_len, M, K, ramp_len))
    symbol = pinch_block(symbol, window_ramp)
    return symbol, x_symbol
Esempio n. 4
0
def generate_integrated_frame(timeslots,
                              subcarriers,
                              active_subcarriers,
                              cp_len,
                              cs_len,
                              alpha=.2):
    p_seed = utils.generate_seed('awesome preamble')
    f_seed = utils.generate_seed('awesome frame')
    subcarrier_map = mapping.get_subcarrier_map(subcarriers,
                                                active_subcarriers,
                                                dc_free=True)
    overlap = 2
    p, p_vals = preamble.symmetric_mapped_preamble(p_seed, 'rrc', alpha,
                                                   active_subcarriers,
                                                   subcarriers, subcarrier_map,
                                                   overlap, cp_len, cs_len)
    frame_preamble, x_preamble = p
    p = gfdm_modulation.modulate_mapped_gfdm_block(np.concatenate(
        (p_vals, p_vals, np.zeros((timeslots - 2) * active_subcarriers))),
                                                   timeslots,
                                                   subcarriers,
                                                   active_subcarriers,
                                                   overlap,
                                                   alpha,
                                                   dc_free=True)
    x_preamble = p[0:len(x_preamble)]

    d = utils.get_random_qpsk((timeslots - 4) * active_subcarriers, f_seed)
    d = np.tile(p_vals, timeslots)
    # d = np.concatenate((p_vals, p_vals, d, p_vals, p_vals))
    # d = utils.get_random_qpsk((timeslots - 2) * active_subcarriers, f_seed)
    # d = np.concatenate((p_vals, p_vals, d))

    d_frame = mod_frame = gfdm_modulation.modulate_mapped_gfdm_block(
        d,
        timeslots,
        subcarriers,
        active_subcarriers,
        overlap,
        alpha,
        dc_free=True)

    symbol = cyclic_prefix.add_cyclic_starfix(d_frame, cp_len, cs_len)

    window_ramp = cyclic_prefix.get_raised_cosine_ramp(
        cs_len,
        cyclic_prefix.get_window_len(cp_len, timeslots, subcarriers, cs_len))
    # d_frame = cyclic_prefix.pinch_block(symbol, window_ramp)

    H = filters.get_frequency_domain_filter('rrc', alpha, timeslots,
                                            subcarriers, overlap)
    return p, mod_frame, x_preamble, d, H
Esempio n. 5
0
def generate_reference_frame(timeslots, subcarriers, active_subcarriers, cp_len, cs_len, alpha=.2):
    p_seed = utils.generate_seed('awesome preamble')
    f_seed = utils.generate_seed('awesome frame')
    subcarrier_map = mapping.get_subcarrier_map(subcarriers, active_subcarriers, dc_free=True)
    overlap = 2
    frame_preamble, x_preamble = preamble.mapped_preamble(p_seed, 'rrc', alpha, active_subcarriers, subcarriers, subcarrier_map, overlap, cp_len, cs_len)
    d = utils.get_random_qpsk(timeslots * active_subcarriers, f_seed)
    d_frame = mod_frame = gfdm_modulation.modulate_mapped_gfdm_block(d, timeslots, subcarriers, active_subcarriers, overlap, alpha, dc_free=True)
    symbol = cyclic_prefix.add_cyclic_starfix(d_frame, cp_len, cs_len)
    window_ramp = cyclic_prefix.get_raised_cosine_ramp(cs_len, cyclic_prefix.get_window_len(cp_len, timeslots, subcarriers, cs_len))
    d_frame = cyclic_prefix.pinch_block(symbol, window_ramp)

    H = filters.get_frequency_domain_filter('rrc', alpha, timeslots, subcarriers, overlap)
    return np.concatenate((frame_preamble, d_frame)), mod_frame, x_preamble, d, H