matlab filter: max variable size allowed by function, error

1 view (last 30 days)
The following code,
Hm = mfilt.firinterp(interp, hh);
Hm.Numerator = interp*Hm.Numerator;
set(Hm,'arithmetic','single');
out = filter(Hm, data);
where interp=4 (integer), hh is 1x97 double, and data is 1x1048994399 single.
results in the following error:
Error using sfirinterpfilter
Maximum variable size allowed by the function is exceeded.
Error in dfilt.singlefilterquantizer/firinterpfilter (line 11)
[y,z,tapidx] = sfirinterpfilter(p,L,x,uint32(ny),z,tapidx);
Error in mfilt.firinterp/secfilter (line 20)
[y,z,tapidx] = firinterpfilter(Hm.filterquantizer, ...
Error in dfilt.abstractfilter/super_filter (line 61)
[y,zf] = secfilter(Hd,[xi;x(1:end-rs,:)],zi);
Error in dfilt.abstractfilter/filter (line 12)
y = super_filter(varargin{:});
Error in r_sc1 (line 612)
out = filter(Hm, data);
Anyone know the limit for filter in this case? And/or how to workaround this error (e.g. is it possible to split the filtering into two operations, etc.)?

Answers (1)

Walter Roberson
Walter Roberson on 6 Aug 2015
With regards to breaking it up into runs: see http://www.mathworks.com/help/dsp/ref/mfilt.firinterp.html PersistentMemory and States .
You have a Finite Impulse Response filter so it is only necessary for the filter to remember length(hh) values to be able to stop filtering and pick up again later at the next sample.
  1 Comment
GG
GG on 6 Aug 2015
Thanks for the hint Walter. It seems the PersistentMemory setting enables the States functionality. I found the following link that provides an example: http://www.mathworks.com/help/dsp/ref/filter.html

Sign in to comment.

Categories

Find more on Get Started with DSP System Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!