Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: Debugging tips and tricks

  1. #1
    Junior Member
    Join Date
    Jul 2020

    Debugging tips and tricks

    I am wondering if anyone can share their debugging tips and tricks. With audio it can be tricky to find an issue that is not obvious in the code. Using an oscilloscope can help, but I sadly have not bought one yet. One thing I found to be a bit of a useful hack is to take the output signal you want to debug and put it to the right channel and the input to the left, then record it with something like audacity and look for any clues. I am wondering what yall may have found to be useful for these types of tasks?

    Best wishes and good health,

    Liam McGoldrick

  2. #2
    Senior Member
    Join Date
    Jul 2020
    I normally code an algorithm up initially in Python and can use all the nice tools/libraries like matplotlib.pyplot
    and scipy.signal (super useful this one for DSP, everything Matlab has but open-source and coded in Python,
    what's not to love?)

    That debugs the algorithm or idea itself in a friendly environment.

    Then re-code in plain C++ on the laptop using g++ (usually fixpoint rather than float at this point)
    and debug by writing raw sample files and reading them in Python to check its doing the same and
    waveforms / spectra are as expected - Audacity would also be good tool for this.

    Then I copy the guts into a Teensy Audio library sketch or library, knowing the code itself works.

    Basically don't move to testing on a more limited embedded environment till you have to, so that
    the remaining issues are those of porting the code, not writing it.

    [ after all you wouldn't design a spacecraft when in orbit, when you can do it on the ground ! ]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts