Skip to content

Commit

Permalink
cleanup before code push
Browse files Browse the repository at this point in the history
  • Loading branch information
osh committed Sep 12, 2016
1 parent 00c1bb8 commit e0cac7f
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 348 deletions.
177 changes: 0 additions & 177 deletions RMNIST_Visualize.ipynb

This file was deleted.

Empty file removed dataset1/.gitignore
Empty file.
27 changes: 2 additions & 25 deletions generate_dataset3.py → generate_RML2016.04c.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
'''

apply_channel = True

output = {}
#snr_vals = [-10,-8,-6,-4,-2,0,2,4,6,8,10,12,14,16,18,20]
min_length = 9e9
snr_vals = range(-20,20,2)
for snr in snr_vals:
Expand All @@ -30,7 +28,6 @@
tx_len = int(20e3)
src = source_alphabet(alphabet_type, tx_len, True)
mod = mod_type()
#chan = channels.selective_fading_model(8, 20.0/1e6, False, 4.0, 0, (0.0,0.1,1.3), (1,0.99,0.97), 8)
fD = 1
delays = [0.0, 0.9, 1.7]
mags = [1, 0.8, 0.3]
Expand All @@ -39,8 +36,6 @@
print noise_amp
#noise_amp = 0.1
chan = channels.dynamic_channel_model( 200e3, 0.01, 1e2, 0.01, 1e3, 8, fD, True, 4, delays, mags, ntaps, noise_amp, 0x1337 )
#chan = channels.dynamic_channel_model( 200e3, 0, 1e3, 0, 1e3, 8, fD, True, 4, delays, mags, ntaps, noise_amp, 0x1337 )
#chan = channels.dynamic_channel_model( 200e3, 0.1, 1e3, 0.1, 1e3, 8, fD, True, 4, delays, mags, ntaps, noise_amp, 0x1337 )

snk = blocks.vector_sink_c()

Expand All @@ -59,31 +54,13 @@
min_length_mod = mod_type
output[(mod_type.modname, snr)] = modulated_vector

#plt.figure()
#plt.subplot(2,1,1)
x = snk.data()
#plt.plot(10*np.log10(numpy.fft.fftshift(numpy.fft.fft(x[0:100000]))))
#plt.title("Power Spectrum of Modulated %s"%(mod_type.modname))
#plt.subplot(2,1,2)
#plt.plot(x[0:100000])
#plt.title("Time Plot of Modulated %s"%(mod_type.modname))
#plt.savefig('dataset1/%s.png'%(mod_type.modname))

print "min length mod is %s with %i samples" % (min_length_mod, min_length)
# trim the beginning and ends, and make all mods have equal number of samples
start_indx = 100
fin_indx = min_length-100
for mod, snr in output:
output[(mod,snr)] = output[(mod,snr)][start_indx:fin_indx]
#X = timeseries_slicer.slice_timeseries_dict(output, 64, 32, 1000)
X = timeseries_slicer.slice_timeseries_dict(output, 128, 64, 1000)
cPickle.dump( X, file("X_3_dict.dat", "wb" ) )
#cPickle.dump( X, gzip.open("X_1_dict.pkl.gz", "wb" ) )
#print len(X), X[X.keys()[0]].shape
cPickle.dump( X, file("RML2014.04c_dict.dat", "wb" ) )
X = np.vstack(X.values())
print X.shape
cPickle.dump( X, file("X_3.dat", "wb" ) )
#cPickle.dump( X, gzip.open("X_1.pkl.gz", "wb" ) )

#plt.pause(5)
#plt.show()
cPickle.dump( X, file("RML2016.04c.dat", "wb" ) )
13 changes: 1 addition & 12 deletions generate_dataset4.py → generate_RML2016.10a.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
tx_len = int(30e3)
src = source_alphabet(alphabet_type, tx_len, True)
mod = mod_type()
#chan = channels.selective_fading_model(8, 20.0/1e6, False, 4.0, 0, (0.0,0.1,1.3), (1,0.99,0.97), 8)
fD = 1
delays = [0.0, 0.9, 1.7]
mags = [1, 0.8, 0.3]
Expand Down Expand Up @@ -83,15 +82,5 @@
insufficient_modsnr_vectors = False
# TODO: do a np permuter to shuffle here ?


#plt.figure()
#plt.subplot(2,1,1)
#x = snk.data()
#plt.plot(10*np.log10(numpy.fft.fftshift(numpy.fft.fft(x[0:100000]))))
#plt.title("Power Spectrum of Modulated %s"%(mod_type.modname))
#plt.subplot(2,1,2)
#plt.plot(x[0:100000])
#plt.title("Time Plot of Modulated %s"%(mod_type.modname))
#plt.savefig('dataset1/%s.png'%(mod_type.modname))
print "all done. writing to disk"
cPickle.dump( dataset, file("X_4_dict.dat", "wb" ) )
cPickle.dump( dataset, file("RML2016.10a_dict.dat", "wb" ) )
71 changes: 0 additions & 71 deletions generate_dataset1.py

This file was deleted.

63 changes: 0 additions & 63 deletions generate_dataset2.py

This file was deleted.

0 comments on commit e0cac7f

Please sign in to comment.