This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import h5py | |
| def read_process_h5(filename): | |
| """ Reads and processes the mat files provided in the SVHN dataset. | |
| Input: filename | |
| Ouptut: list of python dictionaries | |
| """ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import commpy.channelcoding.convcode as cc | |
| memory = np.array([2]) | |
| g_matrix = np.array([[05, 07]]) | |
| feedback = 00 | |
| trellis = cc.Trellis(memory, g_matrix) | |
| msg = np.random.randint(0, 2, 10) | |
| coded_bits = cc.conv_encode(msg, trellis) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from numpy import real, imag, arange | |
| from numpy.fft import fft, ifft | |
| from numpy.random import randint | |
| from commpy.modulation import QAMModem | |
| from commpy.impairments import add_frequency_offset | |
| import matplotlib.pyplot as plt | |
| # System Parameters | |
| # Sampling Frequency (Hz) | |
| Fs = 15.36e6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from numpy import array | |
| from commpy.channelcoding import Trellis | |
| # Define the number of memory elements | |
| # per input in the convolutional encoder | |
| memory = array([2]) | |
| # Define the generator matrix of | |
| # the convolutional encoder | |
| # Entries are in octal format |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from numpy import array, arange, power, log10, zeros, sqrt | |
| from numpy.random import randint, randn | |
| from commpy.channelcoding import turbo_encode, map_decode, Trellis | |
| from commpy.utilities import hamming_dist | |
| total_bits = 1000000 | |
| block_size = 1000 | |
| num_blocks = total_bits/block_size | |
| # Noise Variance |