How to initialize adau variables ?
Hi,
i've a recursive filter used as a smoother, and i need to preset its N-1 input to some value at startup.
I can do this using timers or other stuff to give the requested value to the feedback element on startup,
but i want to know if there is any simpler method to do this.
Many thanks
Tom
Hello Tom,
Since no one has responded, perhaps there isn't a highly desirable solution (like initializing the variables directly). Of all the "other stuff" methods I could think of, the one shown below uses the least instructions:
One sample after startup, the delay allows a 1 through to switch the ABCD Comparator inserted where desired in your filter. It uses fewer instructions than an index mux. In this example the initial condition is applied to the whole filter, not just the one feedback term as it made the results show up in the Real-Time Display.
Best regards,
Bob
Hello Bob (the great),
many thanks for your answer. I'd already solved that in my way:
But i was curious if there was any 'zero instructions' solution.
You said that having variables initialized at some value it is not a desirable solution, but i think it is not a strange need, because, expecially on very slow processes (not just audio filters) i can choose to start from a 'some value' instead of zero.
Just like some .init section on the GCC compiler.
I can suggest this as a new feature to be inserted in the new SigmaStudio release.
Many thanks again.
Bye
Tom
Hi Tom,
Thanks for your kind words & for sharing an alternative method. It would be good for SigmaStudio to directly initialize variables where needed. I'm not certain which of the SigmaDSP chips can support this feature-- for example, in the -1701 there's no way to write to data memory via I2C / SPI, thus I don't know whether something SigmaStudio puts in the code could copy a parameter to the appropriate variable at startup. It's definitely a good question for the SigmaDSP team at ADI to consider.
Best regards,
Bob
Hello Tom,
Please fill me in if I am missing something but it is just the previous sample that will be zero when starting up correct? Then that zero will propagate through the filter and eventually the filter will settle. How long does this take? Why not either mute the audio for that period of time or start with a volume control all the way down and use a long slew to have it ramp up slowly. Then by that time the filter would have settled and you should not hear the thump or click?
Dave T
Please log in to reply.



