Necessity of clearing filter registers at RUN initialization

Algorithm development and general DSP issues

Moderator: frank

Post Reply
Digital Larry
Posts: 338
Joined: Mon Nov 12, 2012 1:12 pm
Contact:

Necessity of clearing filter registers at RUN initialization

Post by Digital Larry »

I think I've made or copied some filter code that clears the delay registers on program init and then does the SKP RUN thing later to allow normal use of the registers. I'm curious to know if this is really needed. Even garbage values in the registers would probably clear themselves out pretty quickly unless you were hovering on the edge of oscillation. I've also seen programs where the accumulator was cleared at the beginning.

Are the registers/accumulator set to some known value at program init?
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

General registers are not initialized but yes, some code like a basic filter generally won't care so you can avoid initializing. Don't recall on the accumulator but always good to assume it is not valid data at the start of the code and initialize it in some manner. Don't have to clear it, could use LDAX to load a register value or SOF to load a constant, depends on the program.
Frank Thomson
Experimental Noize
Post Reply