-
Notifications
You must be signed in to change notification settings - Fork 12
/
Figure5.jl
83 lines (71 loc) · 3.03 KB
/
Figure5.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#
# Running this file generates the data needed to generate Figure 5 in
#
# D. Neumann, T. Wiese, and W. Utschick, Learning the MMSE Channel Estimator,
# IEEE Transactions on Signal Processing, 2018.
#
push!(LOAD_PATH,".")
using DataFrames
using CSV
import SCM3GPP; const scm = SCM3GPP
import CondNormalMMSE; const mmse = CondNormalMMSE
import CondNormalTF; const cntf = CondNormalTF
include("sim_helpers.jl")
include("more_estimators.jl") # OMP and Genie MMSE
verbose = true
#-------------------------------------
# Simulation parameters
#
write_file = true
filename = "results/figure5.csv"
nBatches = 100
nBatchSize = 100
#-------------------------------------
# Channel Model
#
snr = 0 # [dB]
antennas = [8,16,32,64,96]
AS = 2.0 # standard deviation of Laplacian (angular spread)
nCoherence = 1
Channel = scm.SCMMulti(pathAS=AS, nPaths=1)
# method that generates "nBatches" channel realizations
get_channel(nAntennas, nCoherence, nBatches) = scm.generate_channel(Channel, nAntennas, nCoherence=nCoherence, nBatches = nBatches)
# method that samples C_delta from delta prior
get_cov(nAntennas) = scm.toeplitzHe( scm.generate_channel(Channel, nAntennas, nCoherence=1)[2][:] )
# get circulant vector that generates all covariance matrices for arbitrary delta (here: use delta=0)
get_circ_cov_generator(nAntennas) = real(scm.best_circulant_approximation(scm.scm_channel([0.0],[1.0],nAntennas,AS=AS)[2]))
results = DataFrame()
for iAntenna in 1:length(antennas)
nAntennas = antennas[iAntenna]
verbose && println("Simulating with ", nAntennas, " antennas")
# Conditionally normal estimators
cn_est = Dict{Symbol,Any}()
cn_est[:FastMMSE] = mmse.FastMMSE(snr, get_circ_cov_generator(nAntennas))
cn_est[:CircMMSE] = mmse.StructuredMMSE(snr, () -> get_cov(nAntennas), nSamples=16*nAntennas, transform = circ_trans)
cn_est[:ToepMMSE] = mmse.StructuredMMSE(snr, () -> get_cov(nAntennas), nSamples=16*nAntennas, transform = toep_trans)
cn_est[:DiscreteMMSE] = mmse.DiscreteMMSE(snr, () -> get_cov(nAntennas), nSamples=16*nAntennas)
cn_est[:CircML] = mmse.MLEst(snr, transform = circ_trans)
algs = Dict{Symbol,Any}()
algs[:GenieMMSE] = (y,h,h_cov) -> mmse_genie(y, h_cov, snr)
algs[:GenieOMP] = (y,h,h_cov) -> omp_genie(y, h)
for (alg,cn) in cn_est
algs[alg] = (y,h,h_cov) -> mmse.estimate(cn, y)
end
(errs,rates) = evaluate(algs, snr = snr, nBatches = nBatches, get_channel = () -> get_channel(nAntennas, nCoherence, nBatchSize), verbose = verbose)
for alg in keys(algs)
new_row = DataFrame(MSE = errs[alg],
rate = rates[alg],
Algorithm = String(alg),
SNR = snr,
nAntennas = nAntennas,
nCoherence = nCoherence)
if isempty(results)
results = new_row
else
results = vcat(results,new_row)
end
end
end
if write_file
CSV.write(filename, results)
end