Skip to content

Commit

Permalink
Fix: 'Remove Carrier' encoding function skips input data
Browse files Browse the repository at this point in the history
Fix the encoding part of the 'Remove Carrier' decoding function by
flushing any initial carrier symbols before processing actual data.
  • Loading branch information
delta512 committed Aug 9, 2022
1 parent e72584f commit 8fbab14
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/urh/signalprocessing/Encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,10 @@ def code_carrier(self, decoding, inpt):
# Add carrier if encoding
if len(self.carrier) > 0:
x = 0
while self.carrier[x % len(self.carrier)] in ("0", "1", "*"):
output.append(False if self.carrier[x % len(self.carrier)] in (
"0", "*") else True) # Add 0 when there is a wildcard (*) in carrier description
x += 1
for i in inpt:
tmp = self.carrier[x % len(self.carrier)]
if not tmp in ("0", "1", "*"):
Expand Down

0 comments on commit 8fbab14

Please sign in to comment.