I've been re-creating the example for process.m from the Matlab Scripting API manual and have come across some results I'm trying to figure out. What I do is run the example in two separate ways. The first method follows exactly as the manual describes and the call to process() uses a value for NUMBLOCKS that process the entire signal at once. In the second method, I instead call process() iteratively with NUMBLOCKS=1. When I take a difference between the outputs I get some results that I can't explain:
What I'm trying to figure out is why there is a difference at all. Is the state of the filter not stored between calls to process()? Now that I think about it, I might need to clear/reset the system in between runs to make sure the trials are consistent and the internal buffers are cleared. Any input would be greatly appreciated. I will eventually take the iterative approach for a much more complex system so I should understand the fundamentals before I move on to something of a much larger magnitude.
Thanks
2:43pm
Hi Graham,
There's some state in the module after the first call to process. If you reconstruct the system so that it starts block-by-block processing (NUMBLOCKS=1) with the same initial state as with the superblock processing (NUMBLOCK>1), the results will match. Take a look at the attached script that is a small change from yours starting at line 50.