Skip to content

Commit

Permalink
Fixed spelling issues and removed util
Browse files Browse the repository at this point in the history
  • Loading branch information
krishna-praneet committed Mar 9, 2024
1 parent 7122b7d commit 3400dfe
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 69 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Manifest.toml
.vscode/
.vscode/
.DS_Store
3 changes: 1 addition & 2 deletions src/LDPCDecoders.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ export
BeliefPropagationDecoder

include("generator.jl")
include("util.jl")
include("parity.jl")
include("bp_decoder.jl")
include("bp_simulator.jl")
include("it_decoder.jl")
include("parity_generator.jl")

include("decoders/abstract_decoder.jl")
include("decoders/belief_propogation.jl")
include("decoders/belief_propagation.jl")
include("syndrome_bp_decoder.jl")
include("syndrome_simulator.jl")
include("syndrome_it_decoder.jl")
Expand Down
2 changes: 1 addition & 1 deletion src/bp_decoder.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function bp_decode(parity_check_matrix, received_message, error_rate, max_iterat
message_c2v = zeros(num_checks, num_bits)
initialise_checks!(parity_check_matrix, message_c2v, syndrome, num_vs, num_cs)

# Intialize llr for variable nodes
# Initialize llr for variable nodes
vllr = llr.(received_message, error_rate)

# Send message from variable to check nodes
Expand Down
2 changes: 1 addition & 1 deletion src/bp_simulator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function bp_simulate(parity_check_matrix, generator_matrix, error_rate, max_tria

# syndrome = (pcm * error) .% 2

# Belief propogation decoder
# Belief propagation decoder
decoded_message, success = bp_decode(received_message, parity_check_matrix, 0.1)
println("decoded message = ", decoded_message)
display(decoded_message)
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions src/syndrome_bp_decoder.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# TODO: Depricated, to be removed. Only new implementation is required.
# TODO: Deprecated, to be removed. Only new implementation is required.
function syndrome_decode(pcm, pcmT, syndrome, max_iters, channel_probs, b2c, c2b, log_probabs, error)

# Get size of Parity check matrix
m, n = size(pcm)
rows = rowvals(pcm)
rowsT = rowvals(pcmT)

# Initiliase bit to check messages
# Initialize bit to check messages
for j in 1:n
for k in nzrange(pcm, j)
i = rows[k]
Expand Down Expand Up @@ -108,7 +108,7 @@ function syndrome_decode!(decoder::BeliefPropagationDecoder, setup::BeliefPropag
rows = rowvals(decoder.sparse_H)
rowsT = rowvals(decoder.sparse_HT)

# Initiliase bit to check messages
# Initialize bit to check messages
for j in 1:n
for k in nzrange(decoder.sparse_H, j)
i = rows[k]
Expand Down
2 changes: 1 addition & 1 deletion src/syndrome_it_simulate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function syndrome_it_simulate(parity_check_matrix, physical_error_rate, max_tria
@info "Simulating for $physical_error_rate for $max_trials trials"
tenths = floor(max_trials/10)

# Initalization
# Initialization
err = zeros(Bool, num_bits)
votes = zeros(Int, num_bits)
curr_syn = zeros(Bool, num_checks)
Expand Down
4 changes: 2 additions & 2 deletions src/syndrome_simulator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function syndrome_simulate(parity_check_matrix, physical_error_rate, max_trials)
@info "Simulating for $physical_error_rate for $max_trials trials"
tenths = floor(max_trials/10)

# Initalization
# Initialization
log_probabs = zeros(num_bits)
channel_probabs = fill(physical_error_rate, num_bits)
b2c = zeros(num_checks, num_bits)
Expand All @@ -24,7 +24,7 @@ function syndrome_simulate(parity_check_matrix, physical_error_rate, max_trials)

syndrome = (parity_check_matrix * error) .% 2

# Belief propogation decoder
# Belief propagation decoder
decoded_error, decoded = syndrome_decode(parity_check_matrix, parity_check_matrix_T, syndrome, 10, copy(channel_probabs), copy(b2c), copy(c2b), copy(log_probabs), copy(err))

if decoded == true
Expand Down
58 changes: 0 additions & 58 deletions src/util.jl

This file was deleted.

0 comments on commit 3400dfe

Please sign in to comment.