Skip to content

Commit

Permalink
Corrected an error -- moved calculation of auto_threshold before decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
wincentbalin committed Apr 23, 2011
1 parent 4922148 commit 1d324da
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions mcu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,16 +337,6 @@ MCU::run(RtAudioCallback input_function, std::vector<sample_t>* b)
buffer->begin() + sample_end,
std::back_inserter(sample_buffer));


// Decode result
decode_aiken_biphase(sample_buffer);

// Print bit string if needed
if(verbose)
{
std::cout << std::endl << "Bit string: " << bitstring << std::endl << std::endl;
}

// Automatically set threshold if requested
if(auto_thres > 0)
{
Expand All @@ -360,6 +350,15 @@ MCU::run(RtAudioCallback input_function, std::vector<sample_t>* b)
<< " (" << auto_thres << "% of max)" << std::endl;
}

// Decode result
decode_aiken_biphase(sample_buffer);

// Print bit string if needed
if(verbose)
{
std::cout << std::endl << "Bit string: " << bitstring << std::endl << std::endl;
}

// Create reversed bit string
std::string reversed_bitstring = bitstring;
std::reverse(reversed_bitstring.begin(), reversed_bitstring.end());
Expand Down

0 comments on commit 1d324da

Please sign in to comment.